I have a column in Oracle db table
ACTIONFLAG NUMBER(19)
I need to retrieve this column from resultset and pass it in a
java bean field of
String dataType.
class Bean {
String actionFlag;
public setActionFlag(String af) {
...
}
}
From what I understand, ideally we should retrieve NUMBER columns using rs.getBigDecimal(),but i need to store the retrieved value in a String.
Which would be a better approach from a performance point of view.
1) bean.setActionFlag(rs.getString("ACTIONFLAG"))
or
2) bean.setActionFlaag(rs.getBigDecimal("ACTIONFLAG").setScale(0).toString());
Im using setScale(0) to remove decimal point because getBigDecimal returns 12.00 for a value 12 in table which i dont want. The column shall never hv any value with a decimal
or should i follow any other approach