commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Garey Mills <>
Subject Continuing problems with dbcp - no suitable driver -- please help
Date Fri, 16 Mar 2007 20:29:55 GMT
Hello -

    I am trying to use dbcp in a java web app, using it as a driver and 
configuring it with a jocl file. Here is the error I am getting

java.sql.SQLException: No suitable driver
        at java.sql.DriverManager.getConnection(
        at java.sql.DriverManager.getConnection(
        at java.sql.DriverManager.getConnection(
        at java.sql.DriverManager.getConnection(

and here is the jocl file, 'dbconn.jocl'

<object class="org.apache.commons.dbcp.PoolableConnectionFactory" 
   <!-- the first argument is the ConnectionFactory -->
   <object class="org.apache.commons.dbcp.DriverManagerConnectionFactory">
      <string value="jdbc:mysql://localhost/<dbname>?user=<my 
user>&amp;password=<my password>"/>
      <object class="java.util.Properties" null="true"/>
   <!-- the next argument is the ObjectPool -->
   <object class="org.apache.commons.pool.impl.GenericObjectPool">
      <object class="org.apache.commons.pool.PoolableObjectFactory" 
      <int value="10"/> <!-- max active -->
      <byte value="1"/> <!-- when exhausted action, 0 = fail, 1 = block, 
2 = grow -->
      <long value="2000"/> <!-- max wait -->
      <int value="10"/> <!-- max idle -->
      <boolean value="false"/> <!-- test on borrow -->
      <boolean value="false"/> <!-- test on return -->
      <long value="10000"/> <!-- time between eviction runs -->
      <int value="5"/> <!-- number of connections to test per eviction 
run -->
      <long value="5000"/> <!-- min evictable idle time -->
      <boolean value="true"/> <!-- test while idle -->
  <!-- the next argument is the KeyedObjectPoolFactory -->
  <object class="org.apache.commons.pool.impl.StackKeyedObjectPoolFactory">
     <int value="5"/> <!-- max idle -->       
   <string value="SELECT COUNT(*) FROM DUAL"/> <!-- validation query -->
   <boolean value="false"/> <!-- default read only -->
   <boolean value="true"/> <!-- default auto commit -->

in my code, I try to make a connection like this

        Connection c = 

It looks like the connection is not being made by the PoolingDriver, but 
I can connect to the database
using <my user>, <my password> and <dbname>.

Can anyone help me out?

Garey Mills

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message