BTW, the topic is "JNDI and DataSource" and I'm trying to connect to an
Oracle DB.  :)

Freddy.

-----Mensaje original-----
De: Francesco Pellegrini [mailto:[EMAIL PROTECTED] 
Enviado el: martes, 13 de abril de 2004 9:28
Para: Tomcat-User-ML
Asunto: Tomcat 5 : Connection Pool to Access database 
Importancia: Alta

Hi All,

I'm working on Tomcat 5.0.18 web server with Access 2000 database on
Windows
2000 server environment.

At the moment I use simple connection to database by "direct calling" in
the
Java code like:

Connection Con=DriverManager.getConnection("jdbc:odbc:MyDatabase");

where "MyDatabase" is the ODBC source.

I'would like to configure a connection pool instead of direct
connection,
but after I did this changes in server.xml :


************************************************************************
****
**

 <GlobalNamingResources>


    <Resource name="jdbc/myoracle" auth="CONTAINER"
type="javax.sql.DataSource"/>
          <ResourceParams name="jdbc/myoracle">
          <parameter>
                <name>factory</name>
                <value>org.apache.commons.dbcp.BasicDataSourceFactory
                </value>
          </parameter>
          <parameter>
                <name>driverClassName</name>
                <value>sun.jdbc.odbc.JdbcOdbcDriver</value>
         </parameter>
           <parameter>
                <name>url</name>
                <value>jdbc:odbc:MyDatabase</value>
          </parameter>
         </ResourceParams>

  </GlobalNamingResources>




************************************************************************
****
**


and this changes in web.xml of my web application :

************************************************************************
****
**
<resource-ref>
        <description>Oracle Datasource example</description>
        <res-ref-name>jdbc/myoracle</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
    </resource-ref>
************************************************************************
****
**

I got on this error :

org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
class '' for connect URL 'null', cause:
java.sql.SQLException: No suitable driver
        at java.sql.DriverManager.getDriver(Unknown Source)
        at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource
.jav
a:743)
        at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.ja
va:5
18)


Could someone help me?

Thanks

Franz.


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


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

Reply via email to