Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error in SQL statement

 
Eric Howell
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 977
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Marcos for the prompt reply. That did the job great.
Cheers
Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic