1

I'm currently working 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

Harald Scheirich
  • 9,676
  • 29
  • 53
Patrick McDaniel
  • 1,073
  • 4
  • 11
  • 28
  • I don't have a straight answer to the particular question but it may be good to know that the Sourceforge jTDS driver works perfectly with DSN's as well. I would on the other hand also not be surprised if the MSSQL's own driver does so as well (ODBC is namely Microsoft proprietary stuff), but don't pin me on that. Just consult its documentation for details. At least, any other driver than the lousy ODBC bridge driver is always a big step ahead. – BalusC Feb 08 '10 at 19:00
  • Do you have any information on using jTDS with a DSN? I've looked around, but can't pin down any specifics. – Patrick McDaniel Feb 10 '10 at 03:13

1 Answers1

0

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.

Rais Alam
  • 6,970
  • 12
  • 53
  • 84