Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error while inserting data into from a JSP Page

 
Ram Kas
Ranch Hand
Posts: 83
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using the following code for changing password.




But, it gives an error saying there should be a semi-colon at the end of the SQL Query. Can anybody explain me where I have gone wrong.

Also, it will be great if you can give me code that works better tha mine.

Thanks,
Dinakar Kasturi.
SCJP1.4
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the JDBC forum where SQL Exeptions are discusses.
When it gets there, you may want to let folks know what RDBMS you're using.
 
Anay Nayak
Greenhorn
Posts: 26
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have not added a semi colon at the end of the statement

Check variable "sql" something seems to be missing out there.
 
George Stoianov
Ranch Hand
Posts: 94
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String sql1 = "insert into reg(password)values('"+newPassword+"') where username = '"+username1+"'"+";";


There should be a space between reg(password) <space> values if there isn't already that is.
George
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic