try { Statement stmt = connection.createStatement(); int numUpdated = stmt.executeUpdate( "UPDATE mytable SET COL_A = 'John Doe' WHERE COL_B = 123"); connection.close(); } catch (SQLException e) { }