Skip site navigation (1) Skip section navigation (2)

Multi-Demensional Array Support.

From: Greg Johnson <gregj(at)interprose(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Multi-Demensional Array Support.
Date: 2005-02-22 17:43:37
Message-ID: 1109094217.6541.24.camel@watto.interprose.net (view raw or flat)
Thread:
Lists: 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


Responses

pgsql-jdbc by date

Next:From: Oliver JowettDate: 2005-02-22 21:30:50
Subject: Re: Performance tweaks
Previous:From: Scott MarloweDate: 2005-02-22 17:28:54
Subject: Re:

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group