View previous topic :: View next topic
|
Author |
Message |
lvrajesh
New User
Joined: 14 Dec 2010 Posts: 3 Location: Chennai
|
|
|
|
Hello,
Scenario: User gives the key fields thru web. On receiving the key values, cobol Stored procedure will read the desired DB2 table and pass on the desired field values back to the web-screen. There will be more than one result row to be displayed in the screen.
User will make some changes to the fields of each row in the web-screen and this values should be received by cobol stored procedure and post the updates back into the table.
Planning to have 2 SP's for the above but I like to know how to receive the updated multiple rows from the web-screen to second SP.
Appreciate all your suggestions. |
|
Back to top |
|
|
ajeshrn
New User
Joined: 25 Mar 2009 Posts: 78 Location: India
|
|
|
|
Hello lvrajesh,
I understood your question this way, please correct me if I am wrong.
You have a web application which interacts with COBOL stored procedure. The screen passes values to the procedure , after which the procedure processes the record and passes the value back to the web application.
Are you trying to send the results back to the screen as resultset or are you sending them back through output parameters? |
|
Back to top |
|
|
lvrajesh
New User
Joined: 14 Dec 2010 Posts: 3 Location: Chennai
|
|
|
|
Hi Ajesh,
Java interface (web screen) need to pass the set of records (which has some fields modified by user) to COBOL Stored Procedure. In Cobol program validations will be done and the changes will be updated to the appropriate table in the database.
I like to know the logic of retrieving the multiple records from the java interface in COBOL SP.
PS:I work on the COBOL programming part.
Appreciate your inputs!
Regards |
|
Back to top |
|
|
bhairon singh rathore
New User
Joined: 19 Jun 2008 Posts: 91 Location: banglore
|
|
|
|
Return a result set to frontend ( Java) thru DB2 stored proc. |
|
Back to top |
|
|
lvrajesh
New User
Joined: 14 Dec 2010 Posts: 3 Location: Chennai
|
|
|
|
bhairon singh rathore wrote: |
Return a result set to frontend ( Java) thru DB2 stored proc. |
Thanks for the reply. But guess you haven't got my question. I'm looking at receiving multiple records from fronend(Java) to Cobol Stored Procedure.
To make things clear to all, I paraphrase my requirement again:
1) User gives the key fields thru front-end(Java).
On receiving the key values, cobol SP-1 will read the DB2 table and pass on
the resulting records back to the web-screen. There will be more than
one result row(anticipating it to be in hundreds) to be displayed in the
front-end(Java) screen.
I am clear on coding the above part. No questions there.
2) Of the returned records in the front-end(Java) screen, user will be able to
make changes to couple of fields in each record. So we are looking at
receiving back the records from front-end screen with the user changes in
Cobol SP-2 and make the changes in the database.
Query here is how we need to design to receive multiple records from front-
end(Java) screen in Cobol SP-2.
Hope I have given my query clearly. Appreciate your thoughts & inputs!
Regards. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Why multiple records? Every updated record should trigger a database
update. |
|
Back to top |
|
|
bhairon singh rathore
New User
Joined: 19 Jun 2008 Posts: 91 Location: banglore
|
|
|
|
Hi,
I think you would be sending one set of record at a time....So SP could be called every time you are editing and making the changes in database....I am not sure how would you edit multiple record at a time.... |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
bhairon singh rathore wrote: |
Hi,
I think you would be sending one set of record at a time....So SP could be called every time you are editing and making the changes in database....I am not sure how would you edit multiple record at a time.... |
Thanks for your support. |
|
Back to top |
|
|
bhairon singh rathore
New User
Joined: 19 Jun 2008 Posts: 91 Location: banglore
|
|
|
|
Hi Peter,
I didn't refresh my screen before sending the reply...so reply was duplicated....anyways if system has some time lag for updating record and huge number of records, changes could be written into file and batch process can update the records simultaneously...
Just a optional option to go forward |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
bhairon singh rathore wrote: |
Hi Peter,
I didn't refresh my screen before sending the reply...so reply was duplicated....anyways if system has some time lag for updating record and huge number of records, changes could be written into file and batch process can update the records simultaneously...
Just a optional option to go forward |
Thats a nice idea, i myself was thinking about multi threading. Like 1 thread for changing and another thread to do the update. |
|
Back to top |
|
|
ajeshrn
New User
Joined: 25 Mar 2009 Posts: 78 Location: India
|
|
|
|
So rajesh, I believeyou would be sending multiple records tothe java screen, where it gets modified, now you want to get that data back from Java (the modified data).
If this is what you are looking for, please try having an input parameter as CLOB for your SP. Now Java should build a string with all the inputs and send you as a continouos stream.
For example:
The data u send to Java is
Code: |
ABCD
EFGH
HIJK
LMNO
|
Java edits the second row as STPR
they should be sending the value as
to your CLOB input parameter.
Now you have to split them in your COBOL DB2 stored procedure and iterate it and update the table.
I am not sure if we can use this if the record size is huge, and not sure it this will work if yuu are sending 1000's of record to Java and expecting the same back from them.[/code] |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
It's a usual scenario when you write a COBOL-DB2 SP, isn't it? Have you any other DB2-SP at your shop from where you can take a reference about it, that'd be the best - if that's not an option, suggest you look in to the chapter 9 here: Getting Started with DB2 Stored Procedures. |
|
Back to top |
|
|
|