Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-jdbc by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group