use connection pooling

From: "janaka priyadarshana" <rpjanaka(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: use connection pooling
Date: 2006-12-22 06:58:03
Message-ID: de1942f0612212258o5861e88cg1627a1bd340d218@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

i am tring to use connection pooing with postgresql but i was unable to
found complete example about that.

got some idea from the documentation, but i was unable to run the given
example.

please help me to getting start..

thanks....

Jdbc3PoolingDataSource source = new Jdbc3PoolingDataSource();
source.setDataSourceName("A Data Source");
source.setServerName("localhost");
source.setDatabaseName("test");
source.setUser("testuser");
source.setPassword("testpassword");
source.setMaxConnections(10);

Connection con = null;
try {
con = source.getConnection();
// use connection
} catch (SQLException e) {
// log error
} finally {
if (con != null) {
try { con.close(); } catch (SQLException e) {}
}
}

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message janaka priyadarshana 2006-12-22 08:02:48 Connection pooling in java
Previous Message Dave Cramer 2006-12-21 17:06:57 Re: Exception-handling