catch (SQLException ex) { |
// A SQLException was generated. Catch it and |
// display the error information. Note that there |
// could be multiple error objects chained |
// together |
System.out.println ("\n*** SQLException caught***\n"); |
while (ex != null) { |
System.out.println ("SQLState: " + |
ex.getSQLState ()); |
System.out.println ("Message: " + |
ex.getMessage ()); |
System.out.println ("Vendor: " + |
ex.getErrorCode ()); |
ex = ex.getNextException (); |
System.out.println (""); |
} |
} |