Multi-Demensional Array Support. - Mailing list pgsql-jdbc

From Greg Johnson
Subject Multi-Demensional Array Support.
Date
Msg-id 1109094217.6541.24.camel@watto.interprose.net
Whole thread Raw
Responses Re: Multi-Demensional Array Support.
List pgsql-jdbc
I started hacking in multi-dimensional array support into the driver.

However, with the getArray() function I have to return an ArrayList of
ArrayLists (or Object[] of Object[]) instead of the native type Object
[][] for example. I was wondering what you guys/gals thoughts are on the
this?

As an application developer I personally would like to get ArrayLists of
ArrayLists back.

It seems that unless you what to have a whole bunch of nasty "if" logic
that is the only way to implement multi-dimensional arrays cleanly.
Example:
 if array_dims==1
    returnVal = String[];
 if array_dims==2
    returnVal = String[][];
 else if array_dims==3
    returnVal = String[][][];

.. but I am not java guru so if there is a better way let me know.

Also, is there a reason why a regular expression is not used to parse
out the array string returned from postgresql?

Thanks, I hope I can help out!
Greg


pgsql-jdbc by date:

Previous
From: Scott Marlowe
Date:
Subject: Re:
Next
From: Oliver Jowett
Date:
Subject: Re: Performance tweaks