Which is the best approach to connect IBM Mainframe application using Java Connector Architecture (JCA)?
Which is the best approach to connect IBM Mainframe application using Java Connector Architecture (JCA)?
4.7k views Asked by AudioBubble AtThere are 4 answers
DAO Design Pattern approach
Could connect using the DB2 connector db2jcc-db2jcc4.jar
My Connection Factory (excerpt from the Class):
`Class.forName("com.ibm.db2.jcc.DB2Driver");
uniqueConn =
DriverManager.getConnection("jdbc:db2://204.90.115.200:5040/DALLASC", "Zxxxxx", "********");`
Used the IBM zxplore learning platform mainframe - https://www.ibm.com/it-infrastructure/z/education/zxplore. Replace Zxxxxx with your zxplore user id and ******** with your password.
Used 3 packages: dao (Data Access Object), model, ctrl (control)
Classes:
- under model package: Employee class with 4 attibutes: First Name, Last Name, Work Dept and Job (a subset of all colunms from DB2 table IBMUSER.EMP)
- under dao package: ConnFactoryDB2 - a class using the Singleton Design Pattern to connect to the database (main point shared above)
- under dao package: EmployeeDAO class, with only a getList method, containing the code including the "select FIRSTNME, LASTNAME, WORKDEPT, JOB from IBMUSER.EMP"
- under ctrl package: a "test drive" class, putting together the DAO Design Pattern approach used:
- database connection using the ConnFactoryDB2 class;
- database browsing using the combination of the dao.EmployeeDAO and model.Employee
Final result:
run: Starting Employee Display - Sáb 2022.11.12 at 08:22:52 AM BRST Connecting DB DALLASC - IBM Zxplore! 1st Name | Last Name | Dept | Job
CHRISTINE | HAAS | A00 | PRES
MICHAEL | THOMPSON | B01 | MANAGER
SALLY | KWAN | C01 | MANAGER
JOHN | GEYER | E01 | MANAGER
IRVING | STERN | D11 | MANAGER
EVA | PULASKI | D21 | MANAGER
EILEEN | HENDERSON | E11 | MANAGER
THEODORE | SPENSER | E21 | MANAGER
VINCENZO | LUCCHESI | A00 | SALESREP
SEAN | O'CONNELL | A00 | CLERK
DOLORES | QUINTANA | C01 | ANALYST
HEATHER | NICHOLLS | C01 | ANALYST
BRUCE | ADAMSON | D11 | DESIGNER
ELIZABETH | PIANKA | D11 | DESIGNER
MASATOSHI | YOSHIMURA | D11 | DESIGNER
MARILYN | SCOUTTEN | D11 | DESIGNER
JAMES | WALKER | D11 | DESIGNER
DAVID | BROWN | D11 | DESIGNER
WILLIAM | JONES | D11 | DESIGNER
JENNIFER | LUTZ | D11 | DESIGNER
JAMES | JEFFERSON | D21 | CLERK
SALVATORE | MARINO | D21 | CLERK
DANIEL | SMITH | D21 | CLERK
SYBIL | JOHNSON | D21 | CLERK
MARIA | PEREZ | D21 | CLERK
ETHEL | SCHNEIDER | E11 | OPERATOR
JOHN | PARKER | E11 | OPERATOR
PHILIP | SMITH | E11 | OPERATOR
MAUDE | SETRIGHT | E11 | OPERATOR
RAMLAL | MEHTA | E21 | FIELDREP
WING | LEE | E21 | FIELDREP
JASON | GOUNOT | E21 | FIELDREP
DIAN | HEMMINGER | A00 | SALESREP
GREG | ORLANDO | A00 | CLERK
KIM | NATZ | C01 | ANALYST
KIYOSHI | YAMAMOTO | D11 | DESIGNER
REBA | JOHN | D11 | DESIGNER
ROBERT | MONTEVERDE | D21 | CLERK
EILEEN | SCHWARTZ | E11 | OPERATOR
MICHELLE | SPRINGER | E11 | OPERATOR
HELENA | WONG | E21 | FIELDREP
ROY | ALONZO | E21 | FIELDREP
Employees List Completed - Total Employees Listed = 42 Fim do Processamento - Sáb 2022.11.12 at 08:22:54 AM BRST CONSTRUÍDO COM SUCESSO (tempo total: 1 segundo)
You have many options... I've tried them all.
Their CTG product can be a bottleneck and the licensing is ridiculously expensive. I recommend staying away from the Cics Transaction gateway.
You can homebrew a solution using just plain data sockets. We're currently doing this. We developed a standard Java annotation library and a standard COBOL copybook.
Consider mainframe webservices. The XML parsing/marshaling can be ZIIP/ZAAP eligible, so you don't incur those MIPS charges.
You may also consider an ESB like Sonic from progressive software. They offer a product called Shadow that takes the guesswork out of mainframe webservices.
IBM's approach should be pretty good.
Here's an IBM tutorial to get you started: Introduction to the J2EE Connector Architecture