473,757 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2572

"Raquel" <ra************ ****@yahoo.com> wrote in message
news:9a******** *************** ***@posting.goo gle.com...
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
2050
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 below to quickly design, generate, and deploy a great portion of your real-life N- Tier application. For free evaluation download please visit http://www.alachisoft.com/download.htm
2
2293
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 confusion/issues: I wrote an SQL stored procedure built it and it compiled just fine. I go to the Server View in the Development Center and there it is - fat and happy. Even the object count reflects the difference between what is visible in Control...
7
3255
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 the sample jdbc stored procedures o.k. For the purpose of this test I created a sample procedure that executes "select * from department" when conected to the sample database on the linux box.
0
1394
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 java.lang.String type parameters defined inside the java file get converted to Character(32) type. Is there a way that we can specify that these should be converted to Varchar2(40) instead? Since we import Java Stored Procedures from one DB to another...
2
3605
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, regards, Hubert DB2ADMIN.PROCEDURE2 - Build started. DROP SPECIFIC PROCEDURE DB2ADMIN.SQL030805133228210 DB2ADMIN.PROCEDURE2 - Drop stored procedure completed.
0
1847
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 separate file. if I declare a #sql iterator SpIterat, the Development Center complains the statements #sql updateIterator are not Java ...
1
2158
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 SQL0444N exception occurred. ###################################################################### #### MYDB.EXPORTMSTDATA - Build started. javac -classpath .:/home/db2inst1/sqllib/java/db2java.zip:/home/db2inst1/sqllib/java/ru
1
1810
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 kept getting SQL1131 whenever I tried to prepared a stored procedure. As a result, I completely deleted DB2 and reinstalled version 8 and upgraded to FP8. At that point, I experimented a bit with some of the Environment Settings, particularly the...
0
2358
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 stored procedure, it had given me the following two language options:
0
10069
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9884
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9735
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8736
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7285
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5324
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3395
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2697
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.