Re: PreparedStatement.toString() creates valid SQL; was: Q: use setObject also for int or string - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: PreparedStatement.toString() creates valid SQL; was: Q: use setObject also for int or string
Date
Msg-id Pine.BSO.4.64.0809230059240.773@leary.csoft.net
Whole thread Raw
In response to Re: PreparedStatement.toString() creates valid SQL; was: Q: use setObject also for int or string  (Michael Enke <michael.enke@wincor-nixdorf.com>)
Responses Re: PreparedStatement.toString() creates valid SQL; was: Q: use setObject also for int or string  (Michael Enke <michael.enke@wincor-nixdorf.com>)
List pgsql-jdbc

On Mon, 22 Sep 2008, Michael Enke wrote:

> Attached file contains all changed java sources to make your testcase
> working. I added to ParameterList interface a method toSQLString(int).

What is the reason for this instead of using the existing toString(int)
method?  If toSQLString is required, how can CompositeParameterList's
toSQLString just call toString?


> I did not implement the InputStream because
> 1) I do not know the encoding of data
> 2) it could be an InputStream which can not be reset
>

That's fair.  I was just pointing out that you can't always produce a text
representation for the prepared statement.  Your changes are certainly an
improvement.

Also, context diffs are appreciated instead of the whole file.

Kris Jurka

pgsql-jdbc by date:

Previous
From: burferd
Date:
Subject: Re: Problems connecting to database
Next
From: "Albe Laurenz"
Date:
Subject: Re: COPY support in JDBC driver?