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
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
Author

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:
-------------------------------------------------------------

--------------------------------------------------------------------------
THANKING ALL IN ADVANCE.


SCJP 1.4
Raj Kumar
Ranch Hand

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

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();

In this statement i normally used to give the DB Server IP Address, Database name, Username and password
con = DriverManager.getConnection("jdbc dbc:BookDB");
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: database connection in servlet on Tomcat 5.5