kahkean chor wrote:erm.....so what is the purpose of adding + for the sql statment?
Completely different question.
Answer: usually to include the value of a variable; although it's not the best way to do it. Have a look at PreparedStatement.
And BTW: How do you imagine we're supposed to know that your strings are part of an SQL statement?
is "SELECT * FROM Student WHERE StudentID = '" + stuID + "';"; equivalent to "SELECT * FROM Student WHERE StudentID = '" stuID "';";
No; because that 2nd statement won't compile.
Winston