| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| mehboob alam Beginner
 
 
 Joined: 13 May 2006
 Posts: 2
 Topics: 1
 
 
 | 
			
				|  Posted: Sat May 13, 2006 5:57 am    Post subject: DB2 connection in COBOL |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| CZerfas Intermediate
 
 
 Joined: 31 Jan 2003
 Posts: 211
 Topics: 8
 
 
 | 
			
				|  Posted: Sat May 13, 2006 6:47 am    Post subject: |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| mehboob alam Beginner
 
 
 Joined: 13 May 2006
 Posts: 2
 Topics: 1
 
 
 | 
			
				|  Posted: Sat May 13, 2006 7:33 am    Post subject: |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| CZerfas Intermediate
 
 
 Joined: 31 Jan 2003
 Posts: 211
 Topics: 8
 
 
 | 
			
				|  Posted: Mon May 15, 2006 2:37 am    Post subject: |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| CZerfas Intermediate
 
 
 Joined: 31 Jan 2003
 Posts: 211
 Topics: 8
 
 
 | 
			
				|  Posted: Mon May 15, 2006 3:02 am    Post subject: |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| acevedo Beginner
 
  
 Joined: 03 Dec 2002
 Posts: 127
 Topics: 0
 Location: Europe
 
 | 
			
				|  Posted: Mon May 15, 2006 4:14 am    Post subject: |   |  
				| 
 |  
				| Also read about PACKAGEs/PLANs concepts... |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  | 
	
		|  |