473,385 Members | 2,069 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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.

Apr 11 '07 #1
4 4362
aa******@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
Apr 11 '07 #2
On Apr 12, 1:31 am, Knut Stolze <sto...@de.ibm.comwrote:
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.

Apr 12 '07 #3
aa******@yahoo.com.au wrote:
On Apr 12, 1:31 am, Knut Stolze <sto...@de.ibm.comwrote:
>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
Apr 12 '07 #4
On Apr 13, 12:05 am, Serge Rielau <srie...@ca.ibm.comwrote:
aaron...@yahoo.com.au wrote:
On Apr 12, 1:31 am, Knut Stolze <sto...@de.ibm.comwrote:
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

Apr 13 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tommie Nygren | last post by:
For different reasons I am reading an array of bytes from a file in my ..jar-file and from this I want to create a PNG image using Image.createImage(myArray, 0 , myArray.length). I had a...
10
by: Ole | last post by:
Goodday everybody, i want to create an array that represents data, that has to be transferred to a pdf doc ( iTextSharp ). The problem is, that i seem too loose my faith. Namely, ( i have...
7
by: Oleg Konovalov | last post by:
Hi, I am trying to pass a bunch of checked checkboxes (Javascript array) from page1 to the Java action class on subsequent web page (page2). (on page 1 I have a bunch of DB rows with a checkbox,...
24
by: RyanTaylor | last post by:
I have a final coming up later this week in my beginning Java class and my prof has decided to give us possible Javascript code we may have to write. Problem is, we didn't really cover JS and what...
1
by: phjones | last post by:
This is not a class project.The program below is to display mortgage interest paid for each payment over the term of the loan and loan balance.It is program using array. However, I am receiving the...
5
by: Stephen3776 | last post by:
I am doing an inventory control progam and trying to output a multiple array, I am getting an illegal conversion error java.lang.double !d. Can somebody tell me what I am doing wrong or if there is...
3
sammyboy78
by: sammyboy78 | last post by:
I'm trying to display an array of objects using a GUI. My instructions are that the CD class and it's sublcass don't need to change I just need to modify class CDInventory to include the GUI. I'm not...
1
by: MimiMi | last post by:
I'm trying to decrypt a byte array in java that was encrypted in C#. I don't get any error messages, just a result that's completely not what I was hoping for. I think I am using the same type of...
2
by: MimiMi | last post by:
I'm trying to decrypt a byte array in java that was encrypted in C#. I don't get any error messages, just a result that's completely not what I was hoping for. I think I am using the same type of...
5
by: benyboy | last post by:
hi, after hours of staring at my computer screen, and browsing through various internet forums i am totally stuck! I have created the following array which reads from an input file the following...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.