Re: Connection Pool

Lists: pgsql-jdbc
From: "Raghavendra MB" <mb(dot)ragu(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Connection Pool
Date: 2007-06-05 06:27:56
Message-ID: aa36b6870706042327v4f711f6ep1e1bd8df0d67fd34@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Hi,

I am using PostgresSQL 8.2 server. I would like to use JDBC connecton pool:
My application is pure core java desktop. Is there any readily available
pool for postgres ?

how to go about it.

Please suggest me.

regards
Raghu


From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: Raghavendra MB <mb(dot)ragu(at)gmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Connection Pool
Date: 2007-06-05 14:09:54
Message-ID: 46656EB2.1060408@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Raghavendra MB wrote:
> I am using PostgresSQL 8.2 server. I would like to use JDBC connecton pool:
> My application is pure core java desktop. Is there any readily available
> pool for postgres ?

There's plenty of generic implementations. For example, Apache commons
DBCP: http://jakarta.apache.org/commons/dbcp/

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com


From: Andreas Joseph Krogh <andreak(at)officenet(dot)no>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Connection Pool
Date: 2007-06-05 15:22:50
Message-ID: 200706051722.50953.andreak@officenet.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

On Tuesday 05 June 2007 16:09:54 Heikki Linnakangas wrote:
> Raghavendra MB wrote:
> > I am using PostgresSQL 8.2 server. I would like to use JDBC connecton
> > pool: My application is pure core java desktop. Is there any readily
> > available pool for postgres ?
>
> There's plenty of generic implementations. For example, Apache commons
> DBCP: http://jakarta.apache.org/commons/dbcp/

I recommend C3PO, it's much simpler to set up in a standard application:

DataSource pooled = null;
try {
DataSource unpooled =
DataSources.unpooledDataSource("jdbc:postgresql://localhost:5432/mydb",
"username",
"password");
pooled = DataSources.pooledDataSource( unpooled );
} catch (Exception e) {
e.printStackTrace();
}

--
Andreas Joseph Krogh <andreak(at)officenet(dot)no>
Senior Software Developer / Manager
------------------------+---------------------------------------------+
OfficeNet AS | The most difficult thing in the world is to |
Karenslyst Allé 11 | know how to do a thing and to watch |
PO. Box 529 Skøyen | somebody else doing it wrong, without |
0214 Oslo | comment. |
NORWAY | |
Tlf: +47 24 15 38 90 | |
Fax: +47 24 15 38 91 | |
Mobile: +47 909 56 963 | |
------------------------+---------------------------------------------+