Re: JDBC CallableStatement bug on functions with return parameter

Поиск
Список
Период
Сортировка
От John LH
Тема Re: JDBC CallableStatement bug on functions with return parameter
Дата
Msg-id 4D4D791B.30704@aquafold.com
обсуждение исходный текст
Ответ на Re: JDBC CallableStatement bug on functions with return parameter  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Ответы Re: JDBC CallableStatement bug on functions with return parameter
Список pgsql-jdbc
  Hi,

I create the CallableStatement with this :

callStatement = conn.prepareCall("{ ? = CALL "public"."sales_tax"(?) }");

For the return parameter I use :

callStatement.registerOutParameter(1, java.sql.Types.FLOAT);

For the function parameter I use :

callStatement.setObject(2, new Float(25.25));

After this, the Jdbc4CallableStatement SQL is :

select * from "public"."sales_tax"(null,25.25)  as result

When I callStatement.execute() I get this :

org.postgresql.util.PSQLException: ERROR: function
public.sales_tax(double precision) does not exist

I've also tried the combination and results of ...

===
java.sql.Types.DOUBLE/Double
org.postgresql.util.PSQLException: ERROR: function
public.sales_tax(double precision) does not exist
===
java.sql.Types.NUMERIC/BigDecimal
org.postgresql.util.PSQLException: ERROR: function
public.sales_tax(numeric) does not exist

thanks
-John



On 2/5/2011 7:23 AM, Kevin Grittner wrote:
> John LH  wrote:
>
>> I have a function "sales_tax (in subtotal money) RETURNS money"
>
>> I register the parameters and then execute the statement, but it
>> fails with the error message :
>>
>> ERROR: function public.sales_tax(double precision) does not exist
>
> What class of Java object are you trying to use for the parameter?
>
> -Kevin
>

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

Предыдущее
От: Radosław Smogura
Дата:
Сообщение: Re: ssl connection strangely stops working
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: JDBC CallableStatement bug on functions with return parameter