Unix Technical Forum

array in db2 using Java

This is a discussion on array in db2 using Java within the DB2 forums, part of the Database Server Software category; --> Hi, Currently I am embarked on a project that requires me to define and pass array to stored procedure, ...


Go Back   Unix Technical Forum > Database Server Software > DB2

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 12:08 PM
aaron80v@yahoo.com.au
 
Posts: n/a
Default array in db2 using Java


Hi,

Currently I am embarked on a project that requires me to define and
pass array to stored procedure, and I found out that there is no
direct way to do this. I wonder if a combination of UDF and java code
should be able to accomplish this. Has anyone accomplish this before?
Maybe someone can share the best way to accomplish this. I am using
DB2 8.1. I am sure someone has done it before, I just need a guideline
how to do this best.


Aaron.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 12:08 PM
Knut Stolze
 
Posts: n/a
Default Re: array in db2 using Java

aaron80v@yahoo.com.au wrote:

>
> Hi,
>
> Currently I am embarked on a project that requires me to define and
> pass array to stored procedure, and I found out that there is no
> direct way to do this. I wonder if a combination of UDF and java code
> should be able to accomplish this. Has anyone accomplish this before?
> Maybe someone can share the best way to accomplish this. I am using
> DB2 8.1. I am sure someone has done it before, I just need a guideline
> how to do this best.


No clue what you really want to do. But you could simply write the data
into a table, call the procedure and the procedure reads from the table.
The table can be a temp table.

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 12:08 PM
aaron80v@yahoo.com.au
 
Posts: n/a
Default Re: array in db2 using Java

On Apr 12, 1:31 am, Knut Stolze <sto...@de.ibm.com> wrote:
> aaron...@yahoo.com.au wrote:
>
> > Hi,

>
> > Currently I am embarked on a project that requires me to define and
> > pass array to stored procedure, and I found out that there is no
> > direct way to do this. I wonder if a combination of UDF and java code
> > should be able to accomplish this. Has anyone accomplish this before?
> > Maybe someone can share the best way to accomplish this. I am using
> > DB2 8.1. I am sure someone has done it before, I just need a guideline
> > how to do this best.

>
> No clue what you really want to do. But you could simply write the data
> into a table, call the procedure and the procedure reads from the table.
> The table can be a temp table.
>
> --
> Knut Stolze
> DB2 z/OS Utilities Development
> IBM Germany


My intention is simple. The workaround using temp table is not an
option. What I need is to be able to define an array in Java, get the
resultset and store it in array and pass this array on to stored
procedure. Isn't there any JDBC side API catered for this? I have been
doing varray (Oracle) all the while and would like to mimic the same
functionality in DB2. We have Java folks but we are not totally
familiar with DB2. So any guide will be appreciated.

Aaron.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-27-2008, 12:09 PM
Serge Rielau
 
Posts: n/a
Default Re: array in db2 using Java

aaron80v@yahoo.com.au wrote:
> On Apr 12, 1:31 am, Knut Stolze <sto...@de.ibm.com> wrote:
>> aaron...@yahoo.com.au wrote:
>>
>>> Hi,
>>> Currently I am embarked on a project that requires me to define and
>>> pass array to stored procedure, and I found out that there is no
>>> direct way to do this. I wonder if a combination of UDF and java code
>>> should be able to accomplish this. Has anyone accomplish this before?
>>> Maybe someone can share the best way to accomplish this. I am using
>>> DB2 8.1. I am sure someone has done it before, I just need a guideline
>>> how to do this best.

>> No clue what you really want to do. But you could simply write the data
>> into a table, call the procedure and the procedure reads from the table.
>> The table can be a temp table.
>>
>> --
>> Knut Stolze
>> DB2 z/OS Utilities Development
>> IBM Germany

>
> My intention is simple. The workaround using temp table is not an
> option. What I need is to be able to define an array in Java, get the
> resultset and store it in array and pass this array on to stored
> procedure. Isn't there any JDBC side API catered for this? I have been
> doing varray (Oracle) all the while and would like to mimic the same
> functionality in DB2. We have Java folks but we are not totally
> familiar with DB2. So any guide will be appreciated.
>
> Aaron.
>

Aaron, did you get may email?

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-27-2008, 12:09 PM
aaron80v@yahoo.com.au
 
Posts: n/a
Default Re: array in db2 using Java

On Apr 13, 12:05 am, Serge Rielau <srie...@ca.ibm.com> wrote:
> aaron...@yahoo.com.au wrote:
> > On Apr 12, 1:31 am, Knut Stolze <sto...@de.ibm.com> wrote:
> >> aaron...@yahoo.com.au wrote:

>
> >>> Hi,
> >>> Currently I am embarked on a project that requires me to define and
> >>> pass array to stored procedure, and I found out that there is no
> >>> direct way to do this. I wonder if a combination of UDF and java code
> >>> should be able to accomplish this. Has anyone accomplish this before?
> >>> Maybe someone can share the best way to accomplish this. I am using
> >>> DB2 8.1. I am sure someone has done it before, I just need a guideline
> >>> how to do this best.
> >> No clue what you really want to do. But you could simply write the data
> >> into a table, call the procedure and the procedure reads from the table.
> >> The table can be a temp table.

>
> >> --
> >> Knut Stolze
> >> DB2 z/OS Utilities Development
> >> IBM Germany

>
> > My intention is simple. The workaround using temp table is not an
> > option. What I need is to be able to define an array in Java, get the
> > resultset and store it in array and pass this array on to stored
> > procedure. Isn't there any JDBC side API catered for this? I have been
> > doing varray (Oracle) all the while and would like to mimic the same
> > functionality in DB2. We have Java folks but we are not totally
> > familiar with DB2. So any guide will be appreciated.

>
> > Aaron.

>
> Aaron, did you get may email?
>
> Cheers
> Serge
>
> --
> Serge Rielau
> DB2 Solutions Development
> IBM Toronto Lab


Yes I did. Thanks.

Aaron

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:32 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com