Let ParameterMetadata for PreparedStatement report correct ParameterType before execution #35
Labels
api: spanner
Issues related to the googleapis/java-spanner-jdbc API.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
Thanks for stopping by to let us know something could be better!
Is your feature request related to a problem? Please describe.
When using PreparedStatements with parameters, I need to obtain the parameters' JDBC Types before executing the PreparedStatement (so I can set the values of the parameters using the correct object types). The current version of the driver (v 1.12.0) does not allow this. Before executing the PreparedStatement, all parameters will be reported as JDBCType = 1111.
After manually setting the parameters and executing the PreparedStatement, the ParameterMetaData will then report the correct parameter types.
Describe the solution you'd like
ParameterMetaData to return the correct parameter types before PreparedStatement is executed.
Describe alternatives you've considered
The alternative is to do a column name matching using the destination table schema, so I'm able to figure out the data types of the destination columns, and set the objects accordingly. However, this feels like a hacky solution.
Additional context
Code snippet:
Thanks!
The text was updated successfully, but these errors were encountered: