agora inbox for pljava-dev@postgresql.org
help / color / mirror / Atom feedSubject: [Pljava-dev] Returning a complex type with potential null parameters
Date: Thu, 20 Apr 2006 17:47:51 -0400
Message-ID: <bd544b2d0604201447s71d89938i975b20175c48614f@mail.gmail.com> (raw)
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;
view thread (2+ messages) latest in thread
Message-ID: <bd544b2d0604201447s71d89938i975b20175c48614f@mail.gmail.com>
Permalink: ../bd544b2d0604201447s71d89938i975b20175c48614f@mail.gmail.com/
Also on: postgresql.org/message-id/bd544b2d0604201447s71d89938i975b20175c48614f@mail.gmail.com
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pljava-dev@postgresql.org
Subject: Re: [Pljava-dev] Returning a complex type with potential null parameters
In-Reply-To: <bd544b2d0604201447s71d89938i975b20175c48614f@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox