Re: Exception? - Mailing list pgsql-jdbc

From Dave Cramer
Subject Re: Exception?
Date
Msg-id 00d601c17c61$6fda3d50$8201a8c0@inspiron
Whole thread Raw
In response to Exception?  (Thomas Møller Andersen <tma@tmaonline.dk>)
List pgsql-jdbc
Thomas,

I just tried this with the latest version of the jdbc driver, and
postgres 7.1.3 without any problems.

What versions are you running

Dave

-----Original Message-----
From: pgsql-jdbc-owner@postgresql.org
[mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Thomas Møller
Andersen
Sent: Monday, December 03, 2001 1:35 PM
To: pgsql-jdbc@postgresql.org
Subject: [JDBC] Exception?


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;
}


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)



pgsql-jdbc by date:

Previous
From: "Dave Cramer"
Date:
Subject: Re: Bad Integer
Next
From: Barry Lind
Date:
Subject: Re: Encoding weirdness with JDBC, driver crashing?