Kris Jurka wrote on 23.11.2005 19:41:
>> I noticed that table columns that are defined as "bool" (Postgres
>> datatype) are reported as java.sql.Types.BIT through DatabaseMetadata
>> (or ResultSetMetaData).
>>
>> Is there any valid reason why they are not reported as
>> java.sql.Types.BOOLEAN?
>>
>
> Because BOOLEAN is only available to JDBC3. Our driver still supports
> JDBC2 so we use BIT. BOOLEAN and BIT are the same thing as far as we
> can tell.
Makes sense. I knew there was a reason :)
The problem comes when supporting multiple DBMS. With MS SQL Server a
bit column can only store 0/1 (which is not what the driver returns, as
it uses a java.lang.Boolean) but PG only accepts the literals
true/false. That's why I stumbled over this in the first place.
So I'll have to check the native type rather then the JDBC type to be sure.
Regards
Thomas