Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DBCP and oracle

843854Oct 29 2003 — edited Jun 15 2007
Hello,

I would like to use DBCP to manage the pool connection.

1. If I execute the web application using DBCP, an exception occur:
java.lang.NoClassDefFoundError: org/apache/struts/legacy/GenericDataSource
...
2. So I put the struts-legacy.jar in the WEB-INF/lib of the application, another error occur when I am starting tomcat:
java.sql.SQLException: No suitable driver
        at java.sql.DriverManager.getDriver(DriverManager.java:243)
        at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:743)
...
Any idea?
Thanks.


The oracle JDBC driver classes12.jar, the common-pool/dbcp/collection are in the tomcat/common/lib directory

The configuration in the struts-config.xml:
  <data-source key="ORACLE_EXP"
               type="org.apache.commons.dbcp.BasicDataSource">
   <set-property property="driverClass" value="oracle.jdbc.driver.OracleDriver"/>
   <set-property property="url" value="jdbc:oracle:thin:@XXX.XXX.XXX.XXXX:port:****"/>
   <set-property property="removeAbandoned" value="true"/>
   <set-property property="maxIdle" value="1"/>
   <set-property property="maxActive" value="1"/>
   <set-property property="maxWait" value="5000" />
   <set-property property="username" value="****"/>
...
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 13 2007
Added on Oct 29 2003
4 comments
1,467 views