Re: AbstractJdbc2Array - another patch

From: Kris Jurka <books(at)ejurka(dot)com>
To: Marek Lewczuk <newsy(at)lewczuk(dot)com>
Cc: pgsql-jdbc <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: AbstractJdbc2Array - another patch
Date: 2007-11-24 06:07:14
Message-ID: Pine.BSO.4.64.0711240055520.505@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
ArrayTest4.java text/plain 929 bytes

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2007-11-24 06:36:55 Re: Fw: java.lang.IndexOutOfBoundsException when commit long transaction
Previous Message Luc1fer Hell 2007-11-22 15:19:44 Fw: java.lang.IndexOutOfBoundsException when commit long transaction