List of usage examples for org.springframework.jdbc.support.rowset SqlRowSet getBigDecimal
BigDecimal getBigDecimal(String columnLabel) throws InvalidResultSetAccessException;
From source file:com.hygenics.parser.getDAOTemplate.java
/** * Called when needing a count of distincts or other numerical result. * Returns an Big Integer so only an integer should be used * /*from w ww . j a va 2s . co m*/ * @param sql * @param columns * @return */ public BigDecimal queryForBigInt(String sql) { SqlRowSet rs = this.jdbcTemplateObject.queryForRowSet(sql); if (rs.next()) { if (rs.getMetaData().getColumnNames().length > 0) { return rs.getBigDecimal(1); } } return new BigDecimal(0); }