Re: PreparedStatement parameters and mutable objects - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: PreparedStatement parameters and mutable objects
Date
Msg-id Pine.LNX.4.33.0401111846170.3834-100000@leary.csoft.net
Whole thread Raw
In response to Re: PreparedStatement parameters and mutable objects  (Oliver Jowett <oliver@opencloud.com>)
Responses Re: PreparedStatement parameters and mutable objects  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-jdbc
On Mon, 12 Jan 2004, Oliver Jowett wrote:

> I'm still in favour of an "undefined behaviour" interpretation here.
> There's not much benefit to application code in nailing down one
> behaviour or the other, and leaving it undefined gives the driver the
> flexibility to do whichever is a better implementation for the DB in
> question.
>

The question that has yet been unanswered is how much taking advantage of
the "undefined behavior" will get us.  You personally seem most interested
in the setBytes() case because it is relevent to your application and it
can potentially be quite large.  I don't know how much this would gain on
say a Date object.  For your particular problem it seems you could simply
wrap the byte array in question inside a ByteArrayInputStream (which does
not copy it) and use setBinaryStream which would allow the delayed reading
of it.

Kris Jurka


pgsql-jdbc by date:

Previous
From: Paul Thomas
Date:
Subject: Re: jdbc pooling question
Next
From: Paul Thomas
Date:
Subject: Re: PreparedStatement parameters and mutable objects