Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java.sql.SQLException 1

Status
Not open for further replies.

MarkShark

Programmer
Aug 22, 2001
36
US
I have a servlet and when compile it shows that I have the following error:

-path="" :CourseServlet: java.sql.SQLException: Syntax error or access violation: You have and error in your SQL syntax near 'Course_ID =1' at line 1


What does this mean and where would I look to to fix it. It is not in my servlet.

Thanks
 
You are the one with the huge 18 page servlet right? Well, start looking thru your code and checking out each spot where JDBC is used.

You are getting a compilation error? If so I suggest that you comment out chunks of dubious code until you get it to compile then go back and start working on getting to chunks to compile.

This is most likely going to be tedious task (unless there is an obvious mistake) because of the length and messiness of the code you have to work with. That is why I try to refactor my code down to methods no longer than 20-25 lines. It makes maintence soooo much easier, even if you are the only one that ever has to look at it. Wushutwist
 
Thanks,

I broke the code down into very small chunks and whittled it down to this one error, so making headway here.

 
A possible problem could be your column Course_ID is of type varchar/text. If so, you will have to do this Course_ID = '1'.

Hope this helps,
Leon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top