Re: Prepared Statements - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Prepared Statements
Date
Msg-id 20030721143614.GH2506@opencloud.com
Whole thread Raw
In response to Re: Prepared Statements  (Dmitry Tkach <dmitry@openratings.com>)
Responses Re: Prepared Statements
List pgsql-jdbc
On Mon, Jul 21, 2003 at 10:27:30AM -0400, Dmitry Tkach wrote:

> Why not just allow setObject() to take Collection as an argument?

You need information on the SQL type of the contents to be able to turn them
into a DB representation correctly. We can't use the type parameter to
setObject() for this as that should reflect the whole paramater, i.e.
probably Types.OTHER in this case.

java.sql.Array has a getBaseType() that does the job.

> You would not need any special implementations then... and the
> application would not need to waste cycles on wrapping/unwrapping those
> Arrays every time...

Hah, and it's faster to wrap your array of ints in a bunch of
java.lang.Integer objects so you can put in in a Collection? :)

-O

pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: Prepared Statements
Next
From: Oliver Jowett
Date:
Subject: Re: Prepared Statements