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

Re: prepareStatement()

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Michael Allman <msa(at)allman(dot)ms>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: prepareStatement()
Date: 2005-07-23 07:15:50
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
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)


In response to

pgsql-jdbc by date

Next:From: Oliver JowettDate: 2005-07-23 07:21:13
Subject: Re: Timestamp Conversion Woes Redux
Previous:From: Oliver JowettDate: 2005-07-23 07:13:03
Subject: Re: jdbc xa support

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