I want to create a table with the column type Long
instead of Integer
. Is it possible?
the INTEGER can store the long but to get long from cursor should do like this :
int type = cursor.getType(j);
String value = cursor.getString(j);
try {
int intValue = Integer.parseInt(value);
field.set(object, intValue);
} catch (NumberFormatException e) {
long longValue = Long.parseLong(value);
field.set(object, longValue);
}
i use this to store timestamp in sqlite