1 | catch (SQLException ex) { |
2 | // A SQLException was generated. Catch it and |
3 | // display the error information. Note that there |
4 | // could be multiple error objects chained |
5 | // together |
6 | System.out.println ("\n*** SQLException caught***\n"); |
7 | while (ex != null) { |
8 | System.out.println ("SQLState: " + |
9 | ex.getSQLState ()); |
10 | System.out.println ("Message: " + |
11 | ex.getMessage ()); |
12 | System.out.println ("Vendor: " + |
13 | ex.getErrorCode ()); |
14 | ex = ex.getNextException (); |
15 | System.out.println (""); |
16 | } |
17 | } |