File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Error while inserting data into  from a JSP Page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Error while inserting data into  from a JSP Page" Watch "Error while inserting data into  from a JSP Page" New topic
Author

Error while inserting data into from a JSP Page

Ram Kas
Ranch Hand

Joined: Jul 26, 2006
Posts: 81
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

Joined: Dec 11, 2004
Posts: 13410

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.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Anay Nayak
Greenhorn

Joined: Aug 15, 2006
Posts: 26
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

Joined: Jan 15, 2006
Posts: 94
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
 
subject: Error while inserting data into from a JSP Page
 
Similar Threads
SQL Exception
result set not retrieved
jsp polling
Multiple forms in a single JSP page
Servlet help