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 E3B9ED1B199 for ; Tue, 6 Jul 2004 22:01:25 -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 71306-08 for ; Wed, 7 Jul 2004 01:01:26 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 23A22D1B18C for ; Tue, 6 Jul 2004 22:01:21 -0300 (ADT) Received: (qmail 8890 invoked from network); 7 Jul 2004 01:01:21 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.36?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 7 Jul 2004 01:01:21 -0000 Subject: Re: getXXX methods From: Dave Cramer Reply-To: pg@fastcrypt.com To: Oliver Jowett Cc: Kris Jurka , "pgsql-jdbc@postgresql.org" In-Reply-To: <40EB385F.9030704@opencloud.com> References: <1088795907.1536.118.camel@localhost.localdomain> <1089145387.1506.65.camel@localhost.localdomain> <1089154614.1508.70.camel@localhost.localdomain> <40EB385F.9030704@opencloud.com> Content-Type: text/plain Organization: Cramer Consulting Message-Id: <1089162095.1508.173.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Tue, 06 Jul 2004 21:01:35 -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/44 X-Sequence-Number: 10428 Oliver, Well as Kris pointed out the javadoc is next to useless here. I see no harm in truncating the data, my assumption being that the user knows what they are doing. Dave On Tue, 2004-07-06 at 19:40, Oliver Jowett wrote: > Dave Cramer wrote: > > 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. > > Yeah, specifically table B-6 says you can use getByte() on pretty much > any numeric SQL type, and (bizarrely) on varchar, char, longvarchar, and > boolean types too. > > The spec & javadoc for java.sql.DataTruncation implies we should > generate DataTruncation as a warning if we truncate data on read. I > suppose that loss of precision counts as truncation? > > -O > > > > !DSPAM:40eb3871277871679725527! > > -- Dave Cramer 519 939 0336 ICQ # 14675561