Page 1 of 1

Retrieving a Bit value from a database server side

Posted: 24 May 2011, 14:45
by clouting
Hi,

I am working on a java extension where I am trying to retrieve a bit value from an ms-sql database. When I try to retrieve the value as a Boolean it returns a null.

I can change it to an int in the database and then retrieve it as in int and then do a check to see if it is 1 or 0 but this seems over complicated.

Do I have to cast it as a different type?

Any ideas...?

Cheers

Posted: 26 May 2011, 06:33
by Lapo
Bit is not supported, sorry. You can use Boolean instead or an Int, at least not with the auto-serialization we provide out of the box.
You can always bypass that and work directly with the JDBC connection if you wish. (by grabbing the connection object via getConnection() method)