jQuery in Action, 2nd edition*
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 Android Security Essentials Live Lessons this week in the Android 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");
jQuery in Action, 2nd edition
subject: database connection in servlet on Tomcat 5.5
Similar Threads
connection pooling
NoClassDefFoundError Problem with running a jasper report
JNDI in Servlets
Hard time learning Servlets
Help with servlets