Skip site navigation (1) Skip section navigation (2)

Re: getBigDecimal problem

From: Peter T Mount <peter(at)retep(dot)org(dot)uk>
To: svetsch(at)tradewinds-solutions(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: getBigDecimal problem
Date: 2001-03-21 11:45:09
Message-ID: 985175109.3ab894452e13d@webmail.retep.org.uk (view raw or flat)
Thread:
Lists: pgsql-bugs
Quoting svetsch(at)tradewinds-solutions(dot)com:

> Hi,
> 
> We just find out a small bug with the getBigDecimal(int i) method in
> ResultSet (postgresql 7.1 beta6)
> 
> Th symptom is :
> 
> We cannot read a decimal value with getBigDecimal() although, we can set
> it
> 
> We solve the problem temporary by replacing the source original method
> 
>     public java.math.BigDecimal getBigDecimal(int columnIndex) throws
> SQLException
>     {
>       // Now must call BigDecimal with a scale otherwise JBuilder barfs
>       return getBigDecimal(columnIndex,0);
>     }
> 
> by
> 
>     public java.math.BigDecimal getBigDecimal(int columnIndex) throws
> SQLException
>     {
>       // Now must call BigDecimal with a scale otherwise JBuilder barfs
>       return getBigDecimal(columnIndex,-1);
>     }
> 
> So it does not perform a setScale in the method getBigDecimal(int
> column,
> int scale)
> 
> It works well for us.

Hmmm, that one slipped past me. -1 is the correct figure as the getBigDecimal
(col,scale) method handles scale==-1 as a special case.

Thanks, Peter

-- 
Peter Mount peter(at)retep(dot)org(dot)uk
PostgreSQL JDBC Driver: http://www.retep.org.uk/postgres/
RetepPDF PDF library for Java: http://www.retep.org.uk/pdf/

In response to

pgsql-bugs by date

Next:From: Krzysztof CzumaDate: 2001-03-21 12:00:55
Subject: Re: psql crashes postmaster
Previous:From: pgsql-bugsDate: 2001-03-21 09:00:01
Subject: Encoding problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group