tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felipe Schnack <feli...@ritterdosreis.br>
Subject Re: JDBC Connnection Pool for Oracle
Date Fri, 27 Sep 2002 12:19:53 GMT
  Why don't you use oracle's own pool implementation? I used it once, is
quite good.

On Thu, 2002-09-26 at 19:55, Zeeshan wrote:
> Hello :)
> I am using Tomcat 4.0.4 with JDK1.4
> I am getting the followig exception while creating the DataSource:
> "javax.naming.NamingException: Cannot create resource instance"
> 
> Following is  my code, server.xml and web.xml entries.
> I will really appreciate if anyone can help me out here.
> 
> Thanx in advance
> 
> Zeeshan
> 
> Java Code
> ========
> ctx = (Context) new InitialContext().lookup("java:comp/env");
>  if (ctx!=null) {
>   dataSource = (javax.sql.DataSource) ctx.lookup("jdbc/datasource");
>   connection = dataSource.getConnection();
> }
> 
> Server.xml
> ========
> <Resource name="jdbc/datasource" auth="Container" type="oracle.jdbc.pool.OracleDataSource"/>
>   <ResourceParams name="jdbc/datasource">
>    <parameter><name>username</name><value>test</value></parameter>
>    <parameter><name>password</name><value>test</value></parameter>
>    <parameter><name>driverClassName</name><value>oracle.jdbc.driver.OracleDriver</value></parameter>
>    <parameter>
>        <name>factory</name>
>        <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
>    </parameter>
>    <parameter>
>        <name>driverName</name>
>        <value>jdbc:oracle:thin:@localhost:1521:ORACLE</value>
>    </parameter>
>    <parameter>
>          <name>url</name><value>jdbc:oracle:thin:@localhost:1521:ORACLE</value>
>    </parameter>
>    <parameter><name>maxActive</name><value>100</value></parameter>
>    <parameter><name>maxIdle</name><value>30000</value></parameter>
>    <parameter><name>maxWait</name><value>100</value></parameter>
>  </ResourceParams>
> 
> Web.xml
> =======
> <resource-ref>
>      <description>Resource reference to java.sql.Connection factory defined in
server.xml </description>
>      <res-ref-name>jdbc/datasource</res-ref-name>
>      <res-type>oracle.jdbc.pool.OracleDataSource</res-type>
>      <res-auth>Container</res-auth>
> </resource-ref>
> 
-- 

Felipe Schnack
Analista de Sistemas
felipes@ritterdosreis.br
Cel.: (51)91287530
Linux Counter #281893

Faculdade Ritter dos Reis
www.ritterdosreis.br
felipes@ritterdosreis.br
Fone/Fax.: (51)32303328


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message