I'm using the SQL Server JDBC drivers provided by microsoft and right now I've un into a problem getting data from SQL Server where the column is the mssql type "real". I've tried getDouble() and getFloat() but the exception I get says
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Value can not be converted to requested type.
Anyone know of a FREE type 4 JDBC driver for SQL Server that knows how to handle reals?
The type number returned is 7 and the type name is "real". As you all know there is no ResultSet.getReal() function and getDouble(), getFloat(), getBigDecimal() all do not work, the SQL exception is thrown.
Joined: Aug 02, 2004
Well, I'm afraid I draw a blank. This is Sun's helpful recommendation:
So you're obviously doing something wrong. You could always check the scale (getScale) and precision (getPrecision) using the ResultSetMetaData to see if the type is somehow too big. Or better still check the database! :roll:
[edited to add line breaks] [ August 26, 2004: Message edited by: Jeanne Boyarsky ]