[ https://issues.apache.org/jira/browse/IBATIS-536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631077#action_12631077 ]
Kai Grabfelder commented on IBATIS-536: --------------------------------------- if the spring guys are using the same code I vote for applying the fix ;-) > 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 > Attachments: IBATIS-536-ps-setNull-2008-09-15.patch > > > 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.