I am getting some value from DB to do some kind of padding operation on it. But before that padding I need to check whether that value is null or not.
someObject.setValue(rs.getInt(6)); // where this value in DB is of type Number (31,5)
private long dBValue = someObject.getValue();
if(dBValue == null || dBValue.equals(null))
System.out.println("Padding space on it");
dBValue = (String)dBValue+"";
// some more logic
When I am trying to check the value as null its giving compile time error. If I am converting the Long value to String to check the value its throwing NumberFormatException and NullPointerException in differenct scenarios.
Please help me in this.
I am looking for a solution where I will be able to check that long value as null.