Hi,

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?

Table example:

CREATE TABLE unsigned_test (
id INT PRIMARY KEY,
value UNSIGNED INT

)

In this case, I want to set a value from java to "value" table variable and get it after that.

The SqlAnywhere version I've been using is 12.0.1 EBF 3605.

asked 08 May '12, 10:32

marcelopaparelli's gravatar image

marcelopapar...
61348
accept rate: 0%


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).

permanent link

answered 08 May '12, 11:40

Andy%20Quick's gravatar image

Andy Quick
2.2k2737
accept rate: 45%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×75
×64

question asked: 08 May '12, 10:32

question was seen: 2,139 times

last updated: 08 May '12, 11:40