Re: Bad value for type BigDecimal : Y

From: Ashish Jain <ashjain2(at)gmail(dot)com>
To: Mikko Tiihonen <mikko(dot)tiihonen(at)nitorcreations(dot)com>, richard(dot)broersma(at)gmail(dot)com
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Bad value for type BigDecimal : Y
Date: 2009-06-12 06:16:43
Message-ID: 14af40510906112316q67c62e2eu5dae171911bac1a1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi Mikko/Richard,

Thanks for your reply. I do have a column whose length is 1. The definition
goes something like this
@Column(updatable=true, name="st_spom_status", nullable=false, length=1)
private String status;

Do you think this is what may be the cause of the problem??

Thanks
Ashish

On Thu, Jun 11, 2009 at 10:22 PM, Mikko Tiihonen <
mikko(dot)tiihonen(at)nitorcreations(dot)com> wrote:

> Ashish Jain wrote:
>
>> Hi,
>>
>> I am using postgresql 8.3 with openJPA 1.2.1. I hit the following error
>>
>> org.postgresql.util.
>> PSQLException: Bad value for type BigDecimal : Y
>>
>> org.postgresql.jdbc2.AbstractJdbc2ResultSet.getBigDecimal(AbstractJdbc2ResultSet.java:311)
>> at
>> org.tranql.connector.jdbc.ResultSetHandle.getBigDecimal(ResultSetHandle.java:179)
>> at
>> org.apache.openjpa.lib.jdbc.DelegatingResultSet.getBigDecimal(DelegatingResultSet.java:282)
>> at
>> org.apache.openjpa.jdbc.sql.DBDictionary.getBigDecimal(DBDictionary.java:389)
>> at
>> org.apache.openjpa.jdbc.sql.PostgresDictionary.getInt(PostgresDictionary.java:210)
>> at
>> org.apache.openjpa.jdbc.sql.DBDictionary.getChar(DBDictionary.java:556)
>> at
>> org.apache.openjpa.jdbc.sql.ResultSetResult.getCharInternal(ResultSetResult.java:288)
>>
>
> Do you store a boolean 'Y'/'N' in a char(1) column? Maybe openjpa needs to
> have a different mapping that char for it.
>
> -Mikko
>
>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message John Lister 2009-06-12 07:42:26 Re: Bad value for type BigDecimal : Y
Previous Message Johnny Luong 2009-06-12 00:44:07 PreparedStatements with PG specific data types.