Zeeshan:

To correct this issue, everyewhere you have
"oracle.jdbc.pool.OracleDataSource",
replace it with "javax.sql.DataSource"

Thanks,
ej





Felipe Schnack <[EMAIL PROTECTED]> on 09/27/2002 09:19:53 AM

Please respond to "Tomcat Users List" <[EMAIL PROTECTED]>

To:    Tomcat Users List <[EMAIL PROTECTED]>
cc:

Subject:    Re: JDBC Connnection Pool for Oracle


  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
[EMAIL PROTECTED]
Cel.: (51)91287530
Linux Counter #281893

Faculdade Ritter dos Reis
www.ritterdosreis.br
[EMAIL PROTECTED]
Fone/Fax.: (51)32303328


--
To unsubscribe, e-mail:   <
mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <
mailto:[EMAIL PROTECTED]>









**********************************************************************************
Confidentiality Notice: This email message, including any attachments,
contains or may contain confidential information intended only for the 
addressee.  If you are not an intended recipient of this message, be 
advised that any reading, dissemination, forwarding, printing, copying 
or other use of this message or its attachments is strictly prohibited.  
If you have received this message in error, please notify the sender 
immediately by reply message and delete this email message and any 
attachments from your system. 
**********************************************************************************


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to