sqlite-jdbc
sqlite-jdbc copied to clipboard
JDBC reports wrong type INTEGER but value is LONG
using 3.34.0 sqlite-jdbc
Create the following table
sql = "CREATE TABLE DateTestSQLTypes ( " +
" ID INT, " +
" Description VARCHAR(100), " +
" DateOnly DATE, " +
" TimeOnly TIME," +
" UtilDateAndTime DATETIME, " +
" DateAndTime DATETIME) ";
With JDBC insert a row. Then read back the row.
using ResultsetMetaData look at the types (for TimeOnly) column.
JDBC java.sql.Types reports 4 = INTEGER
value read back with getObject is actually a LONG.
If you read back with getInt() you get an integer wrapped back as a negative number (wrong value).
If the value is LONG the java.sql.Types should be -5 BIGINT