473,395 Members | 1,468 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,395 software developers and data experts.

DB2 Development Center: Java stored procedure question ....

Have a question on the Stored procedure method code generated by DB2
development center for Java stored procedures.

Suppose I have a requirement to return the resultset consisting of
FIRSTNME, LASTNAME of all employees belonging to a particular
department, following is the stored procedure method code generated by
"DB2 development center":

public static void sproc3mtd ( String workdept,
String[] firstnme,
String[] lastname,
String[] errorlabel,
ResultSet[] rs1 ) throws Exception

In reality, only the following method would have sufficed:

public static void sproc3mtd ( String workdept,
String[] errorlabel,
ResultSet[] rs1 ) throws Exception

This is because FIRSTNME and LASTNAME are generated in the resultset
itself and so, no explicity declaration for them needs to be done in
the stored procedure method.

Does anyone know why DB2 development center generates this redundant
code?

Thanks.
Raquel.
Nov 12 '05 #1
1 2550

"Raquel" <ra****************@yahoo.com> wrote in message
news:9a**************************@posting.google.c om...
Have a question on the Stored procedure method code generated by DB2
development center for Java stored procedures.

Suppose I have a requirement to return the resultset consisting of
FIRSTNME, LASTNAME of all employees belonging to a particular
department, following is the stored procedure method code generated by
"DB2 development center":

public static void sproc3mtd ( String workdept,
String[] firstnme,
String[] lastname,
String[] errorlabel,
ResultSet[] rs1 ) throws Exception

In reality, only the following method would have sufficed:

public static void sproc3mtd ( String workdept,
String[] errorlabel,
ResultSet[] rs1 ) throws Exception

This is because FIRSTNME and LASTNAME are generated in the resultset
itself and so, no explicity declaration for them needs to be done in
the stored procedure method.

Does anyone know why DB2 development center generates this redundant
code?

I haven't used the Development Center yet so this is just a guess; however,
assuming that the Development Center is similar to the Stored Procedure
Builder in earlier versions of DB2, it is probably because you've specified
firstname and lastname in the query that you entered in the wizard. You can
prove this by creating a few more simple stored procedures and see if every
column specified in the query that is specified in the wizard appears in the
parameter list for your method.

If I'm right, you can prevent the unwanted column names from being generated
in the parameter list by revising the query so that firstnme and lastname
columns are not mentioned in the query. I don't know if that's possible in
your particular case; if it isn't possible, you should be able to delete the
extra column names from the parameter list manually after the stored
procedure is generated. I do major edits of the stored procedure code all
the time in the Stored Procedure Builder without problems: if you change the
parameters, the Builder will ask whether you want to replace the original
version of the procedure or create a new one; you just click the appropriate
button and the Builder does the rest.

Rhino
Nov 12 '05 #2

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

Similar topics

0
by: M.sajjad | last post by:
Five Steps to Rapid Development with TierDeveloper 3.0 Unlock the power of rapid development when you use TierDeveloper from AlachiSoft in your N-Tier application development. Follow the steps...
2
by: Anthony Robinson | last post by:
I'm used to working with the old reliable Stored Procedure Builder in Version 7. You created a project and made your database connection - just like version 8. Here's where I am running into...
7
by: Alex | last post by:
Hi all, I am trying to install a java stored procedure via the windows development centre. The linux box is running 8.1 FP4 as is the windoze platform. If I am on the linux box i can install...
0
by: Sumit Gupta | last post by:
We are developing Java Stored Procedures using DB2 Development Center v8. While importing a stored procedure (.java file) from one database to another using the Development Center, all the...
2
by: hubert_s | last post by:
I have DB2 8.1 FP7, when I try to build a Java stored procedure it fails during a call to DB2_REPLACE_JAR. Even the build folder "bld1096553970703" is not there - it has a different name, ...
0
by: eric | last post by:
Hi, I would like to build the inParams SQLJ sample procedure from the Development Center. if I declare a #sql public iterator SpIterat, the Development Center complains this should be in a...
1
by: blackpzh | last post by:
We moved our DB from one AIX to another AIX by using backup/restore, ...it’s a long story..., then when we buid a java stored procedure in development center, we got following message, and a...
1
by: Henry Reardon | last post by:
I have been having problems with the Development Center for several days now. It seemed to be working fine when I initially installed DB2 (LUW) Version 8 (FP7) and upgraded to FP8, except that I...
0
by: Springflower | last post by:
Hi, I am new to using DB2 Development Center. I had downloaded the trial version(8.2) of latest DB2 UDB and want to write a stored procedure in COBOL. When I chose the oprion the wrting a new...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.