pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BIT type still not working
5+ messages / 4 participants
[nested] [flat]

* BIT type still not working
@ 2001-01-11 01:11  Ian deSouza <iand@metamousetrap.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Ian deSouza @ 2001-01-11 01:11 UTC (permalink / raw)
  To: pgman@candle.pha.pa.us

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().






^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [INTERFACES] BIT type still not working
@ 2001-01-24 14:56  Bruce Momjian <pgman@candle.pha.pa.us>
  parent: Ian deSouza <iand@metamousetrap.com>
  0 siblings, 2 replies; 5+ messages in thread

From: Bruce Momjian @ 2001-01-24 14:56 UTC (permalink / raw)
  To: iand@metamousetrap.com; +Cc: PostgreSQL jdbc list <pgsql-jdbc@postgresql.org>


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



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [INTERFACES] BIT type still not working
@ 2001-01-24 19:15  Bruce Momjian <pgman@candle.pha.pa.us>
  parent: Barry Lind <barry@xythos.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Bruce Momjian @ 2001-01-24 19:15 UTC (permalink / raw)
  To: Barry Lind <barry@xythos.com>; +Cc: iand@metamousetrap.com, PostgreSQL jdbc list <pgsql-jdbc@postgresql.org>


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@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



-- 
  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



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [INTERFACES] BIT type still not working
@ 2001-01-24 19:27  Barry Lind <barry@xythos.com>
  parent: Bruce Momjian <pgman@candle.pha.pa.us>
  1 sibling, 1 reply; 5+ messages in thread

From: Barry Lind @ 2001-01-24 19:27 UTC (permalink / raw)
  To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: iand@metamousetrap.com, PostgreSQL jdbc list <pgsql-jdbc@postgresql.org>

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



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Re: [INTERFACES] BIT type still not working
@ 2001-01-25 17:07  Peter T Mount <peter@retep.org.uk>
  parent: Bruce Momjian <pgman@candle.pha.pa.us>
  1 sibling, 0 replies; 5+ messages in thread

From: Peter T Mount @ 2001-01-25 17:07 UTC (permalink / raw)
  To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: iand@metamousetrap.com, PostgreSQL jdbc list <pgsql-jdbc@postgresql.org>

Quoting Bruce Momjian <pgman@candle.pha.pa.us>:

> 
> Anyone want to address this?

Added to the top of the list for Saturday. After looking at it, there's a 
couple of bits in the code I'm a bit suspicious of (with Boolean's).

Peter

> 
> [ 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
> 



-- 
Peter Mount peter@retep.org.uk
PostgreSQL JDBC Driver: http://www.retep.org.uk/postgres/
RetepPDF PDF library for Java: http://www.retep.org.uk/pdf/



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2001-01-25 17:07 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-01-11 01:11 BIT type still not working Ian deSouza <iand@metamousetrap.com>
2001-01-24 14:56 ` Bruce Momjian <pgman@candle.pha.pa.us>
2001-01-24 19:27   ` Barry Lind <barry@xythos.com>
2001-01-24 19:15     ` Bruce Momjian <pgman@candle.pha.pa.us>
2001-01-25 17:07   ` Peter T Mount <peter@retep.org.uk>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox