• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get chained SQL warnings

 
David Weise
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic