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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "jsp and jdbc" Watch "jsp and jdbc" New topic
Author

jsp and jdbc

arjita mahajan
Greenhorn

Joined: Nov 10, 2012
Posts: 11
i am trying to connect jsp page to databse through javabean:


When I run the jsp file it is giving me error "username exists" even though no such data is getting entered (or present) in my login database (table login)
please help...
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1449
    
    6

You are assigning User name exists value to variable error inside catch block, means it's raising some exception. Instead of assigning that message, you may wish to print the exception log trace, to figure out what exactly is going wrong. You could also try this error=e.toString(), this should print the actual exception on the page and might help you to figure out the real problem.


Swastik
arjita mahajan
Greenhorn

Joined: Nov 10, 2012
Posts: 11
ok as suggested i founded that my sql query is not correct.. so i changed it to
String s = "insert into login values('upop','yss','ysss','asdy','aysdq',54,0);";
but even now my data is not getting entered into databse ... please help
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1449
    
    6

Arjita,

You are creating the sql string, but you don't seem to be executing any where.

arjita mahajan
Greenhorn

Joined: Nov 10, 2012
Posts: 11
thanks a lot , it was my stupidity i forgot the execute statement... thanks a lot.. :)
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1449
    
    6

You are most welcome.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jsp and jdbc
 
Similar Threads
Always responding invalidLogin.jsp
Errors Running JSP Page
My login application accepts any and all username/passwords.
Could not locate DB driver
jsp and javabeans