This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am using this select statement in javaservlet and trying to execute it. But I am getting "SQL command not properly ended" error message in the console. But when I can successfully run this select query in the TOAD editor. I would appreciate if someone can help me to resolve this issue. Thanks..
This may be a dumb suggestion, but do you need a space on line 17 between the single quote and the "AND"?
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Joined: Jan 23, 2010
Actually you are right. This is a very good suggestion and it worked. I put spaces where the query appending and removed the single quote. It is working now. Thank you vary much for your suggestion. I really appreciate your help.
Now that your code is working, I hope you'll take a few minutes to improve it. This quoting problem wouldn't have happened -- and your code would be far more secure -- if you used java.sql.PreparedStatement . Go check it out!