Code example for SQLException

Methods: getMessagegetErrorCodegetSQLState

0
			// Do something with the Connection 
			System.out.println("Catalog: "+conn.getCatalog());
			 
		} catch (SQLException ex) {
			// handle any errors 
			System.out.println("SQLException: " + ex.getMessage());
			System.out.println("SQLState: " + ex.getSQLState());
			System.out.println("VendorError: " + ex.getErrorCode());
		} 
	} 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE