UPDATE Statements
To update a table, use the standard UPDATE SQL syntax. The driver supports updating
only one row at a time. Hence, the primary key IId is always required.
String cmd = "UPDATE Account SET AcctName='Petty Cash' WHERE Id = ?"; PreparedStatement pstmt = connection.prepareStatement(cmd); pstmt.setString(1, "1"); int count = pstmt.executeUpdate(); System.out.println(count + " rows are affected"); connection.close();