pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: janaka priyadarshana <rpjanaka@gmail.com>
To: pgsql-jdbc@postgresql.org
Subject: use connection pooling
Date: Fri, 22 Dec 2006 12:28:03 +0530
Message-ID: <de1942f0612212258o5861e88cg1627a1bd340d218@mail.gmail.com> (raw)

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) {}
    }
}

view thread (7+ messages)  latest in thread

Message-ID: <de1942f0612212258o5861e88cg1627a1bd340d218@mail.gmail.com>
Permalink:  ../de1942f0612212258o5861e88cg1627a1bd340d218@mail.gmail.com/
Also on:    postgresql.org/message-id/de1942f0612212258o5861e88cg1627a1bd340d218@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: rpjanaka@gmail.com
  Subject: Re: use connection pooling
  In-Reply-To: <de1942f0612212258o5861e88cg1627a1bd340d218@mail.gmail.com>
  References: <de1942f0612212258o5861e88cg1627a1bd340d218@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox