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 5CF7A3A57EA for ; Wed, 26 Jan 2005 21:03:22 +0000 (GMT) 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 57028-04 for ; Wed, 26 Jan 2005 21:03:12 +0000 (GMT) Received: from bayc1-pasmtp03.bayc1.hotmail.com (bayc1-pasmtp03.bayc1.hotmail.com [65.54.191.163]) by svr1.postgresql.org (Postfix) with ESMTP id 7A39C3A57E2 for ; Wed, 26 Jan 2005 21:03:10 +0000 (GMT) Message-ID: X-Originating-IP: [64.230.166.233] X-Originating-Email: [pelletier_32@sympatico.ca] Received: from JP ([64.230.166.233]) by bayc1-pasmtp03.bayc1.hotmail.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.211); Wed, 26 Jan 2005 13:03:10 -0800 Message-ID: <008301c503ea$710f5cf0$6400a8c0@JP> From: "Jean-Pierre Pelletier" To: "Oliver Jowett" Cc: "Kris Jurka" , References: <41F557C8.6030805@opencloud.com> <41F6B5CE.3040107@opencloud.com> <41F6D3EC.5000103@opencloud.com> <41F6D733.7010702@opencloud.com> <41F7F3D0.90809@opencloud.com> Subject: Re: setObject on PGInterval throws "Unknown Type null" Date: Wed, 26 Jan 2005 16:03:08 -0500 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2527 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-OriginalArrivalTime: 26 Jan 2005 21:03:10.0499 (UTC) FILETIME=[711E9F30:01C503EA] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.516 tagged_above=0 required=5 tests=FROM_ENDS_IN_NUMS, MSGID_FROM_MTA_HEADER X-Spam-Level: X-Archive-Number: 200501/267 X-Sequence-Number: 12147 new method names such as setInterval would be fine with me, as I don't mind changing my code. It doesn't fix the general case, but at least if fixes PGInterval which is an improvement. The advantage of overloaded versions of setObject over new method names was to provide backward compatibility for setObject(i,x) i.e. no need to recode setObject(i,x) to setObject(i,x,Types.someType) because setObject(i,x) is now broken with null objects. I don't know how important is backward compatibility, that's your call. Jean-Pierre Pelletier ----- Original Message ----- From: "Oliver Jowett" To: "Jean-Pierre Pelletier" Cc: "Kris Jurka" ; Sent: Wednesday, January 26, 2005 2:47 PM Subject: Re: [JDBC] setObject on PGInterval throws "Unknown Type null" > Jean-Pierre Pelletier wrote: > >> public void setObject(int parameterIndex, PGInterval x) >> throws SQLException > > Overloading setObject() sounds very risky. How about this instead: > > public void setInterval(int parameterIndex, PGInterval x) > throws SQLException > > That said, this doesn't help the general case as we can't know the set of > extension types ahead of time. > >> public void setObject(int parameterIndex, Integer x) >> throws SQLException > >> public void setObject(int parameterIndex, String x) >> throws SQLException > > I don't see the benefit of these methods; they're just a nonstandard way > of doing things that standard JDBC already lets you do (the second one > especially -- it's identical to PreparedStatement.setString()) > > -O > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)