db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "sin(EaTing)," <uss...@gmail.com>
Subject Re: How to return an array of String in a Java routine?
Date Tue, 03 Jun 2008 08:29:11 GMT
Thanks Rick!

On Mon, Jun 2, 2008 at 8:51 PM, Rick Hillegas <Richard.Hillegas@sun.com>
wrote:

> Hello,
>
> As you note, Derby does not support Array types. If you need to return a
> collection from a SQL routine, the following may help:
>
> 1) Transform the collection into a ResultSet. As Knut points out, you have
> two options here:
>
>  a) Write a table function.
>  b) Write a ResultSet-returning procedure
>
> 2) Alternatively, you can serialize your String[] into a byte array. This
> solution will work any time you need to use SQL routines to pass arbitrary
> objects. The return type of your function would be VARCHAR FOR BIT DATA or
> LONG VARCHAR FOR BIT DATA. That is, you would declare your function like
> this:
>
>  create function MyFunction( ... )
>  returns varchar( 32672) for bit data ...
>
> Hope this helps,
> -Rick
>
>
> sin(EaTing), wrote:
>
>> Thanks.
>>
>> I may use String[] in the implement of the Java Routine, but I don't know
>> how to declare the routine. It seems Java Routine in Derby does not support
>> Array types as IN or OUT parameters?
>>
>>
>

Mime
View raw message