Re: Exception?

From: "Dave Cramer" <Dave(at)micro-automation(dot)net>
To: <tma(at)tmaonline(dot)dk>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Exception?
Date: 2001-12-04 01:17:26
Message-ID: 00d601c17c61$6fda3d50$8201a8c0@inspiron
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)postgresql(dot)org
[mailto:pgsql-jdbc-owner(at)postgresql(dot)org] On Behalf Of Thomas Møller
Andersen
Sent: Monday, December 03, 2001 1:35 PM
To: pgsql-jdbc(at)postgresql(dot)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(at)postgresql(dot)org)

In response to

  • Exception? at 2001-12-03 18:34:52 from Thomas Møller Andersen

Browse pgsql-jdbc by date

  From Date Subject
Next Message Barry Lind 2001-12-04 03:51:16 Re: Encoding weirdness with JDBC, driver crashing?
Previous Message Dave Cramer 2001-12-04 00:47:02 Re: Bad Integer