Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

MySQLSyntaxError (but looks fine to me!!??)

 
Joe Lemmer
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I am getting a MySQLSyntaxError at Runtime that says:

check the manual that corresponds to your MySQL server version for the right syntax to use near ' ='A' OR listLetter = 'B' ' at line 1


Well I've checked and I can't understand whats wrong. When I manually query the database from the mySQL command prompt it works no probs. Can anyone see what I'm doing wrong?

Here is some partial code from my JDBC method:



Thanks for any help :-)

Regards

Joe
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Is this valid?
 
Joe Lemmer
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aaaah! I see!

I have now put a space in front of the word WHERE and it works.

Thanks Bauke, you're a star :-)
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!