MySQL and Connector/J Bug
After attempting to upgrade to the latest MySQL and Connector/J libraries, started noticing the following error in my Jboss logs:
“You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘?’ at line 1″ [#13]
The following answer was found in the Roller FAQ:
This appears to be due to a MySQL and Connector/J bug that occurs if you use the MySQL 4.1.X server with Connector/J 3.1.X drivers. We recommend that you use the Connector/J 3.0.16 (or later 3.0.X series) drivers with MySQL 4.1.X to avoid this. You can download them from the MySQL site. Drop the jar in your CATALINA_HOME/common/lib and remove any 3.1.X drivers that you have there. An alternate workaround that will allow you to keep the Connector/J 3.1.X drivers is to disable use of server-side prepared statements by setting the additional property useServerPrepStmts=false in both of the MySQL JDBC URLs in the context configuration.