Unsigned int datatypes

In this release, Adaptive Server has introduced unsigned bigint, unsigned int, and unsigned smallint as native Adaptive Server datatypes. Because, there are no corresponding unsigned datatypes in Java, you must set and get the next higher integer if you want to process the data correctly. For example, if you are retrieving data from an unsigned int, using the Java datatype int is too small to contain positive large values, and as a result, ResultSet.getInt (int index) might return incorrect data or throw an exception. To process the data correctly, you should get the next higher integer value ResultSet.getLong(). You can use the following table to set or get data.

Adaptive Server datatype

Java datatype

unsigned smallint

setInt(), getInt()

unsigned int

setLong(), getLong()

unsigned bigint

setBigDecimal(), getBigDecimal()