MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DB2 connection in COBOL

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
mehboob alam
Beginner


Joined: 13 May 2006
Posts: 2
Topics: 1

PostPosted: Sat May 13, 2006 5:57 am    Post subject: DB2 connection in COBOL Reply with quote

Hi

If we take programming language like C or JAVA we establish explicit connection to database

How/When does connection to database establishes when we are execute a DB2-cobol application.
Back to top
View user's profile Send private message
CZerfas
Intermediate


Joined: 31 Jan 2003
Posts: 211
Topics: 8

PostPosted: Sat May 13, 2006 6:47 am    Post subject: Reply with quote

Guessing you are talking about Batch execution, you start program IKJEFT01 (TSO) and issue a RUN PROGRAM command. This is explained in the Application Programming Guide of DB2.

regards
Christian
Back to top
View user's profile Send private message
mehboob alam
Beginner


Joined: 13 May 2006
Posts: 2
Topics: 1

PostPosted: Sat May 13, 2006 7:33 am    Post subject: Reply with quote

Hi Christian

What i want exactly is

If i am coding in C and using CLI/ODBC i would use sqlconnect() or SQLDriverConnect() etc function

If i am using JAVA i ll register the Driver to use with DriverManager class and then use a Connection object ( DriverManager.getConnection(...........)) to establish connection to the database.

Similarly while we run a Batch cobol program (ofcourse using IKJEFT01 and then RUN program) when and how does teh connection to database get established.

Do you mean to say IKJEFT01 takes care of it. If so how does it take place when we use CICS-COBOL program
Back to top
View user's profile Send private message
CZerfas
Intermediate


Joined: 31 Jan 2003
Posts: 211
Topics: 8

PostPosted: Mon May 15, 2006 2:37 am    Post subject: Reply with quote

In TSO Batch you start the connection to DB2 by issuing the command "DB2 SYSTEM(xxxx)". The RUN command issued after that is then directed to the correct DB2 subsystem.

In CICS you have to establish the DB2 connection by defining an object DB2C (command thread). In this definition you name the desired DB2 subsystem you want to connect to. That means: from one CICS region you can connect only to one DB2 subsystem.
After that you define CICS objects DB2T (transactions) and DB2E (entries) to name the DB2 plans you want to use with your various transactions.

This mechanism is explained in detail in the DB2 Administration Guide (look for CICS connection).

regards
Christian
Back to top
View user's profile Send private message
CZerfas
Intermediate


Joined: 31 Jan 2003
Posts: 211
Topics: 8

PostPosted: Mon May 15, 2006 3:02 am    Post subject: Reply with quote

The TSO command to connect to a DB2 subsystem is "DSN SYSTEM(xxxx)" with xxxx as the name of your subsystem.

Sorry
Christian
Back to top
View user's profile Send private message
acevedo
Beginner


Joined: 03 Dec 2002
Posts: 127
Topics: 0
Location: Europe

PostPosted: Mon May 15, 2006 4:14 am    Post subject: Reply with quote

Also read about PACKAGEs/PLANs concepts...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group