pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dave Cramer <pg@fastcrypt.com>
To: Antony Paul <antonypaul24@hotmail.com>
Cc: pgsql-jdbc <pgsql-hdbc@postgresql.org>
Subject: Re: Closing ResultSet and Statements
Date: Mon, 23 Aug 2004 10:22:01 -0400
Message-ID: <1093270921.20388.139.camel@localhost.localdomain> (raw)
In-Reply-To: <BAY15-DAV106PkdlKOz0000ea69@hotmail.com>
References: <BAY15-DAV106PkdlKOz0000ea69@hotmail.com>

Most of these questions have nothing to do with pg, but jdbc in general.

On Mon, 2004-08-23 at 04:24, Antony Paul wrote:
> Hi all,
> (Sorry if repost. I posted it some days ago but couldn't  found on the list)
> 1. Is it necessary to close all ResultSet and Statements in PostgreSQL.
It is generally very good form to close them, however if you close the
statement, the result set will be closed, as per the jdbc spec.
> 2. How to know that a ResultSet is open ?. Any views to query this
> information?.
not really, you either get null from the Statement.execute, or an open
result set
> 3. Do closing a Statement closes the ResultSet ?.
yes, as per spec
> 4. I saw an option of  autocommit = true in the postgresql.conf file. What
> is its use. 
to set autocommit to false, but I would not expect the driver to
function well, I seriously doubt if anyone has tested this thoroughly.

> What is the default behaviour if it is commented. 
if it is commented that is the default

> If I set this
> to true do I have commit on all connections obtained without using a
> connection pool ?.
If this is true you do not have to commit anything. The way to do this
in jdbc is to use Connection.setAutoCommt(false|true);
> 
> rgds
> Antony Paul
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
> 
-- 
Dave Cramer
519 939 0336
ICQ # 14675561
www.postgresintl.com




view thread (3+ messages)  latest in thread

Message-ID: <1093270921.20388.139.camel@localhost.localdomain>
Permalink:  ../1093270921.20388.139.camel@localhost.localdomain/
Also on:    postgresql.org/message-id/1093270921.20388.139.camel@localhost.localdomain

 · 

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: pg@fastcrypt.com, antonypaul24@hotmail.com, pgsql-hdbc@postgresql.org
  Subject: Re: Closing ResultSet and Statements
  In-Reply-To: <1093270921.20388.139.camel@localhost.localdomain>
  References: <BAY15-DAV106PkdlKOz0000ea69@hotmail.com> <1093270921.20388.139.camel@localhost.localdomain>

* 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