Re: [INTERFACES] BIT type still not working

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Barry Lind <barry(at)xythos(dot)com>
Cc: iand(at)metamousetrap(dot)com, PostgreSQL jdbc list <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: [INTERFACES] BIT type still not working
Date: 2001-01-24 19:15:42
Message-ID: 200101241915.OAA21127@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces pgsql-jdbc


Thanks. This is exactly what I needed.

> 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(at)bea(dot)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(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
> + If your life is a hard drive, | 830 Blythe Avenue
> + Christ can be your backup. | Drexel Hill, Pennsylvania 19026

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Barry Lind 2001-01-24 19:27:12 Re: [INTERFACES] BIT type still not working
Previous Message Bruce Momjian 2001-01-24 18:47:49 Re: [INTERFACES] ODBC gives pq_recvbuf: unexpected EOF on client connection

Browse pgsql-jdbc by date

  From Date Subject
Next Message Barry Lind 2001-01-24 19:27:12 Re: [INTERFACES] BIT type still not working
Previous Message Bruce Momjian 2001-01-24 18:47:49 Re: [INTERFACES] ODBC gives pq_recvbuf: unexpected EOF on client connection