aspose file tools
The moose likes JDBC and Relational Databases and the fly likes How to get chained SQL warnings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "How to get chained SQL warnings" Watch "How to get chained SQL warnings" New topic
Author

How to get chained SQL warnings

David Weise
Greenhorn

Joined: Mar 06, 2000
Posts: 3
Hi,
I am getting an Exception thrown during a database connection.
I am using this:
Class.forName("com.sybase.jdbc2.jdbc.SybDriver");
myConn = DriverManager.getConnection(dbLocation,dbUserName,dbPWD);
The exception thrown is
java.sql.SQLException: JZ00L: Login failed. Examine the SQLWarnings chained to this exception for the reason(s).
How do I see the SQLWarnings.
Dave
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Look up the API on SQLException. There is a method getNextException() which, used iteratively, can lead to a whole mess of other exceptions attached to the one exception object that was actually thrown and caught.


"I'm not back." - Bill Harding, Twister
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to get chained SQL warnings