Bidimensional Array

From: Leandro Guimarães <leo(dot)guimaraes(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Bidimensional Array
Date: 2011-12-26 18:08:20
Message-ID: CAJV35FMHLeieh3zOwzMSvNqnppeEJe4v6fF8diiESVHswQEkzg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hello Everyone,
Please, could someone help me with the following problem?

I need to get a bidimensional array from a postgresql function,
everything is working fine with the driver version 8.2 bellow, put when i
upgraded to 9.x the .getArray() method is not working anymore, i always
have the message: No *results* were *returned* by the *query.

Following my code and my exception with the comments, please i'm crazy
searching for a answer for this problem:
*

....

Array arr = rs.getArray(1); //checking the array, i'ts possible to see the
elements "{"{319.1,811.2,915.5}"}"
ResultSet arrRS = arr.getResultSet();
while (arrRS.next()) {
Array a1 = arrRS.getArray(2); //checking the array, i'ts possible to
see the elements {319.1,811.2,915.5}

String[] str = (String[]) a1.getArray(); //HERE HAPPENS THE EXCEPTION

}

...

Following the exception

rg.postgresql.util.PSQLException: No *results* were *returned* by the *
query.*
at
org.postgresql.jdbc2.TypeInfoCache.getPGArrayElement(TypeInfoCache.java:390)
at
org.postgresql.jdbc2.AbstractJdbc2Array.buildArray(AbstractJdbc2Array.java:323)
at
org.postgresql.jdbc2.AbstractJdbc2Array.getArrayImpl(AbstractJdbc2Array.java:149)
at
org.postgresql.jdbc2.AbstractJdbc2Array.getArray(AbstractJdbc2Array.java:115)

Thanks!
Leandro Guimarães

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2011-12-26 20:06:50 Re: Bidimensional Array
Previous Message Dave Cramer 2011-12-23 15:40:13 Re: Datasource portNumber property