aspose file tools
The moose likes JDBC and the fly likes Problems with java and mysql error: 1064 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Problems with java and mysql error: 1064" Watch "Problems with java and mysql error: 1064" New topic
Author

Problems with java and mysql error: 1064

Julien Martin
Ranch Hand

Joined: Apr 24, 2004
Posts: 384
Hello,
I have been struggling with the following java code for a day. I ALWAYS get the following error code : 1064 and I just can't figure out why. I am trying to insert data into a mysql table.
Can anyone please help?
Thanks in advance,
Julien.



[Removed sensitive data - Dave]
[ August 04, 2008: Message edited by: David O'Meara ]
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

1064 is a query syntax error I think? Your SQL statement is big and complex to build. I'd recommend you swap to using a PreparedStatement, make things easier for yourself.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Julien Martin
Ranch Hand

Joined: Apr 24, 2004
Posts: 384
Thanks a lot Paul!
My code was not very clean. I changed to a prepared statement and it now works.
Julien.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Problems with java and mysql error: 1064
 
Similar Threads
compile error ?
Uploading and Retrieving images using Java/JDBC
Problem while opening excel sheet from jsp
HOW DO I COPY THE DATA FROM ONE SET OF TABLES TO ANOTHER
jboss + database access