473,289 Members | 1,729 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,289 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 2546

"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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.