my dog learned polymorphism
The moose likes Tomcat and the fly likes postgres pool with Tomcat 4.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "postgres pool with Tomcat 4.1" Watch "postgres pool with Tomcat 4.1" New topic

postgres pool with Tomcat 4.1

adrian kiwi

Joined: Feb 25, 2004
Posts: 1
Hi every one!
I try to use the connection pool feature from Tomcat.
I followed the instruction from the jakarta web-site:, but it didn't works.
I have jbuilderx with this configuration:
1) Personalized server8080.xml file:
<Context debug="0" docBase="......">
<Resource name="jdbc/postgres" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/postgres">
<value>jdbc ostgresql://</value>;
2) web.xml
<description>postgreSQL Datasource</description>
3) commons.jar, coomons-dbcp.jar, commons-collection were addes in
4) I have pg73jdbc3.jar file puted in project library
5) I'm using postgres 7.3.5
6) java code:
InitialContext initCtx = new InitialContext();
if(initCtx == null )
throw new Exception("Boom - No Context");
Context ctx = (Context)initCtx.lookup("java:comp/env");
DataSource ds = (DataSource)ctx.lookup("jdbc/postgres");
if (ds != null) {
Connection conn = ds.getConnection();
if(conn != null) {
catch(Exception e) {
When I run the java code I receive:
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null', cause:
java.sql.SQLException: No suitable driver
[ February 25, 2004: Message edited by: adrian kiwi ]
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63870

Firstly adrian, welcome to the Ranch.
Secondly, as you can see in your post, HTML markup doesn't work and only makes your post less readable. You can use the 'edit' feature to go reformat your post without the HTML markup. Hint: UBB tags can be used to format code, quote, bold and so on...
Lastly, since this is more a Tomcat setup question than a JDBC question, I'm moving this topic to the Tomcat forum where the Tomcat-savvy hang out. Please make your edits and continue any discussion there.

[Asking smart questions] [About Bear] [Books by Bear]
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

4) I have pg73jdbc3.jar file puted in project library

This also needs to be in the common/lib directory of tomcat.
I agree. Here's the link:
subject: postgres pool with Tomcat 4.1
jQuery in Action, 3rd edition