error getString() --> decodeUTF8 / java.lang.ArrayIndexOutOfBoundsException: 5 - Mailing list pgsql-jdbc

From Pedro Salazar
Subject error getString() --> decodeUTF8 / java.lang.ArrayIndexOutOfBoundsException: 5
Date
Msg-id 1050056350.9815.11.camel@vitoria.intra.cet.pt
Whole thread Raw
Responses Re: error getString() --> decodeUTF8 /
List pgsql-jdbc
Greetings,

I have function that returns a refcursor. When I call it in plpgsql
shell, it returns all the rows correctly. But, When I call it in JDBC,
when it tries to decode a string in specific row (7) it throws the
following exception:

java.lang.ArrayIndexOutOfBoundsException: 5
        at org.postgresql.core.Encoding.decodeUTF8(Encoding.java:254)
        at org.postgresql.core.Encoding.decode(Encoding.java:165)
        at org.postgresql.core.Encoding.decode(Encoding.java:181)
        at
org.postgresql.jdbc1.AbstractJdbc1ResultSet.getString(AbstractJdbc1ResultSet.java:97)

My refcursor returns the following list (the characters are in
portuguese language):

 id |    class
----+-------------
  1 | Avenida
  2 | Bairro
  3 | Cais
  4 | Estrada
  5 | Largo
  6 | Lugar
  7 | Praça
  8 | Rotunda
  9 | Rua
 10 | Sítio
 11 | Travessa
 12 | Urbanização

The row number 7 (Praça) [character 'C' with cedilla] is throwing the
above exception. How should I retrieve my string which has portuguese
characters, in JDBC?

thanks,
Pedro Salazar.
--
PS
pedro-b-salazar@ptinovacao.pt
PGP:0E129E31D803BC61


pgsql-jdbc by date:

Previous
From: Peter Royal
Date:
Subject: Re: Problem asking columns allowing NULL values
Next
From: Pedro Salazar
Date:
Subject: Re: error getString() --> decodeUTF8 /