final Map<String, Currency> dataMap = new HashMap<String, Currency>();
getJdbcOperations().query(sql, new Object[]{Status.ENABLED}, new RowCallbackHandler(){
@Override
public void processRow(ResultSet rs) throws SQLException {
Currency currency = new Currency();
currency.setId(rs.getInt("currency_id"));
currency.setCode(rs.getString("code"));
currency.setTitle(rs.getString("title"));
currency.setSymbolLeft(rs.getString("symbol_left"));
currency.setSymbolRight(rs.getString("symbol_right"));
try{
currency.setDecimalPlace(rs.getInt("decimal_place"));
}catch(Exception e){
e.printStackTrace();
}
currency.setValue(rs.getBigDecimal("value"));
if(currency.getValue().intValue()==1){
CurrencyServiceImpl.this.defaultCurrencyCode = currency.getCode();
}
dataMap.put(currency.getCode(), currency);
if(autoUpdate){
long lastModified = rs.getTimestamp("date_modified").getTime();
long current = new Date().getTime();
long diff = ((current-lastModified)/(3600*1000));
if(diff>whenDiff){