X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E5816D1B23C for ; Tue, 6 Jul 2004 19:56:58 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 28618-01 for ; Tue, 6 Jul 2004 22:56:44 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 6BDCCD1B1F8 for ; Tue, 6 Jul 2004 19:56:40 -0300 (ADT) Received: (qmail 21040 invoked from network); 6 Jul 2004 22:56:41 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.36?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 6 Jul 2004 22:56:41 -0000 Subject: Re: getXXX methods From: Dave Cramer Reply-To: pg@fastcrypt.com To: Kris Jurka Cc: "pgsql-jdbc@postgresql.org" In-Reply-To: References: <1088795907.1536.118.camel@localhost.localdomain> <1089145387.1506.65.camel@localhost.localdomain> Content-Type: text/plain Organization: Cramer Consulting Message-Id: <1089154614.1508.70.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Tue, 06 Jul 2004 18:56:54 -0400 Content-Transfer-Encoding: 7bit X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/42 X-Sequence-Number: 10426 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