pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedJDBC support for 8.1 OUT parameters
3+ messages / 2 participants
[nested] [flat]
* JDBC support for 8.1 OUT parameters
@ 2006-03-05 16:26 Adam Zimowski <zimowski74@gmail.com>
2006-03-05 16:46 ` Re: JDBC support for 8.1 OUT parameters Adam Zimowski <zimowski74@gmail.com>
2006-03-06 12:55 ` Re: JDBC support for 8.1 OUT parameters Dave Cramer <pg@fastcrypt.com>
0 siblings, 2 replies; 3+ messages in thread
From: Adam Zimowski @ 2006-03-05 16:26 UTC (permalink / raw)
To: pgsql-jdbc
Hi,
Do you know where I can find Postgres JDBC driver that supports out
parameters? When I call my procedure, I'm getting:
org.postgresql.util.PSQLException: A CallableStatement function was
executed and the return was of type java.sql.Types=1111 however type
java.sql.Types=0 was registered.
I'm pretty sure the driver version I have
(postgresql-8.1-405.jdbc3.jar) supports OUT only on first parameter.
I've looked on the web but did not find anything. I saw a few patches,
but I wasn't sure if they were it.
CREATE OR REPLACE FUNCTION main.p_get_profile_simple(IN _profile_id
int8, OUT _main refcursor, OUT _lookingfor refcursor, OUT _purpose
refcursor) AS
....
CallableStatement stmt = null;
stmt = oCon.prepareCall("{ call main.p_get_profile_simple(?,?,?,?) }");
stmt.setLong(1, aMemberId);
stmt.registerOutParameter(2, Types.REF);
stmt.registerOutParameter(3, Types.REF);
stmt.registerOutParameter(4, Types.REF);
Regards,
Adam
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: JDBC support for 8.1 OUT parameters
2006-03-05 16:26 JDBC support for 8.1 OUT parameters Adam Zimowski <zimowski74@gmail.com>
@ 2006-03-05 16:46 ` Adam Zimowski <zimowski74@gmail.com>
1 sibling, 0 replies; 3+ messages in thread
From: Adam Zimowski @ 2006-03-05 16:46 UTC (permalink / raw)
To: pgsql-jdbc
Just a quick note:
In my code I'm using Types.OTHER. As a troubleshooting step I also
tried Types.REF. The PostgreSQL version I'm on is 8.1.0.
CREATE OR REPLACE FUNCTION main.p_get_profile_simple(IN _profile_id
int8, OUT _main refcursor, OUT _lookingfor refcursor, OUT _purpose
refcursor) AS
....
CallableStatement stmt = null;
stmt = oCon.prepareCall("{ call main.p_get_profile_simple(?,?,?,?) }");
stmt.setLong(1, aMemberId);
stmt.registerOutParameter(2, Types.OTHER);
stmt.registerOutParameter(3, Types.OTHER);
stmt.registerOutParameter(4, Types.OTHER);
Regards,
Adam
On 3/5/06, Adam Zimowski <zimowski74@gmail.com> wrote:
> Hi,
>
> Do you know where I can find Postgres JDBC driver that supports out
> parameters? When I call my procedure, I'm getting:
>
> org.postgresql.util.PSQLException: A CallableStatement function was
> executed and the return was of type java.sql.Types=1111 however type
> java.sql.Types=0 was registered.
>
> I'm pretty sure the driver version I have
> (postgresql-8.1-405.jdbc3.jar) supports OUT only on first parameter.
> I've looked on the web but did not find anything. I saw a few patches,
> but I wasn't sure if they were it.
>
> CREATE OR REPLACE FUNCTION main.p_get_profile_simple(IN _profile_id
> int8, OUT _main refcursor, OUT _lookingfor refcursor, OUT _purpose
> refcursor) AS
> ....
>
> CallableStatement stmt = null;
> stmt = oCon.prepareCall("{ call main.p_get_profile_simple(?,?,?,?) }");
> stmt.setLong(1, aMemberId);
> stmt.registerOutParameter(2, Types.REF);
> stmt.registerOutParameter(3, Types.REF);
> stmt.registerOutParameter(4, Types.REF);
>
> Regards,
> Adam
>
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: JDBC support for 8.1 OUT parameters
2006-03-05 16:26 JDBC support for 8.1 OUT parameters Adam Zimowski <zimowski74@gmail.com>
@ 2006-03-06 12:55 ` Dave Cramer <pg@fastcrypt.com>
1 sibling, 0 replies; 3+ messages in thread
From: Dave Cramer @ 2006-03-06 12:55 UTC (permalink / raw)
To: Adam Zimowski <zimowski74@gmail.com>; +Cc: pgsql-jdbc
Adam,
No the driver supports out parameters. Have a look at the test code
in the source.
Dave
On 5-Mar-06, at 11:26 AM, Adam Zimowski wrote:
> Hi,
>
> Do you know where I can find Postgres JDBC driver that supports out
> parameters? When I call my procedure, I'm getting:
>
> org.postgresql.util.PSQLException: A CallableStatement function was
> executed and the return was of type java.sql.Types=1111 however type
> java.sql.Types=0 was registered.
>
> I'm pretty sure the driver version I have
> (postgresql-8.1-405.jdbc3.jar) supports OUT only on first parameter.
> I've looked on the web but did not find anything. I saw a few patches,
> but I wasn't sure if they were it.
>
> CREATE OR REPLACE FUNCTION main.p_get_profile_simple(IN _profile_id
> int8, OUT _main refcursor, OUT _lookingfor refcursor, OUT _purpose
> refcursor) AS
> ....
>
> CallableStatement stmt = null;
> stmt = oCon.prepareCall("{ call main.p_get_profile_simple
> (?,?,?,?) }");
> stmt.setLong(1, aMemberId);
> stmt.registerOutParameter(2, Types.REF);
> stmt.registerOutParameter(3, Types.REF);
> stmt.registerOutParameter(4, Types.REF);
>
> Regards,
> Adam
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2006-03-06 12:55 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-03-05 16:26 JDBC support for 8.1 OUT parameters Adam Zimowski <zimowski74@gmail.com>
2006-03-05 16:46 ` Adam Zimowski <zimowski74@gmail.com>
2006-03-06 12:55 ` Dave Cramer <pg@fastcrypt.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox