You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
After creating a PreparedStatement for SELECT, INSERT, etc., you were able to query the parameter type in release 3.41.2.1. Now in 3.46.1.3 this is no longer possible. It's very useful to detect the parameter type in SQLite (even if it can be dynamic within the actual table rows) in order to execute generic import processes.
To Reproduce
Create a table in a SQLite file. The columns will have types, as defined in the CREATE command.
Then create PreparedStatement for an INSERT statement and call:
ParameterMetaDataparameterMetadata = statement.getParameterMetaData();
parameterMetadata.getParameterType(1); // This throws now
Expected behavior
In the past, this method would not throw. It would return a integer value (see java.sql.Types) corresponding to the column type provided in the CREATE statement.
Environment (please complete the following information):
OS: Windows 11
CPU architecture: x86_64
sqlite-jdbc version: 3.46.1.3
Additional context
I can technically get away with inspecting the type of value I am INSERT-ing and call the correct statement.set* method, because SQLite doesn't care. However, the code I am working with is meant to be generic and work with any JDBC implementation, so making a change would also break code working with Postgres, etc.
Please feel free to push back if you don't think this is expected JDBC behavior, and I will research other ways of determining the parameter type.
The text was updated successfully, but these errors were encountered:
Describe the bug
After creating a
PreparedStatement
forSELECT
,INSERT
, etc., you were able to query the parameter type in release3.41.2.1
. Now in3.46.1.3
this is no longer possible. It's very useful to detect the parameter type in SQLite (even if it can be dynamic within the actual table rows) in order to execute generic import processes.To Reproduce
Create a table in a SQLite file. The columns will have types, as defined in the
CREATE
command.Then create
PreparedStatement
for anINSERT
statement and call:Expected behavior
In the past, this method would not throw. It would return a integer value (see
java.sql.Types
) corresponding to the column type provided in the CREATE statement.Environment (please complete the following information):
Additional context
I can technically get away with inspecting the type of value I am INSERT-ing and call the correct
statement.set*
method, because SQLite doesn't care. However, the code I am working with is meant to be generic and work with any JDBC implementation, so making a change would also break code working with Postgres, etc.Please feel free to push back if you don't think this is expected JDBC behavior, and I will research other ways of determining the parameter type.
The text was updated successfully, but these errors were encountered: