Discussions

Web tier: servlets, JSP, Web frameworks: TOMCAT 5 AND DATA SOURCES

  1. TOMCAT 5 AND DATA SOURCES (2 messages)

    Hi all,

    This may not be the right place to post this question. So please forgive me.

    I have alway used my own database connection pooling. Just out of curiosity I thought I would try to use Tomcat's connection pooling instead. But this cost me 6 hours with no luck. So I am asking for your expertise to point to the right direction. Here's what I am getting:

    SQL exception Cannot create JDBC driver of class '' for connect URL 'null'
     
    Here's my server.xml
    <context path="/startup" docBase="startup"
                debug="5" reloadable="true" crossContext="true">
     
    <Logger className="org.apache.catalina.logger.FileLogger"
                 prefix="localhost_DBTest_log." suffix=".txt"
                 timestamp="true"/>
     
    <Resource name="jdbc/dbtest"
                   auth="Container"
                   type="javax.sql.DataSource"/>
     
    <ResourceParams name="jdbc/dbtest">
    <parameter>
        <name>factory</name>
        <value>
         org.apache.commons.dbcp.BasicDataSourceFactory
        </value>
    </parameter>
     
    <parameter>
         <name>username</name>
         <value>name</value>
    </parameter>

    <parameter>
         <name>password</name>
         <value>Pass</value>
    </parameter>

    <parameter>
         <name>driverClassName</name>
         <value>com.jnetdirect.jsql.JSQLDriver</value>
    </parameter>
        
    <parameter>
         <name>url</name>
         <value>
            jdbc:JSQLConnect://127.0.0.1/databaseName=test
         </value>
    </parameter>
    </ResourceParams>
    </context>
     
    web.xml
     <resource-ref>
          <description>DB Connection</description>
          <res-ref-name>jdbc/dbtest</res-ref-name>
          <res-type>javax.sql.DataSource</res-type>
          <res-auth>Container</res-auth>
      </resource-ref>
     
    and of course I have JSQLConnect.jar, commons-collections.jar, commons-dbcp-1.1.jar and commons-pool-1.1.jar in %catalina_home/common/lib
  2. Same here...[ Go to top ]

    Hi,

    I have the same problem... Anything new?

    -Jaics
  3. <Resource name="jdbc/SomeDB" auth="Container" type="javax.sql.DataSource"/>
            <ResourceParams name="jdbc/SomeDB">
              <parameter>
                <name>factory</name>
                <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
              </parameter>
              <parameter>
                <name>maxActive</name>
                <value>20</value>
             </parameter>
             <parameter>
                <name>maxIdle</name>
                <value>5</value>
             </parameter>
             <parameter>
                <name>maxWait</name>
                <value>10000</value>
             </parameter>
             <parameter>
                <name>username</name>
            <parameter>
                <name>username</name>
                <value>SOMEUSER</value>
             </parameter>
             <parameter>
                <name>password</name>
                <value>SOMEPASSWORD</value>
             </parameter>
             <parameter>
               <name>driverClassName</name>
               <value>com.mysql.jdbc.Driver</value>
             </parameter>
             <parameter>
               <name>url</name>
               <value>jdbc:mysql://somehost.somewhere.com:3306/somedb</value>
             </parameter>
             <parameter>
               <name>timeBetweenEvictionRunsMillis</name>
               <value>300000</value>
             </parameter>
             <parameter>
               <name>minEvictableIdleTimeMillis</name>
               <value>25000</value>
             </parameter>
             <parameter>
               <name>validationQuery</name>
               <value>SELECT 1</value>
             </parameter>
             <parameter>
               <name>testOnBorrow</name>
               <value>true</value>
             </parameter>
           </ResourceParams>