MySQL Forums
Forum List  »  Newbie

Re: 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
Posted by: G T
Date: May 27, 2010 11:58PM

I executed the following query with a temporary table

INSERT INTO TEMP (id,description) VALUES (?,?)

and now the error is

org.nw.exception.ProductException: org.nw.exception.DataAccessException: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: 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
at org.nw.dao.impl.mysql.ProductDAOImpl.createProduct(ProductDAOImpl.java:53)
at org.nw.dao.impl.mysql.test.ProductDAOImplTest.testCreateProductClean(ProductDAOImplTest.java:72)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:643)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:559)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:723)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1027)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:137)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:121)
at org.testng.TestRunner.runWorkers(TestRunner.java:953)
at org.testng.TestRunner.privateRun(TestRunner.java:633)
at org.testng.TestRunner.run(TestRunner.java:505)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:359)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:354)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:316)
at org.testng.SuiteRunner.run(SuiteRunner.java:195)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:903)
at org.testng.TestNG.runSuitesLocally(TestNG.java:872)
at org.testng.TestNG.run(TestNG.java:780)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:75)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:127)
Caused by: org.nw.exception.DataAccessException: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: 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
at org.nw.dao.impl.mysql.BaseDAO.executeUpdate(BaseDAO.java:113)
at org.nw.dao.impl.mysql.ProductDAOImpl.createProduct(ProductDAOImpl.java:49)
... 23 more
Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: 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
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3277)
at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1402)
at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1317)
at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1473)
at org.nw.dao.impl.mysql.BaseDAO.executeUpdate(BaseDAO.java:106)
... 24 more

Options: ReplyQuote


Subject
Written By
Posted
Re: 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
G T
May 27, 2010 11:58PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.