Re: String index out of range - Postgresql 7.3.4, Resin & JDBC

From: Richard Huxton <dev(at)archonet(dot)com>
To: "Antony Brooke-Wood" <antony(at)l-o-u-d(dot)com>, <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: String index out of range - Postgresql 7.3.4, Resin & JDBC
Date: 2003-11-27 10:42:52
Message-ID: 200311271042.52947.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Monday 24 November 2003 12:22, Antony Brooke-Wood wrote:
> HI,
>
> We are getting the following error through a JSP.

Since I don't see any expert answers, I'll offer my inexpert one.

> java.lang.StringIndexOutOfBoundsException: String index out of range: 0
> at java.lang.String.charAt(String.java:444)
> at
> org.postgresql.jdbc1.AbstractJdbc1ResultSet.toBoolean(AbstractJdbc1Resul
> tSet.java:684)
> at
> org.postgresql.jdbc1.AbstractJdbc1ResultSet.getBoolean(AbstractJdbc1Resu
> ltSet.java:102)

Since it's complaining about a string index = 0, that suggests to me it's
trying to check charAt(0) when the string is empty (converting "T" or "F" to
a java true/false?). Possibly the toBoolean() call is having problems with a
boolean field that is null in PG.

I'd have a look at the source for the jdbc driver near the line mentioned and
see if you can see anything suspicious. Can't help you there since my java
skills don't extend much past "hello world".

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Margus Väli 2003-11-28 10:57:25 COPY alloc problem in 7.4
Previous Message Ngo Cong Do 2003-11-27 08:40:22 Some troubles from Postgrres_beta4