This code has some simple syntax error. I fought with him for hours, and I give up. Can you spot it? I bet it's easy. Thanks!
When I update only John's first name, no problem. When I try to update the commented line for the last name, a syntax error.
import java.sql.*; public class UpdateTester { public static void main(String[] args) { try { Connect connect = new Connect(); Connection connection = connect.getConnection(); try { String sql = "UPDATE student SET firstName = ? " + " WHERE studentID = 456987";
The column names are correct. Updating the very latest on it also works correctly. Update error with syntax error when trying to perform both actions, as in numbered lines.
source share