mysql - How can I fix java.sql.BatchUpdateException? -


I am writing a java program that joins mysql db to jdbc.It includes the record to mysql i sq Here is: INSERT ('AMERICAN', '97', '1998-08-28 00:00:00', '10', '1995- 08' in my_schema.my_table VALUES:

  my_schema.my_table -28 00:00:00 ',' 10 ',' United States Dollar ',' US Dollar ',' $ ',' 2 ',' Y ',' Y ',' 1998-08-28 00: 00: 00 ',' _6064530F8DBAB938E040007F010015E3 ');   

but it returns this error:

  e = (java.sql.BatchUpdateException) java.sql.BatchUpdateException: there is an error in your SQL syntax ; Use your MySQL server version for the correct syntax to use 'nearby' ('AMERICAN', '40', '1998-08-28 00:00:00', '10', '1998-08-28 Check the manual related to 00:00:00 ',' 10 ',' H 'on line 1   

But the strange thing is: I insert it manually without any errors

Thanks Advance,

It's weird but it works :

I just have the last character semicolon , and it works:

Mer This means that I change it: INSERT ('AMERICAN', '97 ',' 1998-08-28 00:00:00 ',' 10 ') in my_schema.my_table values ​​

  , '1998-08-28 00:00:00', '10', 'United States Dollar', 'US Dollar', '$', '2', 'Y', 'Y', '998 -08-28 00:00:00, '_6064530F 8DBAB 9 80A40007F 1010015E3');   

In:

  My_schema.my_table VALUES INSERT ('AMERICAN', '97', '1998-08-28 00:00:00', '10 ',' 1998-08-28 00:00:00 ', '10 ',' United States Dollar ',' US Dollar ',' $ ',' 2 ',' Y ',' Y ',' 1998-08-28 00:00:00 ',' _6064530F 8DBAB 9 80E 040007F 1010015E3 ')    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -