`
sctom123
  • 浏览: 112141 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

java.sql.SQLException: Incorrect arguments to mysql_stmt_execute

阅读更多
在执行Testcase的时候,出现了java.sql.SQLException: Incorrect arguments to mysql_stmt_execute错误。最后查到是因为 JDBC Connection url 少加了useServerPrepStmts=false 参数,然后从网上找到 这个参数的说明:
引用
Server-side Prepared Statements — Connector/J 3.1 will automatically detect and use server-side prepared statements when they are available (MySQL server version 4.1.0 and newer).

Starting with version 3.1.7, the driver scans SQL you are preparing via all variants of Connection.prepareStatement() to determine if it is a supported type of statement to prepare on the server side, and if it is not supported by the server, it instead prepares it as a client-side emulated prepared statement. You can disable this feature by passing emulateUnsupportedPstmts=false in your JDBC URL.

If your application encounters issues with server-side prepared statements, you can revert to the older client-side emulated prepared statement code that is still presently used for MySQL servers older than 4.1.0 with the connection property useServerPrepStmts=false
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics