What is SQLException chaining?

Joe Sam Shirah

There are often multiple reasons for a JDBC problem. SQLException has a method, getNextException, which returns either the next exception or null when all exceptions have been retrieved. Obtaining multiple exceptions this way is termed "chaining". You can see a minimal form of this at How to raise a custom SQLWarning?.

For more information and a complete code example, see the SQL Exceptions section in my JDBC 2.0 Fundamentals Short Course at the Java Developer Connection.