Thread: Boolean: DatabaseMetaData.getColumns

Boolean: DatabaseMetaData.getColumns

From
Adrian Frick
Date:
Configuration:
- PostgreSQL 7.4
 - JDBC 7.4 beta3 build 209

Test case:
1. Created a table column of type BOOLEAN
2. Retrieved column metadata using
   - Class:  DatabaseMetaData
   - Method: getColumns
3. Got the following values
   - DATA_TYPE: -7 (java.sql.Types.BIT)
   - TYPE_NAME: bool

Error description:
DATA_TYPE should be 16 (java.sql.Types.BOOLEAN)
instead of -7, wenn TYPE_NAME is 'bool'



__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

Re: Boolean: DatabaseMetaData.getColumns

From
Oliver Jowett
Date:
On Wed, Nov 26, 2003 at 01:01:12AM -0800, Adrian Frick wrote:
> Configuration:
> - PostgreSQL 7.4
>  - JDBC 7.4 beta3 build 209
>
> Test case:
> 1. Created a table column of type BOOLEAN
> 2. Retrieved column metadata using
>    - Class:  DatabaseMetaData
>    - Method: getColumns
> 3. Got the following values
>    - DATA_TYPE: -7 (java.sql.Types.BIT)
>    - TYPE_NAME: bool
>
> Error description:
> DATA_TYPE should be 16 (java.sql.Types.BOOLEAN)
> instead of -7, wenn TYPE_NAME is 'bool'

Types.BOOLEAN is an alias for Types.BIT according to the JDBC spec. Seems
valid to return BIT for a boolean column to me, especially as BOOLEAN isn't
present in earlier JDBC versions.

-O