pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Johnson <gregj@interprose.com>
To: pgsql-jdbc@postgresql.org
Subject: Multi-Demensional Array Support.
Date: Tue, 22 Feb 2005 09:43:37 -0800
Message-ID: <1109094217.6541.24.camel@watto.interprose.net> (raw)

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




view thread (2+ messages)  latest in thread

Message-ID: <1109094217.6541.24.camel@watto.interprose.net>
Permalink:  ../1109094217.6541.24.camel@watto.interprose.net/
Also on:    postgresql.org/message-id/1109094217.6541.24.camel@watto.interprose.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: gregj@interprose.com
  Subject: Re: Multi-Demensional Array Support.
  In-Reply-To: <1109094217.6541.24.camel@watto.interprose.net>
  References: <1109094217.6541.24.camel@watto.interprose.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox