while (resultSet.next())
{
  id = resultSet.getInt("id");
  amount = resultSet.getBigDecimal("amount");
  if (resultSet.wasNull())
    System.out.println("id: " + id + ", amount is null");
  else
    System.out.println("id: " + id + ", amount: " + amount);
}