String updateQuery = "UPDATE employee SET salary = ? WHERE emp_id = ?"; PreparedStatement preparedStatement = connection.prepareStatement(updateQuery); preparedStatement.setDouble(1, 5000.0); preparedStatement.setInt(2, 101); preparedStatement.executeUpdate();In this example, we are updating the salary for an employee with emp_id 101. We are using a PreparedStatement object to update the salary. The first parameter is the new salary, which is set using the setDouble method. The second parameter is the emp_id, which is an integer and is set using the setInt method. Package library: java.sql.