Closed
Description
Bogdan Dumitrescu opened SPR-15977 and commented
Scenario:
- execute a prepared statement using JdbcTemplate inserting a row into MySQL 5.5:
jdbcTemplate.update("insert into users (id, name, description) values (?, ?, ?)", id, name, description);
- condition to reproduce: one of the arguments of the prepared statement is null. The column definition in MySQL corresponding to the null argument accepts null values.
When trying to execute the above with Spring 5.0 RC4 we are getting a "java.sql.SQLException: Parameter metadata not available for the given statement".
The same code executes fine when using the 4.3.11.RELEASE of spring-jdbc.
Using version 5.1.44 of mysql-connector-java, we're seeing the same behaviour on the following MySQL versions:
Ver 14.14 Distrib 5.5.53
Ver 14.14 Distrib 5.7.18-15
Affects: 5.0 RC4
Attachments:
- stacktrace.txt (3.65 kB)
Issue Links:
- Raise JDBC driver feature baseline to JDBC 4.0+ [SPR-13826] #18399 Raise JDBC driver feature baseline to JDBC 4.0+
- Doc: ParameterMetaData.getParameterType performance on Oracle 12c [SPR-16139] #20687 Doc: ParameterMetaData.getParameterType performance on Oracle 12c