wood burning stoves*
The moose likes Servlets and the fly likes error in SQL statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "error in SQL statement" Watch "error in SQL statement" New topic
Author

error in SQL statement

Eric Howell
Ranch Hand

Joined: Nov 26, 2000
Posts: 63

I have the following to insert 3 strings into a MySQL database.
The equivelent code works when I insert directly into the database but when I use JDBC I get the error :
" JDBC error: java.sql.SQLException: Syntax error or access violation: You have an error in your SQL syntax near ''urlString','FOX BROADCASTING COMPANY','...etc
I wonder if someone can spot what is wrong?
Thanks in advance

and later on
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
hi,
I think you miss a space between the quotes and VALUES try it:
"INSERT INTO "+dbTable+" VALUES"...
Originally posted by Eric Howell:
[B]

and later on
[/B]

Eric Howell
Ranch Hand

Joined: Nov 26, 2000
Posts: 63
Thanks Marcos for the prompt reply. That did the job great.
Cheers
Eric
 
wood burning stoves
 
subject: error in SQL statement
 
Similar Threads
SQL syntax error, can anyone help?
java sqlexception
failed to insert new record - AbstractFlushingEventListener
how to write into excel sheet
Java sqlexception definition