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

你可能感兴趣的:(java,sql,mysql,SQL Server,jdbc)