This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JDBC and the fly likes Connection pooling with DBCP Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Connection pooling with DBCP" Watch "Connection pooling with DBCP" New topic
Author

Connection pooling with DBCP

Amarjyoti Das
Greenhorn

Joined: Mar 18, 2002
Posts: 16
Hi,
Anybody playing with dbcp from apache? I compined ManualPoolingDriverExample.java. Before compiling, I put commons-dbcp.jar, commons-pool.jar and commons-collections.jar under \lib\ext directory of JDK (1.4). I also renamed class12.zip ( oracle jdbc driver) to oracle-jdbc.jar. The code comiples fine. But when I try to run it using the following command it fails to create a database connection. Please help.
Thank you,
C:\java\classes>java ManualPoolingDriverExample "jdbc racle:thin:smms/password@myserver:1521:smms" "
SELECT * FROM DUAL"
Setting up driver.
Done.
Creating connection.
Exception in thread "main" org.apache.commons.dbcp.DbcpException: java.sql.SQLException: No suitable driver
at org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFa
ctory.java:101)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:184)
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(Unknown Source)
at org.apache.commons.dbcp.PoolingDriver.connect(PoolingDriver.java:146)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:199)
at ManualPoolingDriverExample.main(ManualPoolingDriverExample.java:153)
Sudharsan Govindarajan
Ranch Hand

Joined: Jul 03, 2002
Posts: 319
I have implemented Connection Pooling thru DBCP. But I have placed the JDBC driver jar in my web application's \WEB-INF\lib folder and the common-*.jars in the $CATLINA_ROOT\common\lib directory.-
-sudharsan
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Connection pooling with DBCP
 
Similar Threads
Prolems connecting to the Oracle database
JDBC Error
oracle connection pool
connect oracle type 4 driver in eclipse
Exception - To connect excel sheet