File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why my JDBC not working in servlet

 
Ming Chen
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My JDBC connection with MySQL has been always working on general java classes on command line, but when I call a class(JDBC) from servlet, there is always a connection problem. I check all classpath, it was right. I don't know if I should do sth with web.xml file, I use Tomcat 4.0.
Anybody know how?
Thanks
 
Ming Chen
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have solved this problem.
I add MySQL driver mm.mysql-2.0.4-bin.jar file on the tomcat folder:
D:\Apache Tomcat 4.0\common\lib, restart tomcat server, it then works.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Glad you solved it
This is quite a common problem when connecting databases to Servlet Engines.
(but)
"Ming",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp.
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please edit your profile and select a new name which meets the requirements.
Thanks.
Dave
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic