Skip to Content.
Sympa Menu

freetds - Re: JDBC: what kind of MSSQL errors are caught?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Michael Suedkamp" <ms AT suedkm.franken.de>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: Re: JDBC: what kind of MSSQL errors are caught?
  • Date: Wed, 14 Nov 2001 02:54:32 -0500


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.
>




Archive powered by MHonArc 2.6.24.

Top of Page