pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Michael Allman <msa@allman.ms>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: prepareStatement()
Date: Sat, 23 Jul 2005 19:15:50 +1200
Message-ID: <42E1EEA6.60407@opencloud.com> (raw)
In-Reply-To: <20050722023608.I29135@yvyyl>
References: <20050722023608.I29135@yvyyl>

Michael Allman wrote:
> Does Postgres's JDBC Connection#prepareStatement(String) method support
> queries that can't be prepared by the backend?  (Namely those that are
> not of the SELECT, INSERT, UPDATE, or DELETE variety?)

It supports any query that the backend can parse -- it uses the v3
protocol Parse/Bind messages rather than using the SQL PREPARE statement
so it's not limited to SELECT/INSERT/UPDATE/DELETE.

The main gotcha (just mentioned in my previous email) is that you can
only put parameter placeholders where there is a PARAM terminal in the
server's SQL grammar (i.e. somewhere you could legally put $1, $2, etc)

-O



view thread (2+ messages)

Message-ID: <42E1EEA6.60407@opencloud.com>
Permalink:  ../42E1EEA6.60407@opencloud.com/
Also on:    postgresql.org/message-id/42E1EEA6.60407@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, msa@allman.ms
  Subject: Re: prepareStatement()
  In-Reply-To: <42E1EEA6.60407@opencloud.com>
  References: <20050722023608.I29135@yvyyl> <42E1EEA6.60407@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