4 Replies Latest reply on May 17, 2008 4:51 PM by tcunning

    mySQL plugin - syntax error on insert statement

    mle6644

      Hi All,

      I successfully configured the datasource for mySql so notification message can be sent directly to mySql table. However, I kept getting this syntax error message regarding syntax error on the insert statement:

      14:55:15,856 ERROR [NotifySqlTable] SqlException while trying to notify table. Insert statement : insert into notifications "Column2","Column1","MessageContents") values ('2','1','Hello from ESB-unaware JMS Client')
      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 '"Column2","Column1","MessageContents") values ('2','1','Hello from ESB-unaware J' at line 1

      When I tried to issue the exact insert statement shown on the console (i.e. insert into notifications ("Column2","Column1","MessageContents") values ('2','1','Hello from ESB-unaware JMS Client')) to the MySql command-line client window, I got the exact same error, "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 '"Column2","Column1","MessageContents") values ('2','1','Hello from ESB-unaware J' at line 1".

      After checking the manual and trying out a few times, the correct syntax for the insert statement should be either:
      insert into notifications (Column2, Column1, MessageContents) values ('2','1','Hello from ESB-unaware JMS Client');
      or
      insert into notifications values ('2','1','Hello from ESB-unaware JMS Client')

      Hence, the insert statement the JBoss has for MySql database obviously incorrect. Can someone show me a way to get around this issue. By the way, I'm running JBoss soa-4.2.0.GA_CP01, MySQL version 5.0.45-community-nt and JDBC 5.1.6

      Thanks very much in advance.

      ML.