Re: URGENT HELP NEEDED. CALLING STORED PROCEDURES USING JDBC

From: MILTOS MILTIADOUS <mmiltiadous0(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: URGENT HELP NEEDED. CALLING STORED PROCEDURES USING JDBC
Date: 2009-12-21 22:43:03
Message-ID: 27420669-7160-4ee8-aab1-49ba3311a158@y24g2000yqb.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

HELLO EVERYONE.
I AM TRYING A COUPLE DAYS KNOW TO CALL A STORED PROCEDURE USING JDBC
THAT RETURNS A SETOF ROWTYPE (USER DEFINED).
I HAVE TO NOTE THAT THE SPECIFIC PROCEDURE IS RUNNING PERFECT IN
PGADMIN III.
PARTICULARLY, I HAVE A PL/PGSQL FUNCTION (NOT PROCEDURE) OF THE
FOLLOWING TYPE:

CREATE OR REPLACE FUNCTION <NAME> (INPUT PARAMETERS) RETURNS SETOF
<USER DEFINED TYPE> AS $$

USING JDBC METHODS STATEMENT OR PREPARESTATEMENT TO EXECUTE THE
FUNCTION ON A SERVER ENVIRONMENT (RESTLET STYLE-WEB SERVER) I RECEIVE
BACK AN HTTP POST STATUS 200 OK WITHOUT ENTITY RESULT.
THE CURRENT FUNCTION (THAT IS QUITE BIG) MAKES ALL THE AVAILABLE
INSERTATIONS ON THE DB BUT IS NOT RETURNING ANYTHING.
NOTE THAT VARIOUS FUNCTIONS ARE KEPT IN AN XML DOCUMENT AND ACCORDING
USER URIS THE APPROPIATE FUNCTIONS ARE SELECTED FOR FURTHER PROCESS.
I IMAGINE THE PROBLEM HAS TO DO WITH THE CORRECT SYNTAX OF THE
SPECIFIED FUNCTION. I AM USING THE FOLLOWING SYNTAX:

String Query = "SELECT * FROM <MY_FUNCTION(IN PARAMETERS);

I EVEN TRIED THE FOLLOWING SYNTAX:

String Query = "SELECT <OUT PARAMETERS NAMES> FROM <MY_FUNCTION(IN
PARAMETERS);

ALSO,

TRIED TO CAST OUT PARAMETERS TO DEFINED DATA TYPES,

FUNCTIONS INPUT PARAMETERS PASSED THROUGH HTTP POST PARAMETER BODY
AND USING STRINGTEMPLATE I STORED THE WHOLE FUNCTION IN A TEMPLATE. SO
I AM USING AN ALTERNATIVE WAY TO PASS THE INPUT PARAMETERS DATA TYPE
AND VALUES THROUGH THE TEMPLATE INSTEAD USING PREPARESTATEMENT METHOD
(???? ETC).

THANK U.

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Craig Ringer 2009-12-22 02:41:38 Re: URGENT HELP NEEDED. CALLING STORED PROCEDURES USING JDBC
Previous Message Віталій Тимчишин 2009-12-21 15:56:04 Re: Cheapest way to poll for notifications? & Driver improvement question re SSL and notify