Bug #845: JDBC driver have a problem with floating-point numbers

Поиск
Список
Период
Сортировка
От pgsql-bugs@postgresql.org
Тема Bug #845: JDBC driver have a problem with floating-point numbers
Дата
Msg-id 20021211112531.A8F1E475B8F@postgresql.org
обсуждение исходный текст
Список pgsql-bugs
Maxim A. Karavaev (Maxim.Karavaev@arete.de) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
JDBC driver have a problem with floating-point numbers

Long Description
I found a problem for defining a floating-point numbers in PreparedStatement class. I use a method setBigDecimal() and
itchange a type of SQL parameter value in dependence with the argument value. 

For example:
I create a table with a numeric attribute type.
   CREATE TABLE test (name varchar(63), test_num numeric(16,3));
Prepare a statement like:
   PreparedStatement ps=con.prepareStatement("SELECT * FROM test WHERE test_num > ?");
Next the two test with a different results:
1. ps.setBigDecimal(1, new BigDecimal("1"); - passed
2. ps.setBigDecimal(1, new BigDecimal("1.0"); - failed with an exception: "ERROR:  Unable to identify an operator '>'
fortypes 'numeric' and 'double precision' You will have to retype this query using an explicit cast"! 

I use JDBC drivers version 7.2. The same result with the version 7.3.
I try the same test for oracle database and without any problem.

Please, can you help me? What I have made incorrectly?

Sample Code


No file was uploaded with this report

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Bug #844: initdb fails on an ext2/3 fs mounted on /var/lib/pgsql/data
Следующее
От: Stéphane Aubry
Дата:
Сообщение: bug jdbc 7.2 ?