Chaining SQLExceptions
In this chapter you will learn:
Find out Chaining SQLExceptions
} catch (SQLException sqle) {
do { // loop through each exception
// do something with each exception
System.err.println("Exception occurred:\nMessage: " + sqle.getMessage());
System.err.println("SQL state: " + sqle.getSQLState());
System.err.println("Vendor code: " + sqle.getErrorCode() + "\n----------------");
} while ((sqle = sqle.getNextException()) != null);
}/*j a v a2 s. co m*/
Next chapter...
What you will learn in the next chapter:
- Find out Warning message for Connection
- Check for a warning using a Connection object
- Print warning message from connection
Home » Java Tutorial » Statements, ResultSet, Exception, Warning