Hi in my ms sql database i have a column with type bigint but in java program while trying to retrieve i have written Long parentid=rs.getLong(1); but its giving me the following error
java.sql.SQLException: The value supplied cannot be converted to BIGINT. at net.sourceforge.jtds.jdbc.Support.convert(Support.java:570) at net.sourceforge.jtds.jdbc.JtdsResultSet.getLong(JtdsResultSet.java:661) at java.lang.Thread.run(Unknown Source)
Can anyone please tell me how to access the bigint in java.
Ruquia, I have never used the JTDS JDBC driver, but I imagine it must map database types to java classes. I also assume it has associated documentation and that documentation should list the mappings between database types and java classes.
Method "getLong()" returns a "long" (primitive). Method "getInt()" returns and "int" (primitive).
And Scott, how do you find the class of an Object using "instanceof"? Wouldn't it be easier to just print the class name? In other words: