This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Servlets and the fly likes database connection in servlet on Tomcat 5.5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "database connection in servlet on Tomcat 5.5" Watch "database connection in servlet on Tomcat 5.5" New topic

database connection in servlet on Tomcat 5.5

Lalit Nagalkar
Ranch Hand

Joined: Aug 22, 2006
Posts: 47
hello all,
I will be thankful to all for helping me with this problem.
This is the servlet code i am trying to execute on tomcat 5.5 server with access db:

the server is throwing following SQLException even after adding <context-param> tag to the web.xml file, I earlier tried it without this tag :
"SQLException caught: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified". I have created dsn and checked it succesfully using java application.

The web.xml is:


SCJP 1.4
Raj Kumar
Ranch Hand

Joined: Sep 19, 2005
Posts: 65
Hi try this out


In this statement i normally used to give the DB Server IP Address, Database name, Username and password
con = DriverManager.getConnection("jdbc dbc:BookDB");
Have you checked out Aspose?
subject: database connection in servlet on Tomcat 5.5
It's not a secret anymore!