Home > Archive > PostgreSQL JDBC > July 2005 > prepareStatement()









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author prepareStatement()
Michael Allman

2005-07-22, 3:26 am

Does Postgres's JDBC Connection#prepareSt
atement(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?)

Michael

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Oliver Jowett

2005-07-23, 3:23 am

Michael Allman wrote:
> Does Postgres's JDBC Connection#prepareSt
atement(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

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql
.org so that your
message can get through to the mailing list cleanly

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com