Code example for SQLException

Methods: getErrorCode, getMessage, getSQLState

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());
		} 
	} 
}