SQL 1064 Syntax Error using a JDBC prepared statement

后端 未结 3 1132
暗喜
暗喜 2021-01-22 19:39

I have:

String query = \"INSERT INTO Basestations VALUES(?, ?, ?, ?, ?, ?, ?,\"
               + \"?, ?, ?, ?, ?, ?, ?, ?)\";                  


PreparedStateme         


        
3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-22 19:42

    You're passing an string representing an invalid SQL statement to the executeUpdate() method when you don't need to. Try just doing prep.executeUpdate();.

提交回复
热议问题