Errors when using PreparedStatement.setNull(i,Types.OTHER) on some RDBMS
------------------------------------------------------------------------
Key: IBATIS-536
URL: https://issues.apache.org/jira/browse/IBATIS-536
Project: iBatis for Java
Issue Type: Bug
Affects Versions: 2.3.3
Environment: Apache Derby Embedded
Informix
Microsoft SQL Server
DB2
jConnect
SQLServer
Reporter: Sébastien Launay
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)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.