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 153D93A55EA for ; Mon, 24 Jan 2005 18:30:55 +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 81348-08 for ; Mon, 24 Jan 2005 18:30:40 +0000 (GMT) Received: from bayc1-pasmtp01.bayc1.hotmail.com (bayc1-pasmtp01.bayc1.hotmail.com [65.54.191.161]) by svr1.postgresql.org (Postfix) with ESMTP id 036A43A55E5 for ; Mon, 24 Jan 2005 18:30:39 +0000 (GMT) Message-ID: X-Originating-IP: [67.71.81.15] X-Originating-Email: [pelletier_32@sympatico.ca] Received: from JP ([67.71.81.15]) by bayc1-pasmtp01.bayc1.hotmail.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.211); Mon, 24 Jan 2005 10:32:42 -0800 Message-ID: <003901c50242$cf8f0180$6400a8c0@JP> From: "Jean-Pierre Pelletier" To: Cc: "Jean-Pierre Pelletier" Subject: setObject on PGInterval throws "Unknown Type null" Date: Mon, 24 Jan 2005 13:30:40 -0500 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0036_01C50218.E5BE93F0" 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: 24 Jan 2005 18:32:42.0609 (UTC) FILETIME=[17406E10:01C50243] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.612 tagged_above=0 required=5 tests=FROM_ENDS_IN_NUMS, HTML_50_60, HTML_MESSAGE, MSGID_FROM_MTA_HEADER X-Spam-Level: X-Archive-Number: 200501/233 X-Sequence-Number: 12113 This is a multi-part message in MIME format. ------=_NextPart_000_0036_01C50218.E5BE93F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable We upgraded to JDBC Build 309 on PostgreSQL 8.0 from JDBC Build 307 on PostgreSQL 7.4 and setObject now fails on PGInterval 1) if myPgInterval !=3D null Originally code: myPreparedStatement.setObject(i, myPGInterval) It throws SQLException "Unknown type null" We tried: myPreparedStatement.setObject(i, myPGInterval, Types.OTHER) It throws "Unknown type null" if myPgInterval =3D=3D null Original code: myPreparedStatement.setObject(i,myPGInterval) It throws "setObject(i,null) is not supported. Instead, use = setNull(i,type) or setObject(i,null,type)" We tried: myPreparedStatement.setNull(i, Types.OTHER) It throws "setNull(i, Types.OTHER) is not supported; use = setObject(i,null, Types.OTHER) instead" We tried: myPreparedStatement.setObject(i,myPGInterval,Types.OTHER) It throws "setNull(i, Types.OTHER) is not supported; use = setObject(i,null, Types.OTHER) instead" How should setObject be coded with a PGInterval ? 2) With JDBC Build 309, setObject requires an SQL Type when object =3D=3D = null, this makes setObject(i, object) useless. Why do JDBC requires an SQL Type when the same statement can be = processed by psql=20 without the SQL type specified? Why is a standard JDBC method setObject(i, object) rendered useless? Is it supported by other DBMS? Thanks Jean-Pierre Pelletier ------=_NextPart_000_0036_01C50218.E5BE93F0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
We upgraded to JDBC Build 309 on = PostgreSQL 8.0=20 from
JDBC Build 307 on PostgreSQL 7.4 and setObject now fails
on=20 PGInterval
 
1)
if myPgInterval !=3D = null
  =20 Originally code: myPreparedStatement.setObject(i, = myPGInterval)
  =20 It throws SQLException "Unknown type null"
 
   We tried:=20 myPreparedStatement.setObject(i, myPGInterval, = Types.OTHER)
   It=20 throws "Unknown type null"
 
if myPgInterval =3D=3D = null
   Original=20 code: myPreparedStatement.setObject(i,myPGInterval)
   It = throws=20 "setObject(i,null) is not supported. Instead, use setNull(i,type) or=20 setObject(i,null,type)"
 
   We tried:=20 myPreparedStatement.setNull(i, Types.OTHER)
   It throws=20 "setNull(i, Types.OTHER) is not supported; use setObject(i,null, = Types.OTHER)=20 instead"
 
   We tried:=20 myPreparedStatement.setObject(i,myPGInterval,Types.OTHER)
  = It=20 throws "setNull(i, Types.OTHER) is not supported; use setObject(i,null,=20 Types.OTHER) instead"
 
How should setObject be coded with a = PGInterval=20 ?
 
2)
With JDBC Build 309, setObject = requires an=20 SQL Type when object =3D=3D null,
this makes setObject(i, object)=20 useless.
 
Why do JDBC requires an SQL Type when = the same=20 statement can be processed by psql
without the SQL type=20 specified?
 
Why is a standard JDBC method = setObject(i, object)=20 rendered useless?
Is it supported by other DBMS?
 
Thanks
Jean-Pierre=20 Pelletier
------=_NextPart_000_0036_01C50218.E5BE93F0--