Re: Experiences with pl/Java - Mailing list pgsql-general
| From | Thomas |
|---|---|
| Subject | Re: Experiences with pl/Java |
| Date | |
| Msg-id | loom.20121120T200400-734@post.gmane.org Whole thread Raw |
| In response to | Experiences with pl/Java (Thomas Hill <Thomas.K.Hill@t-online.de>) |
| List | pgsql-general |
have tested further combinations - without success - any other idea?
1st attempt (note: this implementation works on Apache Derby!)
===========
CREATE OR REPLACE FUNCTION rte."SP_getNextID"(OUT "iNextID" integer, IN
"vcIDName" character varying)
RETURNS integer LANGUAGE JAVA
EXTERNAL SECURITY DEFINER AS
'onlyPostgreSQLPk.Functions.SP_getNextID(int[], String)'
public static void SP_getNextID(int[] iNextVal, String vcIDName)
throws SQLException {
Connection conn = getDefaultConnection();
// some JDBC code here
return;
}
Select rte."SP_getNextID"('xx');
==> result: FEHLER: To many parameters - expected 1
********** Fehler **********
FEHLER: To many parameters - expected 1
SQL Status:42601
2nd attempt (omitting the signature in the function declaration)
===========
CREATE OR REPLACE FUNCTION rte."SP_getNextID"(OUT "iNextID" int, IN "vcIDName"
character varying)
RETURNS integer LANGUAGE JAVA
EXTERNAL SECURITY DEFINER AS
'onlyPostgreSQLPk.Functions.SP_getNextID'
public static void SP_getNextID(int[] iNextVal, String vcIDName)
throws SQLException {
Connection conn = getDefaultConnection();
// some JDBC code here
return;
}
Select rte."SP_getNextID"('Transaction');
==> result: FEHLER: Unable to find static method
onlyPostgreSQLPk.Functions.SP_getNextID with signature (Ljava/lang/String;)I
********** Fehler **********
FEHLER: Unable to find static method onlyPostgreSQLPk.Functions.SP_getNextID
with signature (Ljava/lang/String;)I
SQL Status:XX000
3rd attempt (using int in the java method declarartion and in function signature)
===========
CREATE OR REPLACE FUNCTION rte."SP_getNextID"(OUT "iNextID" int, IN "vcIDName"
character varying)
RETURNS integer LANGUAGE JAVA
EXTERNAL SECURITY DEFINER AS
'onlyPostgreSQLPk.Functions.SP_getNextID(int, String)'
public static void SP_getNextID(int iNextVal, String vcIDName)
throws SQLException {
Connection conn = getDefaultConnection();
// some JDBC code here
return;
}
Select rte."SP_getNextID"('xx');
==> result: FEHLER: To many parameters - expected 1
********** Fehler **********
FEHLER: To many parameters - expected 1
SQL Status:42601
5th attempt (using java.lang.Integer in the java method declarartion, integer in
function declaration and java.lang.Integer in function signature)
===========
CREATE OR REPLACE FUNCTION rte."SP_getNextID"(OUT "iNextID" integer, IN
"vcIDName" character varying)
RETURNS integer LANGUAGE JAVA
EXTERNAL SECURITY DEFINER AS
'onlyPostgreSQLPk.Functions.SP_getNextID(java.lang.Integer, String)'
public static void SP_getNextID(java.lang.Integer iNextVal, String vcIDName)
throws SQLException {
Connection conn = getDefaultConnection();
// some JDBC code here
return;
}
Select rte."SP_getNextID"('xx');
==> result: FEHLER: To many parameters - expected 1
********** Fehler **********
FEHLER: To many parameters - expected 1
SQL Status:42601
Select rte."SP_getNextID"('xx');
==> result: FEHLER: To many parameters - expected 1
********** Fehler **********
FEHLER: To many parameters - expected 1
SQL Status:42601
pgsql-general by date: