Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.3
-
None
-
None
-
Apache Derby Embedded
Informix
Microsoft SQL Server
DB2
jConnect
SQLServer
Description
Firstly, i encountered an error with Derby (the same kind as described below):
http://markmail.org/message/ayosubiuw7cp7sdl
A workaround is to explicitly specify the JDBC type in the mapping but this is irritating .
And after searching, i found the same problems with Spring JdbcTemplate:
http://jira.springframework.org/browse/SPR-1234
http://jira.springframework.org/browse/SPR-2407
http://jira.springframework.org/browse/SPR-4465
http://jira.springframework.org/browse/SPR-4809
There are i think two reasons for these errors:
- using PrepareStatement.setNull(int, Types.OTHER) for any column type is not supported by all RDMS
- by default the jdbcType field ParameterMapping is set to 0 which is not a standard value for Types.* and is different than JdbcTypeRegistry.UNKNOWN_TYPE so most of the time the call is setNull(i, 0)