I'm using tomcat 5.5, and for this kind of things i'm creating a xml file in
the {TOMCATHOME}/conf/Catalina/localhost/AppName.xml
With a content like this:
# cat /etc/tomcat-5.5/Catalina/localhost/AppName.xml
<Context path="/AppName" docBase="AppName" debug="5" reloadable="true"
crossContext="true">
        <Resource name="jdbc/conexion" auth="Container"
type="javax.sql.DataSource"
                driverClassName="oracle.jdbc.driver.OracleDriver"
        url="jdbc:oracle:thin:@192.168.1.1:1521:SIDBD" username="scott"
password="tiger"
        maxActiVe="3" maxIdle="1" maxWait="-1" />
</Context>





-----Mensaje original-----
De: Mohammed Zabin [mailto:[EMAIL PROTECTED] 
Enviado el: jueves, 24 de mayo de 2007 12:24
Para: Tomcat Users List
Asunto: Re: DBCP

I am using tomcat 6, and another thing, i have changed my configuration
parameters to the following:


<Resource name="jdbc/myoracle" auth="Container"
              type="javax.sql.DataSource"
driverClassName="oracle.jdbc.OracleDriver"
              url="jdbc:oracle:thin:@127.0.0.1:1521:mysid"
              username="scott" password="tiger" maxActive="20" maxIdle="10"
              maxWait="-1"/>




On 5/24/07, David Rodríguez Fernández <[EMAIL PROTECTED]> wrote:
>
> What tomcat version do you have?
>
> -----Mensaje original-----
> De: Mohammed Zabin [mailto:[EMAIL PROTECTED] Enviado el: jueves, 24 
> de mayo de 2007 12:03
> Para: users@tomcat.apache.org
> Asunto: DBCP
>
> *Hi All*
> **
> *I want to use DBCP to connect my localhost Oracle Database, I have 
> write the following in servlet.xml file:*
>
> <Resource name="jdbc/myoracledb" auth="Container"
>                  type="javax.sql.DataSource" />
>
>    <ResourceParams name="jdbc/myoracledb">
>       <parameter>
>          <name>factory</name>
>          <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
>       </parameter>
>       <parameter>
>          <name>driverClassName</name>
>          <value>oracle.jdbc.OracleDriver</value>
>       </parameter>
>       <parameter>
>          <name>url</name>
>          <value>jdbc:oracle:thin:@127.0.0.1:1521:mine</value>
>       </parameter>
>       <parameter>
>          <name>username</name>
>          <value>hr</value>
>       </parameter>
>       <parameter>
>          <name>password</name>
>          <value>hr</value>
>       </parameter>
>       <parameter>
>          <name>maxActive</name>
>          <value>20</value>
>       </parameter>
>       <parameter>
>          <name>maxIdle</name>
>          <value>10</value>
>       </parameter>
>       <parameter>
>          <name>maxWait</name>
>          <value>-1</value>
>       </parameter>
>    </ResourceParams>
> </GlobalNamingResources>
>
> *and the following in web.xml file:*
>
> <resource-ref>
>   <description>Oracle Datasource example</description>
>   <res-ref-name>jdbc/myoracledb</res-ref-name>
>   <res-type>javax.sql.DataSource</res-type>
>   <res-auth>Container</res-auth>
> </resource-ref>
>
> *and following is my JSP code:*
>
>
> <%@ page import="javax.sql.*, javax.naming.*, java.sql.*" %>
>
> <%
> Context initContext = new InitialContext(); Context envContext  = 
> (Context)initContext.lookup("java:/comp/env");
> DataSource ds = (DataSource)envContext.lookup("jdbc/myoracledb");
> Connection conn = ds.getConnection();
>
> out.println( "Connection Established" ); %>
>
> *When running the above jsp page, i got the following exception:*
>
> *org.apache.jasper.JasperException: javax.servlet.ServletException:
> org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC 
> driver of class '' for connect URL 'null'
>
> org.apache.jasper.servlet.JspServletWrapper.handleJspException
> (JspServletWra
> pper.java:532)
>
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.
> java
> :4
> 08)
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
>        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*
>
> Any Help Please, I am working to solving this problem from one week, I 
> am lost, what is the reason for this exception, any help will be 
> apprecieated
>
> Jotnarta
>
>
>
>
> ----------------------------------------------------------------------
>
> La Información incluida en el presente correo electrónico es SECRETO 
> PROFESIONAL Y CONFIDENCIAL, siendo para el uso exclusivo del 
> destinatario arriba mencionado. Si usted lee este mensaje y no es el 
> destinatario señalado, el empleado o el agente responsable de entregar 
> el mensaje al destinatario, o ha recibido esta comunicación por error, 
> le informamos que esta totalmente prohibida cualquier divulgación, 
> distribución o reproducción de esta comunicación, y le rogamos que nos 
> lo notifique inmediatamente y nos devuelva el mensaje original a la 
> dirección arriba mencionada.
>
> Gracias.
>
> The information contained in this e-mail is LEGALLY PRIVILEDGED AND 
> CONFIDENTIAL and is intended only for the use of the addressee named 
> above. If the reader of this message is not the intended recipient or 
> the employee or agent responsible for delivering the message to the 
> intended recipient, or you have received this communication in error, 
> please be aware that any dissemination, distribution or duplication of 
> this communication is strictly prohibited, and please notify us 
> immediately and return the original message to us at the address above.
>
> Thank you.
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, 
> e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>




----------------------------------------------------------------------

La Información incluida en el presente correo electrónico es SECRETO
PROFESIONAL Y CONFIDENCIAL, siendo para el uso exclusivo del
destinatario arriba mencionado. Si usted lee este mensaje y no es el
destinatario señalado, el empleado o el agente responsable de entregar
el mensaje al destinatario, o ha recibido esta comunicación por error,
le informamos que esta totalmente prohibida cualquier divulgación,
distribución o reproducción de esta comunicación, y le rogamos que nos
lo notifique inmediatamente y nos devuelva el mensaje original a la
dirección arriba mencionada.

Gracias.

The information contained in this e-mail is LEGALLY PRIVILEDGED AND
CONFIDENTIAL and is intended only for the use of the addressee named
above. If the reader of this message is not the intended recipient or
the employee or agent responsible for delivering the message to the
intended recipient, or you have received this communication in error,
please be aware that any dissemination, distribution or duplication of
this communication is strictly prohibited, and please notify us
immediately and return the original message to us at the address above.

Thank you.



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to