Re: getXXX methods - Mailing list pgsql-jdbc

From Dave Cramer
Subject Re: getXXX methods
Date
Msg-id 1089154614.1508.70.camel@localhost.localdomain
Whole thread Raw
In response to Re: getXXX methods  (Kris Jurka <books@ejurka.com>)
Responses Re: getXXX methods
List pgsql-jdbc
I was thinking that parsing the double would be less efficient than
Byte.parseByte().

The spec suggests that the user would know what they are doing calling
getByte on a double column.

Dave
On Tue, 2004-07-06 at 17:01, Kris Jurka wrote:
> On Tue, 6 Jul 2004, Dave Cramer wrote:
>
> > Once possibility is to use Double.parseDouble(s).byteValue()
> >
> > so the code would become
> >
> > try
> > {
> >     Byte.parseByte(s)
> > }
>
> Why bother with Byte.parseByte at all if you are going to fall back to the
> double parsing anyway?  As I mentioned earlier I think it is better to
> throw an Exception rather than to silently alter the returned data.
>
> Kris Jurka
>
>
>
> !DSPAM:40eb133321082025652008!
>
>
--
Dave Cramer
519 939 0336
ICQ # 14675561


pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: getXXX methods
Next
From: Oliver Jowett
Date:
Subject: Re: getXXX methods