Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Apache Tomcat »

Datasource configuration for Oracle 9i in Tomcat 5.5

Thanigaivel_Murugan

2006-04-04


Hi,



I do not know how to configure datasource in Tomcat 5.5 for Oracle 9i. I
tried like this...



1. Server.xml configuration:



<!-- Global JNDI resources -->

<GlobalNamingResources>



  <!-- Test entry for demonstration purposes -->

  <Environment name="simpleValue" type="java.lang.Integer"
value="30"/>



       <Resource name="jdbc/myoracle" auth="Container"

        type="javax.sql.DataSource"
driverClassName="oracle.jdbc.driver.OracleDriver"


url="jdbc:oracle:thin:@(protected)"

        username="scott" password="tiger" maxActive="20"
maxIdle="10"

        maxWait="-1"/>



</GlobalNamingResources>



2. Test.jsp



       Context initContext = new InitialContext();

       Context envContext =
(Context)initContext.lookup("java:/comp/env");

       DataSource ds =
(DataSource)envContext.lookup("jdbc/myoracle");

Connection conn = ds.getConnection();



Output:



javax.servlet.ServletException: Cannot create JDBC driver of class ''
for connect URL 'null'



Can anyone knows the solution?



- Regards

Thanigai





DISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.
©2008 junlu.com - Jax Systems, LLC, U.S.A.