I've been using UltraliteJ for Android and trying to get and set unsigned types - specifically int, long and short - to my table from java. But the problem is that I haven't found any method to do it. Anyone knows if are there any way in UltraliteJ to do it?
CREATE TABLE unsigned_test ( id INT PRIMARY KEY, value UNSIGNED INT
In this case, I want to set a value from java to "
The SqlAnywhere version I've been using is 12.0.1 EBF 3605.
asked 08 May '12, 10:32
You can use PreparedStatement.set(int, long) for setting values for unsigned int columns, or set(int, int) for unsigned short columns. For unsigned bigint columns, there is no Java primitive type that can be used to store values >= 2^63, but you can use set(int, DecimalNumber) for those values. If the value is < 2^63, you can use set(int, long). Depending on where you get the value from, you could also set it as a string with set(int, String).
answered 08 May '12, 11:40