Skip to content
Advertisement

PrearedStatement executeUpdate() is not working

I’m new to JDBC and using the following code to update the row using MySQL JDBC driver. I have no idea why executeUpdate() is not updating the content in the database.

JavaScript

Can anyone help me?

Advertisement

Answer

Your query string is wrong. It should be something like this:

JavaScript

Look here for the proper syntax of update: https://www.mysqltutorial.org/mysql-jdbc-update

Also if you want to update then use an update table command. The command that you used for insert is wrong.

Also for error print out the exception that you logged.

Advertisement