My sqlserver table has a column designed as a BIT datatype. It has values 1 and 0s
Then in my Java code, I do
result = new ArrayList
result.add( (Boolean)(rs.getBoolean("columnName")));
Then when I read the value from the list - it shows as Long
.
According to everything I find, it says hat a BIT
datatype is supposed to map to boolean
.
Why does it come as Long
?
What can be done to fix this?
You can call
getBoolean
directly and let it take care of all the casting/coverting: