Re: JDBC CallableStatement bug on functions with return parameter - Mailing list pgsql-jdbc

From John LH
Subject Re: JDBC CallableStatement bug on functions with return parameter
Date
Msg-id 4D4D791B.30704@aquafold.com
Whole thread Raw
In response to Re: JDBC CallableStatement bug on functions with return parameter  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: JDBC CallableStatement bug on functions with return parameter  (Lew <noone@lewscanon.com>)
List 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 by date:

Previous
From: Radosław Smogura
Date:
Subject: Re: ssl connection strangely stops working
Next
From: "Kevin Grittner"
Date:
Subject: Re: JDBC CallableStatement bug on functions with return parameter