File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "How to get chained SQL warnings" Watch "How to get chained SQL warnings" New topic

How to get chained SQL warnings

David Weise

Joined: Mar 06, 2000
Posts: 3
I am getting an Exception thrown during a database connection.
I am using this:
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.
Jim Yingst

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
I agree. Here's the link:
subject: How to get chained SQL warnings
It's not a secret anymore!