Re: [HACKERS] PREPARE

From: Peter T Mount <peter(at)retep(dot)org(dot)uk>
To: Michael Meskes <meskes(at)usa(dot)net>
Cc: pgsql-hackers(at)hub(dot)org
Subject: Re: [HACKERS] PREPARE
Date: 1998-11-17 18:40:01
Message-ID: Pine.LNX.3.96.981117183349.3444G-100000@maidast.retep.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-interfaces

On Tue, 17 Nov 1998, Michael Meskes wrote:

> On Mon, Nov 16, 1998 at 02:19:32PM -0600, Taral wrote:
> > separate stages. Are we also planning to support PREPARE? If so, we should
> > co-ordinate the effort, since the full COSQS support will require pulling
> > apart pg_parse_and_plan().
>
> Hopefully. I'm still holding back PREPARE for ecpg until I can think of a
> good solution. The best of course would be in the backend. Hmm, how do ODBC
> and JDBC solve this?

Background:

JDBC has a class called PrepareStatement. It's created by the
prepareStatement() method in the Connection class. The statement passed to
it has each required parameter represented by a ?

insert into mytable (field1,field2,field3) values (?,?,?);

Now the current postgresql jdbc implementation stores this string, and has
a Vector (Java for a dynamic array) that has each value stored in it as
the client application sets them. When the client calls the
executeUpdate() or executeQuery() methods, we just replace the ?'s with
the values in sequence, and pass the query to the backend as normal.

It's a real botch, but it works.

--
Peter T Mount peter(at)retep(dot)org(dot)uk
Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres
Java PDF Generator: http://www.retep.org.uk/pdf

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vince Vielhaber 1998-11-17 18:41:39 Re: [HACKERS] New to PostgreSQL, is this a DoS?
Previous Message Taral 1998-11-17 18:36:55 RE: [HACKERS] PREPARE

Browse pgsql-interfaces by date

  From Date Subject
Next Message Peter T Mount 1998-11-17 19:12:40 Re: Please help me in Postgres
Previous Message Taral 1998-11-17 18:36:55 RE: [HACKERS] PREPARE