Re: error getString() --> decodeUTF8 / - Mailing list pgsql-jdbc

From Pedro Salazar
Subject Re: error getString() --> decodeUTF8 /
Date
Msg-id 1050057614.9821.26.camel@vitoria.intra.cet.pt
Whole thread Raw
In response to error getString() --> decodeUTF8 / java.lang.ArrayIndexOutOfBoundsException: 5  (Pedro Salazar <pedro-b-salazar@ptinovacao.pt>)
Responses Re: error getString() --> decodeUTF8 /
List pgsql-jdbc
Hi,

I forgot to tell that I'm using the JDBC driver build from postgresql
7.3.2.

PS

On Fri, 2003-04-11 at 11:19, Pedro Salazar wrote:
> 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: Pedro Salazar
Date:
Subject: error getString() --> decodeUTF8 / java.lang.ArrayIndexOutOfBoundsException: 5
Next
From: "Nagesh Yencharla"
Date:
Subject: passing a String[] to a Stored function