Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Determining column type, integer or long?

843859May 31 2010 — edited Nov 20 2014
I'm reading somebody's SQLite database and when I call getColumnType on ResultSetMetaData
I am getting 4 (integer) for types that I know are 64 bit longs (which should be BIGINT -5 right?).
At first I guessed it was the jdbc driver, but even when I use the sqlite3.exe tool to check the schema it just says INTEGER.

The code seems to work whether I call getInt or getLong (though obviously getInt returns the wrong
truncated values). Is it safe to call getLong regardless of the integer size? Will it screw up 32 bit
integer types? So far, it appears to handle getLong for 32 bits types just fine.

Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 29 2010
Added on May 31 2010
4 comments
154 views