I got a problem while making a servlet program. Please help me.
My problem is:
When i am loading mySQL driver in my servlet program, run time error "ClassNotFoundException" is coming. But when i load same driver in my simple program using main() method, it runs successfully.
Please tell me why this problem is coming with servlet program and also give me the solution.
Thanks & Regards, Madhawi
SCJP1.5 with 90%
Vassili Vladimir
Ranch Hand
Joined: Mar 08, 2007
Posts: 1585
posted
0
Include MySQL driver's JAR file in your class path, that's all!!!
Vassili ...
SCJP 5.0, SCWCD 1.4, SCJA 1.0
Madhawi Maurya
Ranch Hand
Joined: Aug 22, 2007
Posts: 42
posted
0
Originally posted by Vassili Vladimir: Include MySQL driver's JAR file in your class path, that's all!!!
Thank you Vassili. [/LIST]
Madhawi Maurya
Ranch Hand
Joined: Aug 22, 2007
Posts: 42
posted
0
But After loading the driver i got another problem.
I have created a html file in which two fields login and password has mentioned. when i submit the html file, the servlet page will open, the servlet page will store the login and password in database and after that it will display all content of my login table.
Problem is that, when i submitting my html file it opens a download dialog box, from that box i can open a file or save a file or can cancel the further process. when I select open, I have to choose a file type in which i can see my output, I choosed internet explorer. And it is showing the output of my sevlet file. Can it show directly without open with or save as option?
My Servlet program is as follows:
[BSouther: Added UBB CODE tags] [ October 13, 2007: Message edited by: Ben Souther ]
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35241
7
posted
0
You have a typo in the content type; it should be "text/html".