This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JDBC and the fly likes update error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "update error" Watch "update error" New topic
Author

update error

jyotsana dang
Ranch Hand

Joined: Sep 26, 2003
Posts: 135
i wrote a query for updation but it gives a syntax error.
rs=stmt.executeQuery("select level, project_title, student_names, co_supervisor, year from projects_supervised where project_id in("+selected_Id+")");
incorrect syntax near ')'
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Generate the query as a string, then output the string before trying to execute it.

This way at least you can paste the code into a db client. It may be the code you are using to generate the selected_Id is incorrect.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: update error