Data types

From: Vicente Alabau Gonzalvo <vicente(dot)alabau-gonzalvo(at)cgey(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Data types
Date: 2003-01-31 11:59:18
Message-ID: 3E3A6516.6010407@capgemini.es
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hello,

I'm trying to retireve some data from this table:

create table types (_numeric_ numeric);

_numeric_
-----------
10
(1 row)

usgin jdbc in this way:

If I try to do this query:
String query = "SELECT * FROM types";
I can get it as BigDecimal and gives me no problems.

But with this other:

String query = "SELECT * FROM types WHERE _numeric_=? ";
pStmt = con.prepareStatement(query);
pStmt.setBigDecimal(1, 10);

and java gives this exception:

java.sql.SQLException: ERROR: Unable to identify an operator
'=' for types 'numeric' and 'double precision'

I think it's because jdbc matches BigDecimals with 'double precision'
but I want to match them with 'numeric' instead.

Is there any way to do this match? How can I solve this problem?
Thanks

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Chris Smith 2003-01-31 16:40:02 Patch - Streaming of PreparedStatement/setInputStream
Previous Message Dave Cramer 2003-01-31 00:45:47 Re: JDBC 3.0 Compliance