Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

update error  RSS feed

 
jyotsana dang
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!