JDBC: what kind of MSSQL errors are caught?

Michael Suedkamp ms at suedkm.franken.de
Wed Nov 14 02:54:32 EST 2001


Thanks for your answer! 

I found the getWarnings() methods in the JavaDoc of the classes
Connection, Statement and ResultSet of the package java.sql.
I tried to to call the Statement getWarnings() method after the execute()
call which caused the unique index constraint violation. But it only tells
me "The statement has been terminated" rather than the expected warning.
What am I doing wrong?

BTW, I use a FreeTDS snapshot which is rather old but I am very satisfied
with it's stability. The Statement.java file contains a version string
"1.24 2000/07/17". The classes TDSConnection and so on your mentioned are
not present in this distribution.

Thanks for more help

Michael

> 
> Take a look at the getWarnings() methods in TdsConnection, TdsResultSet,
> and TdsStatement.  Or, for a cruder quick-and-dirty approach, try adding
> -DTDS_SHOW_WARNINGS=Y to your invocation of the client.  For example:
> 
>  $ java -DTDS_SHOW_WARNINGS=Y myclient
> 
> Use of the getWarnings() is preferable, of course.  The other approach,
> which was implemented before Stefan Bodewig contributed his excellent
> work implementing the getWarnings() methods, just writes the server
> messages to the standard error file.
> 



More information about the FreeTDS mailing list