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

Re: Pass column name in preparedstatement

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Antony Paul <antonypaul24(at)gmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Pass column name in preparedstatement
Date: 2005-02-15 22:59:56
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
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.


In response to


pgsql-jdbc by date

Next:From: Antony PaulDate: 2005-02-16 04:14:38
Subject: Re: Pass column name in preparedstatement
Previous:From: Xavier PoinsardDate: 2005-02-15 17:11:17
Subject: Re: Which driver should I use?

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