O'Reilly logo

J2EE™ Applications and BEA™ WebLogic Server™ by Sandra L. Emerson, Rob Woollen, Michael Girdley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Error Handling and SQL Warnings

JDBC errors are thrown as exceptions. The specific class for representing these errors is java.sql.SQLException. As with any other exception, the appearance of an SQLException signifies that something has gone wrong and needs to be appropriately handled.

SQL warnings are represented by an instance of the java.sql.SQLWarning class that derives from the java.sql.SQLException class. It provides information on database access warnings. Unlike serious exceptions, SQL warnings are silently chained to the object whose method caused it to be reported.

Handling SQLException Errors

SQLExceptions store three pieces of information:

  • A string describing the error.

  • An SQLstate string, which follows the X/OPEN SQLstate conventions. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required