try{ Connection conn = ... Statement statement = conn.createStatement(); } catch(Exception e){ ... }