Re: What do people use for connection pooling with PostgreSQL JDBC - Mailing list pgsql-jdbc

From Hannu Krosing
Subject Re: What do people use for connection pooling with PostgreSQL JDBC
Date
Msg-id 1239093322.7647.9.camel@huvostro
Whole thread Raw
In response to Re: What do people use for connection pooling with PostgreSQL JDBC  (Dave Cramer <pg@fastcrypt.com>)
Responses Re: What do people use for connection pooling with PostgreSQL JDBC
List pgsql-jdbc
On Mon, 2009-04-06 at 07:43 -0400, Dave Cramer wrote:
> huh ? What makes you think it doesn't deal with arrays ?

I have a sample function, whit takes an array argument

CREATE OR REPLACE FUNCTION arraySum(
    multiplier bigint,
    valuelist bigint[],
    OUT result int
) AS
$$
BEGIN
    result = 0;
    FOR idx IN array_lower(valuelist, 1)..array_upper(valuelist, 1) LOOP
        result = result + multiplier * valuelist[idx];
    END LOOP;
    RETURN;
END;
$$ LANGUAGE plpgsql SECURITY DEFINER;


When I call this function directly via JDBC or using proxool I get a
result, when doing it via c3p0 or dbcp I get an exception -

   Long[] array = { 1L, 2L };
   PreparedStatement ps = conn.prepareStatement(
    "SELECT * FROM arraySum(?, ?)");
   ps.setLong(1, 3L);
   ps.setArray(2, conn.createArrayOf("bigint", array));
   ps.execute();


--
Hannu Krosing   http://www.2ndQuadrant.com
PostgreSQL Scalability and Availability
   Services, Consulting and Training


pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: What do people use for connection pooling with PostgreSQL JDBC
Next
From: Dave Cramer
Date:
Subject: Re: What do people use for connection pooling with PostgreSQL JDBC