Received: from ns.sharemation.com (d83b57e4.dsl.flashcom.net [216.59.87.228]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0OJCMq57334 for ; Wed, 24 Jan 2001 14:12:22 -0500 (EST) (envelope-from barry@xythos.com) Received: from xythos.com (IDENT:blind@frog.xythos.com [192.168.254.110]) by ns.sharemation.com (8.9.3/8.8.7) with ESMTP id LAA08626; Wed, 24 Jan 2001 11:00:25 -0800 Message-ID: <3A6F2C90.992D3C20@xythos.com> Date: Wed, 24 Jan 2001 11:27:12 -0800 From: Barry Lind X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.16-22smp i686) X-Accept-Language: en MIME-Version: 1.0 To: Bruce Momjian CC: iand@metamousetrap.com, PostgreSQL jdbc list Subject: Re: [INTERFACES] BIT type still not working References: <200101241456.JAA21411@candle.pha.pa.us> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Archive-Number: 200101/37 X-Sequence-Number: 42 Can't reproduce the problem with current sources. I could successfully insert and select a boolean type to/from the database using: PreparedStatement.setBoolean(), ResultSet.getBoolean() as well as PreparedStatement.setObject(), ResultSet.getObject() It therefore appears that this is no longer a problem. thanks, --Barry Bruce Momjian wrote: > > Anyone want to address this? > > [ Charset ISO-8859-1 unsupported, converting... ] > > Is this true. If so, is there anytime schedule for a fix? > > > > Thanks, Ian > > > > Dan, > > > > I really think there is something wrong with the boolean (bit) type setting > > within the PostgreSQL JDBC driver. After checking w/ news groups and > > receiving one answer below, I think the only way I can accomplish what I > > need to is to go to postresql itself. Do you have any ideas? > > > > Hi Joe, > > > > I appreciate your response. I put in a workaround if I'm dealing with > > postgresql like the following: > > > > > > if (value instanceof Boolean && > > getType().equals(PersistentStore.PostgreSQL)) > > { > > Trace.println("Setting Boolean value for "+objAttr.getName()+"="+value); > > preparedStatement.setBoolean(i, ((Boolean)value).booleanValue()); > > } > > else > > { > > preparedStatement.setObject(i, value); > > } > > > > and saw the output: > > > > .. > > SQL: insert into Car (License,Color,Logo,Sunroof) values (?,?,?,?) > > Setting Boolean value for Sunroof=false > > .. > > > > with exactly the same problem, so calling setBoolean didn't work either. Do > > you have any suggestions on how to get in touch with the appropriate > > PostgreSQL people? > > Thanks, Ian > > > > -----Original Message----- > > From: Joe Weinstein [mailto:joe@bea.com] > > Sent: Monday, January 08, 2001 5:31 PM > > To: Ian deSouza > > Subject: Re: org.postgresql.Driver Problem? > > > > > > > > Ian deSouza wrote: > > > > Sorry, the value was equals to true when I get zpbit_in: t is not a valid > > bitstring and when value > > is false I get > > zpbit_in: f is not a valid bitstring . > > > > Hi Ian. > > You shouldn't use setObject() unless you are sending > > the driver a Driver-understandable java.sql Object. > > In this case, you should probably just use setBoolean(). > > > > > > > > > > -- > Bruce Momjian | http://candle.pha.pa.us > pgman@candle.pha.pa.us | (610) 853-3000 > + If your life is a hard drive, | 830 Blythe Avenue > + Christ can be your backup. | Drexel Hill, Pennsylvania 19026