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