From: | redhatdude at gmail(dot)com (Caleb Land) |
---|---|
To: | |
Subject: | [Pljava-dev] Returning a complex type with potential null parameters |
Date: | 2006-04-20 21:47:51 |
Message-ID: | bd544b2d0604201447s71d89938i975b20175c48614f@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pljava-dev |
Hello,
I'm trying to write a PL/Java function that can take null parameters and
returns a complex type. However I'm having trouble doing this. My method
looks like:
public static boolean getProductPricing(Integer productId,
Integer priceLevelId,
String locationCode,
ResultSet receiver) throws
SQLException {
receiver.updateDouble(1, 0d);
receiver.updateDouble(2, 1d);
receiver.updateString(3, "Hello World");
return true;
}
And my postgresql declaration looks like:
CREATE OR REPLACE FUNCTION ds_get_product_pricing(int4, int4, varchar)
RETURNS ds_product_pricing
AS 'postgresql.Products.getProductPricing(java.lang.Integer,
java.lang.Integer,
java.lang.String,
java.sql.ResultSet)' LANGUAGE
java;
However when I try to execute a query I get the error:
ERROR: No java type mapping installed for "java.sql.ResultSet"
If I change my java signature to use primitive types, and I remove the
"alternative" explicit mapping in the postgresql declaration, it works fine,
but then I cannot pass null values in.
Is it possible to return a complex type with non-primitive argument types
with PL/Java?
--
Caleb Land
(RedHatDude at gmail.com)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20060420/68662866/attachment.html>
From | Date | Subject | |
---|---|---|---|
Next Message | Thomas Hallgren | 2006-04-20 21:53:05 | [Pljava-dev] Returning a complex type with potential null parameters |
Previous Message | Marek Lewczuk | 2006-04-20 05:59:38 | [Pljava-dev] [SPAM] =\?utf\-8\?B\?UmU6IFJlOiBbU1BBTV0gUmU6IFBsamF2YVwtZGV2IERpZ2VzdCwgVm9sIDI2LCBJc3N1ZSA4\?= |