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

From: Kris Jurka <books(at)ejurka(dot)com>
To: Michael Enke <michael(dot)enke(at)wincor-nixdorf(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: PreparedStatement.toString() creates valid SQL; was: Q: use setObject also for int or string
Date: 2008-09-23 05:11:02
Message-ID: Pine.BSO.4.64.0809230059240.773@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Albe Laurenz 2008-09-23 06:17:24 Re: COPY support in JDBC driver?
Previous Message burferd 2008-09-22 22:55:25 Re: Problems connecting to database