Re: [JDBC] Prepared statement performance...

From: Barry Lind <barry(at)xythos(dot)com>
To: Jochem van Dieten <jochemd(at)oli(dot)tudelft(dot)nl>
Cc: pgsql-general(at)postgresql(dot)org, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] Prepared statement performance...
Date: 2002-09-27 19:02:02
Message-ID: 3D94AB2A.6020209@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-jdbc

Jochem,

Currently you probably can't. But given the information I have
mentioned in my previous mails in this thread, I am not sure that you
would really want to unless you somehow have the ability to do it
statement by statement since in most cases I think you don't want to use
server side prepared statements.

If someone can think of a way through the standard jdbc api to
enable/disable something like this at the statement level I am all ears.
I haven't been able to think of a mechanism other that the one that
has been implemented.

thanks,
--Barry

Jochem van Dieten wrote:
> Barry Lind wrote:
>
>>
>> Your first option is what has been implemented. In 7.3 the server now
>> supports 'prepare <name> as <sql>' and 'execute <name>' (and variants
>> for passing bind variables). The jdbc driver also now has a method on
>> org.postgresql.PGStatement.setUseServerPrepare(true) to enable the the
>> use of server side prepared statements (so you can cast your Statement
>> object to an org.postgresql.PGStatement object and enable the
>> functionality for a specific statement).
>
> [..]
>
>> It is for the reasons above that the developer needs to explicitly turn
>> on the use of server side prepared statements when it makes sense to
>> do so.
>
>
> How would the developer do that? With the front-end I am working with
> (ColdFusion MX) I have very little control over the actual calls to the
> driver. I can make CF MX use createStatement() or prepareStatement() but
> that is all the control I have. And the only way to send parameters to
> the driver would be through a JDBC URL.
> Would that enable me to use prepared statements for real or not?
>
> Jochem
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Barry Lind 2002-09-27 19:14:19 Re: [JDBC] Prepared statement performance...
Previous Message Florian Weimer 2002-09-27 19:01:38 Re: [GENERAL] Performance while loading data and indexing

Browse pgsql-jdbc by date

  From Date Subject
Next Message Barry Lind 2002-09-27 19:14:19 Re: [JDBC] Prepared statement performance...
Previous Message Barry Lind 2002-09-27 18:57:54 Re: [JDBC] Prepared statement performance...