aspose file tools*
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 Java 8 in Action this week in the Java 8 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");
It is sorta covered in the JavaRanch Style Guide.
subject: database connection in servlet on Tomcat 5.5
Similar Threads
connection pooling
Hard time learning Servlets
Help with servlets
JNDI in Servlets
NoClassDefFoundError Problem with running a jasper report