Thread: two dimensional arrays supported?

two dimensional arrays supported?

From
Guido Fiala
Date:
Hallo,

i just tested to access a 2-dimensional array of varchar via jdbc and the
driver gives the exception "not implemented" - did i something wrong, or is
it not yet supported?

Any alternative available?

My table is defined as following:

CREATE TABLE tst_2dimarray
(
   twodim varchar[][]  NULL,
   onedim varchar[]  NULL
);

my code snippet:

Array a=rs.getArray("twodim");
String aa[][]=(String[][])a.getArray();//this line throws exception below

org.postgresql.util.PSQLException: Diese Methode ist noch nicht implementiert.
    at org.postgresql.Driver.notImplemented(Driver.java:413)
    at org.postgresql.jdbc2.Array.getArray(Array.java:106)
    at org.postgresql.jdbc2.Array.getArray(Array.java:63)
    at twodimarray.main(twodimarray.java:38)

localized message means "not yet implemented"...
Above code works fine with "onedim".

Guido

Re: two dimensional arrays supported?

From
Oliver Jowett
Date:
Guido Fiala wrote:
> Hallo,
>
> i just tested to access a 2-dimensional array of varchar via jdbc and the
> driver gives the exception "not implemented" - did i something wrong, or is
> it not yet supported?

Only 1D arrays are currently supported.

> Any alternative available?

ResultSet.getString() should give you the raw value, you can then parse
that yourself as needed.

-O

Re: two dimensional arrays supported?

From
Richard Bottoms
Date:
I've tried unsubscribing with no luck. Administrator can you help me out? I
only use two addresses and neither one has worked using theunsubscribe tool.


Thanks.