pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Roger Niederland <roger@niederland.com>
To: Oliver Jowett <oliver@opencloud.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: query string on a prepared statement
Date: Wed, 24 Nov 2004 14:50:00 -0800
Message-ID: <002801c4d277$ee33a640$0c02010a@RogerPortable> (raw)
References: <001501c4d266$055d3c30$0c02010a@RogerPortable>
	<41A50C30.9000108@opencloud.com>


Similar code work previously on DB2, Mysql and earlier versions of the
released postgresql jdbc drivers.  So I assumed that this was a driver 
problem.
Thanks, for the quick response!

> Roger Niederland wrote:
>
>> Using pg80b1.308.jdbc3.jar got the following: (worked with 
>> pg74.215.jdbc3.jar)
>>
>> Code:
>> results = stmt.executeQuery("SELECT currval('LoginLog_LoginLogID_seq')");
>>
>> Stack Trace:
>> org.postgresql.util.PSQLException: Can't use query methods that take a 
>> query string on a PreparedStatement.
>
> As it says, you can't use executeQuery(String) on a PreparedStatement. Use 
> it on a Statement created via Connection.createStatement() instead.
>
> The JDBC spec requires that PreparedStatement throw an exception in this 
> case. Older drivers did not follow the spec.
>
> -O
>
> 





view thread (3+ messages)

Message-ID: <002801c4d277$ee33a640$0c02010a@RogerPortable>
Permalink:  ../002801c4d277$ee33a640$0c02010a@RogerPortable/
Also on:    postgresql.org/message-id/002801c4d277$ee33a640$0c02010a@RogerPortable

 · 

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: roger@niederland.com, oliver@opencloud.com
  Subject: Re: query string on a prepared statement
  In-Reply-To: <002801c4d277$ee33a640$0c02010a@RogerPortable>
  References: <001501c4d266$055d3c30$0c02010a@RogerPortable> <41A50C30.9000108@opencloud.com> <002801c4d277$ee33a640$0c02010a@RogerPortable>

* 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