Re: AbstractJdbc2Array - another patch - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: AbstractJdbc2Array - another patch
Date
Msg-id Pine.BSO.4.64.0711240055520.505@leary.csoft.net
Whole thread Raw
In response to Re: AbstractJdbc2Array - another patch  (Marek Lewczuk <newsy@lewczuk.com>)
Responses Re: AbstractJdbc2Array - another patch
List pgsql-jdbc

On Thu, 22 Nov 2007, Marek Lewczuk wrote:

> Well, I aware that java.lang.reflect.Array#newInstance can be used
> however I didn't know for what versions of JDK reflect package can be used -
> if you have mentioned about it so I guess that I can - in the attachment you
> can find AbstractJdbc2Array patch - please review it.

Doesn't seem to work.  The attached case fails in two different ways
depending on whether compatible is set or not.  The JDK methods you can
use depends on where the code you are adding goes.  In this case you're
adding code to a JDBC2 class, so you are restricted to JDK1.2 code.  JDBC3
-> 1.4, JDBC3g -> 1.5, JDBC4 -> 1.6.

> I one to discuss one more thing - see below lines in the AbstractJdb2Array:
> this.useObjects = connection.haveMinimumCompatibleVersion("8.3");
> this.haveMinServer82 = connection.haveMinimumServerVersion("8.2");
>
> We must clarify, when to use objects instead of primitive types ? Can you
> describe it ?
>

Right now you use objects if either dims > 1 or useObjects.  I'm
suggesting that we should only use objects if useObjects.  That way people
who want to get int[][] returned can get that via setting compatible=8.2.

Kris Jurka

Attachment

pgsql-jdbc by date:

Previous
From: Luc1fer Hell
Date:
Subject: Fw: java.lang.IndexOutOfBoundsException when commit long transaction
Next
From: Kris Jurka
Date:
Subject: Re: Fw: java.lang.IndexOutOfBoundsException when commit long transaction