you can use
object obj = rs.getObject("CUST_TRAN_COUNT"); if (obj != null) { rs.getInt("CUST_TRAN_COUNT"); }
but in some cases (very rarely) you cannot call getInt as soon as you called getObject, in which case you can simply use
int.parse(obj.toString())
Also, I think the best way to do this,
int value = rs.getInt("CUST_TRAN_COUNT"); boolean nullValue = rs.wasNull();
so if db returned null, the value will be 0, but nullValue will be true, so you can do the necessary
Low flying pelican
source share