Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

database connection in servlet on Tomcat 5.5

 
Lalit Nagalkar
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Raj Kumar
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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");
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic