java mysql prepared statement

前端 未结 2 1981
我在风中等你
我在风中等你 2021-01-27 06:39

I\'m trying to do a simple insert into a database with java and its telling me my sql syntax is off. But when I copyed the string I printed out and put it into the sql command i

2条回答
  •  深忆病人
    2021-01-27 07:11

    You're calling the base Statement.executeUpdate(String) method, which has nothing to do with PreparedStatement and simply executes a string of raw SQL.

    You need to call statement.executeUpdate() without parameters to use the derived method n PreparedStatement.

提交回复
热议问题