executeUpdate(String) call!
One of hundreds of answers available with our premium content service.
A: The Statement executeUpdate(String) method takes a single string argument. The string concatenation syntax you have used is incorrect and represents multiple comma separated string arguments, not a single string. The error "cannot find symbol" means that the Java compiler cannot find a Statement method that has this number of string arguments.
This case highlights one of the hazards of concatenating SQL statements in method calls, it can be difficult to see where the Java syntax ends and the SQL syntax begins. It would be much clearer and simpler to use a PreparedStatement in this case and substitute the variables explicitly, as below.
… full answer hidden
Premium members click below for full answer
I get "cannot find symbol" for my executeUpdate(String) call!