The SQLException Class
The SQLException class in JDBC provides a variety of information regarding errors that ocurred during a database access. The SQLException objects are chained, so a program can read them in order. This is a good mechanism, as an error condition can generate multiple errors and the final error might not have anything to do with tha actual error condition. By chaning the errors, you can actually pinpoint the first error. Each SQLException has an error message and vendor-specific error code. Also associated with a SQLException is a SQLState string that follows the XOPEN SQLState values defined in the SQL specification.
The SQLWarnings Class
Unlike the SQLException class, the SQLWarnings class does not cause any commotion in a Java program. The SQLWarnings are tagged to the object whose method caused the warning. So you should check for warning using the getWarnings() method that is available for all objects.



No comments:
Post a Comment