mysql prepared statement error: MySQLSyntaxErrorException

前端 未结 2 622
失恋的感觉
失恋的感觉 2020-11-28 16:35

I wrote select statement using prepared statement. Each time try to run it gives this error. How am I over come this error? my jdbc connector is mysql-connector-java-5.1.13-

相关标签:
2条回答
  • 2020-11-28 17:14

    error is in this line

        rs = stmt.executeQuery(selectSQL);
    

    do this way

        rs = stmt.executeQuery();
    
    0 讨论(0)
  • 2020-11-28 17:16
    executeQuery(your QUERY)
    

    is supported while you all dealing with Statment object

     rs = stmt.executeQuery();
    
    0 讨论(0)
提交回复
热议问题