FAQ
Problem:
If try to use field of type "java.sql.Types.BIT" obtains error "Unknown
Types Value"

Resolution:

Add this:

PreparedStatement.java
460,461d459
< case Types.BIT:
< set(parameterIndex,
((Boolean)x).booleanValue() ? "true" : "false");


Jose A. Matute Calvo
Daratel, S.L.
Zaragoza - Spain.

Search Discussions

  • Joseph Shraibman at Jan 17, 2001 at 3:45 pm

    "José Antonio Matute Calvo" wrote:

    Problem:
    If try to use field of type "java.sql.Types.BIT" obtains error "Unknown
    Types Value"

    Resolution:

    Add this:

    PreparedStatement.java
    460,461d459
    < case Types.BIT:
    < set(parameterIndex,
    ((Boolean)x).booleanValue() ? "true" : "false");
    Why not set(parameterIndex,x.toString())?


    --
    Joseph Shraibman
    jks@selectacast.net
    Increase signal to noise ratio. http://www.targabot.com
  • Bruce Momjian at Jan 24, 2001 at 2:19 pm
    Is this a bug? Can someone submit a patch?


    [ Charset ISO-8859-1 unsupported, converting... ]
    "Jos? Antonio Matute Calvo" wrote:
    Problem:
    If try to use field of type "java.sql.Types.BIT" obtains error "Unknown
    Types Value"

    Resolution:

    Add this:

    PreparedStatement.java
    460,461d459
    < case Types.BIT:
    < set(parameterIndex,
    ((Boolean)x).booleanValue() ? "true" : "false");
    Why not set(parameterIndex,x.toString())?


    --
    Joseph Shraibman
    jks@selectacast.net
    Increase signal to noise ratio. http://www.targabot.com

    --
    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 T Mount at Jan 25, 2001 at 1:26 pm

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


    Is this a bug? Can someone submit a patch?
    Why not setBoolean(parameterIndex,((Boolean)x),booleanValue());

    Also, unless it's changed postgres accepts 't' & 'f' not 'true' or 'false'?

    Also, which PreparedStatement.java are we taking about, as there are 2 of them?

    Peter

    [ Charset ISO-8859-1 unsupported, converting... ]
    "Jos? Antonio Matute Calvo" wrote:
    Problem:
    If try to use field of type "java.sql.Types.BIT" obtains error
    "Unknown
    Types Value"

    Resolution:

    Add this:

    PreparedStatement.java
    460,461d459
    < case Types.BIT:
    < set(parameterIndex,
    ((Boolean)x).booleanValue() ? "true" : "false");
    Why not set(parameterIndex,x.toString())?


    --
    Joseph Shraibman
    jks@selectacast.net
    Increase signal to noise ratio. http://www.targabot.com

    --
    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/
  • Bruce Momjian at Jan 25, 2001 at 3:32 am
    Seems the BIT type works in Java 7.1 beta now.

    [ Charset ISO-8859-1 unsupported, converting... ]
    "Jos? Antonio Matute Calvo" wrote:
    Problem:
    If try to use field of type "java.sql.Types.BIT" obtains error "Unknown
    Types Value"

    Resolution:

    Add this:

    PreparedStatement.java
    460,461d459
    < case Types.BIT:
    < set(parameterIndex,
    ((Boolean)x).booleanValue() ? "true" : "false");
    Why not set(parameterIndex,x.toString())?


    --
    Joseph Shraibman
    jks@selectacast.net
    Increase signal to noise ratio. http://www.targabot.com

    --
    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 T Mount at Jan 26, 2001 at 9:26 am

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


    Seems the BIT type works in Java 7.1 beta now.
    Has anything changed with boolean types in the backend then, as nothing has
    been done on the JDBC side?
    [ Charset ISO-8859-1 unsupported, converting... ]
    "Jos? Antonio Matute Calvo" wrote:
    Problem:
    If try to use field of type "java.sql.Types.BIT" obtains error
    "Unknown
    Types Value"

    Resolution:

    Add this:

    PreparedStatement.java
    460,461d459
    < case Types.BIT:
    < set(parameterIndex,
    ((Boolean)x).booleanValue() ? "true" : "false");
    Why not set(parameterIndex,x.toString())?


    --
    Joseph Shraibman
    jks@selectacast.net
    Increase signal to noise ratio. http://www.targabot.com

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-bugs @
categoriespostgresql
postedJan 11, '01 at 4:30a
activeJan 26, '01 at 9:26a
posts6
users4
websitepostgresql.org
irc#postgresql

People

Translate

site design / logo © 2021 Grokbase