pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Antony Paul <antonypaul24@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Pass column name in preparedstatement
Date: Wed, 16 Feb 2005 11:59:56 +1300
Message-ID: <42127EEC.3000502@opencloud.com> (raw)
In-Reply-To: <2989532e05021504045fc879fe@mail.gmail.com>
References: <2989532e050215032031e9aeb8@mail.gmail.com>
	<4211E2E1.4090506@opencloud.com>
	<2989532e05021504045fc879fe@mail.gmail.com>

Antony Paul wrote:
> In 7.3.3 is there any use in using PreparedStatement since the columns
> may change for each query.

It depends on your application; are there non-column-name parameters? If 
so, using PreparedStatement still gives you the benefit that you do not 
have to escape those parameters by hand.

Under 7.3.x there's no real performance benefit to reusing 
PreparedStatements, as the v3 protocol (supporting server-side query 
parameterization and reuse) was only introduced in 7.4. Under 7.4 or 
8.0, there is some scope for improved performance if you reuse 
PreparedStatements. As your query strings are changing, you may want to 
have a cache to preserve a PreparedStatement for frequently used queries.

You really should upgrade if you're still using 7.3.3, at least to the 
latest 7.3.x.

-O



view thread (7+ messages)  latest in thread

Message-ID: <42127EEC.3000502@opencloud.com>
Permalink:  ../42127EEC.3000502@opencloud.com/
Also on:    postgresql.org/message-id/42127EEC.3000502@opencloud.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: oliver@opencloud.com, antonypaul24@gmail.com
  Subject: Re: Pass column name in preparedstatement
  In-Reply-To: <42127EEC.3000502@opencloud.com>
  References: <2989532e050215032031e9aeb8@mail.gmail.com> <4211E2E1.4090506@opencloud.com> <2989532e05021504045fc879fe@mail.gmail.com> <42127EEC.3000502@opencloud.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