Spring JDBC Template

queryForObject() should return null instead of throwing an Exception

Лицензия

Лицензия

Группа

Группа

cn.danielw
Идентификатор

Идентификатор

spring-jdbc-template
Последняя версия

Последняя версия

0.2.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

Spring JDBC Template
queryForObject() should return null instead of throwing an Exception
Ссылка на сайт

Ссылка на сайт

https://github.com/DanielYWoo/spring-jdbc-template
Система контроля версий

Система контроля версий

https://github.com/DanielYWoo/spring-jdbc-template

Скачать spring-jdbc-template

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/cn.danielw/spring-jdbc-template/ -->
<dependency>
    <groupId>cn.danielw</groupId>
    <artifactId>spring-jdbc-template</artifactId>
    <version>0.2.1</version>
</dependency>
// https://jarcasting.com/artifacts/cn.danielw/spring-jdbc-template/
implementation 'cn.danielw:spring-jdbc-template:0.2.1'
// https://jarcasting.com/artifacts/cn.danielw/spring-jdbc-template/
implementation ("cn.danielw:spring-jdbc-template:0.2.1")
'cn.danielw:spring-jdbc-template:jar:0.2.1'
<dependency org="cn.danielw" name="spring-jdbc-template" rev="0.2.1">
  <artifact name="spring-jdbc-template" type="jar" />
</dependency>
@Grapes(
@Grab(group='cn.danielw', module='spring-jdbc-template', version='0.2.1')
)
libraryDependencies += "cn.danielw" % "spring-jdbc-template" % "0.2.1"
[cn.danielw/spring-jdbc-template "0.2.1"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.springframework : spring-jdbc jar 4.3.6.RELEASE

test (3)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.11
org.mockito : mockito-core jar 2.7.10
com.h2database : h2 jar 1.4.193

Модули Проекта

Данный проект не имеет модулей.

Build Status

spring-jdbc-template

Spring jdbc template throws EmptyResultDataAccessException when no result is found, but 99.99% of developers expect NULL, right? This is a very simple wrapper for JdbcTemplate and NamedParameterJdbcTemplate, but returns null for queryForObject() methods.

usage

Exactly like Spring JdbcTemplate, actually it's a subclass of it.

e.g.

 int value = new JdbcTemplate(dataSource).queryForInt("select age from user where id=?", id);
 User u = new NamedParameterJdbcTemplate(dataSource).queryForObject(
    "select * from user where id=:id", params, rowMapper);

Версии библиотеки

Версия
0.2.1