Does anyone have an explanation to the following exception:
Unable to identify an operator '>=' for types 'numeric' and 'float8 You will
have to retype this query using an explicit cast
The column is: numeric(10,2)
The query is from this method:
private Collection selectInRange(BigDecimal low, BigDecimal high) throws
SQLException
{
String selectStatement =
"select id from mytable " +
"where amount between ? and ?";
PreparedStatement prepStmt = con.prepareStatement(selectStatement);
prepStmt.setBigDecimal(1, low);
prepStmt.setBigDecimal(2, high);
ResultSet rs = prepStmt.executeQuery();
ArrayList a = new ArrayList();
while (rs.next()) {
String id = rs.getString(1);
a.add(id);
}
prepStmt.close();
return a;
}