Hi friends,
Still i couldn't solve my problem.Now my error message is changed to:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' Rahul-What is that you are saying about OJDBC14.I couldn't find it.Can you please tell me where it is.
Rajendar-For the first method i got the following message:
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.
But after doing the following changes i got the below message:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
Sandip- I followed your second method.But still getiing error as i mentioned. :-(
Friends,
I have JDK1.5,Tomcat5.5.7,Oracle 9i and on windows 2000. Can someone solve my problem please.Actually i can run my programs without any changes on webserver.But I need the same on tomcat.So please i require all your help.
I did the following things.Correct me if i did any mistake anywhere.
1.I copied classes12.jar file into TOMCAT_HOME/commom/lib folder
2.I configured my DSN as "S2Tech" thru control panel
3.I included the following in my TOMCAT_HOME/conf/server.xml
<Context>
<Resource name="jdbc/S2Tech" auth="Container"
type="javax.sql.DataSource" description="User database that can be updated and saved"
username="scott" password="tiger" driverClassName="oracle.jdbc.OracleDriver" url="jdbc
racle:thin@localhost:1521:S2Tech" />
</Context>
4.I included the following in my TOMCAT_HOME/webapps/servlets-examples/WEB-INF/web.XML
<resource-ref>
<description> Resource Reference </description>
<res-ref-name> jdbc/S2Tech </res-ref-name>
<res-type> javax.sql.DataSource </res-type>
<res-auth> Container </res-auth>
</resource-ref>
5.The following code i used in my servlet program:
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
// Look up our data source
DataSource ds = (DataSource) envCtx.lookup("jdbc/S2Tech");
// Allocate and use a connection from the pool
Connection con = ds.getConnection("scott","tiger");
Thanks a lot for all your help in advance.