StatementCreatorUtils handling of null values incompatible with Informix [SPR-2407] #7096
Under 1.2.7, attempts to insert NULL's in JdbcTemplate.update using a prepared statement fail on Informix. They succeed under the 1.1 tree. The difference is
Old (StatementCreatorUtils, 94)
When the updated null handler runs on Informix, the update/insert fails, and you get this stack trace:
java.sql.SQLException: Unknown object type
Affects: 1.2.7, 2.0 RC3
The text was updated successfully, but these errors were encountered:
Juergen Hoeller commented
Thanks for pointing this out! It's a bit of a pain that databases differ in such subtle details. As you noticed, we also changed our strategy in Spring 1.2 there, since it was found to be the most compatible strategy for all databases that we tested against.
To be able to properly adapt to Informix, our StatementCreatorUtils uses "PreparedStatement.setObject(index, null)" for null values with unknown SQL type on Informix now. We simply have a special check that detects Informix via the metadata's database product name, choosing the appropriate null strategy accordingly.