This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
You should use the query in this fashion : state.executeUpdate("INSERT INTO Candidates VALUES('"+candidateID+"','"+can.getSalutation()+"','"+can.getLastName()+"','"+can.getFirstName()+"'............. Whenever the value is a string, use the single quotes outside the double quotes, if value is a number, you do not need to use single quotes.
Joined: Aug 10, 2001
thanks shilpa!!! it worked. my statement was so long, it was easy to overlook that. thanks again
Crikey! Do me a favour: when you get a chance, check out PrepardStatements. A lot easier to read, therefore easier to debug. Would look something like this:
Advantages are that it is easier to read and you don't have to worry about single quotes at all, they are handled for you. A few more lines of code, but you'll be thankful after you have to debug stuff like that a few times. (I also like the ++i bit since it allows you to insert and delete attributes during development without worrying about hard coded values)
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com