Does PG's JDBC support prepared statements at all?

From: "Dr(dot) Evil" <drevil(at)sidereal(dot)kz>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Does PG's JDBC support prepared statements at all?
Date: 2001-10-20 23:14:22
Message-ID: 20011020231422.7227.qmail@sidereal.kz
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-jdbc pgsql-patches


There is a bunch of documentation for prepared statements in PG's
JDBC, it seems that the only thing prepared statements do is throw
exceptions.

Here's some code I'm trying:

String newvalue = "This is a new value";
int accountnumber = 54;
String qstring = "UPDATE foo SET message = '?' WHERE number = ?";
PreparedStatement st = db.prepareStatement(qstring);
st.setString(1, newvalue);
st.setInt(2, accountnumber);
st.execute();
st.clearParameters();
st.close();

and I always get a Parameter index out of range error, which seems
impossible. Any idea what's going on?

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Thomas O'Dowd 2001-10-21 02:37:29 Re: Does PG's JDBC support prepared statements at all?
Previous Message Dave Cramer 2001-10-20 22:24:39 Re: [PATCHES] Ant configuration

Browse pgsql-jdbc by date

  From Date Subject
Next Message Thomas O'Dowd 2001-10-21 02:37:29 Re: Does PG's JDBC support prepared statements at all?
Previous Message Dr. Evil 2001-10-20 22:34:05 PreparedStatement parameters question