How to access a UniqueIdentifer column from Java's JDBC-ODBC bridge
I'm currently 开发者_如何学Goworking on a java program that will access an Microsoft SQL Server using the JDBC-ODBC bridge driver provided in the Java distribution.
Everything seems to be setup correctly and I can query basic data from the database, but when I try to run a query that gets a UniqueIdentifer field in it, when I do the subsequent ResultSet.getString()
it fails with:
java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Numeric value out of range
Has anyone experienced anything like this before? This works using the JDBC driver provided by Microsoft, but the customer wants to use the DSN they created.
If this is helpful when I run a Connection.getMetaData();
the UniqueIdentifer
field returns a DATA_TYPE
of 1111
If you call a batch of two or more Microsoft SQL Server stored procedures by using the ODBC Driver for SQL Server and by using the ODBC canonical {call X} method, you may receive the following error message from the driver:
Numeric Value Out Of Range
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Microsoft SQL Server 2000 Service Pack 3.
精彩评论