Multi-Demensional Array Support.

Поиск
Список
Период
Сортировка
От Greg Johnson
Тема Multi-Demensional Array Support.
Дата
Msg-id 1109094217.6541.24.camel@watto.interprose.net
обсуждение исходный текст
Ответы Re: Multi-Demensional Array Support.  (Oliver Jowett <oliver@opencloud.com>)
Список 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 по дате отправления:

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re:
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: Performance tweaks