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)