Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4356

JDBC Connection sharing between java and cobol

$
0
0

Hello,

I have the following java code :

Connection connection = null;
try {

    /* DB2 */
    Class.forName("com.ibm.db2.jcc.DB2Driver");
    connection = DriverManager.getConnection ("jdbc:db2://db2server:50000/mycooldb2

}
catch (ClassNotFoundException e) {
    e.printStackTrace();
}
catch (SQLException e) {
    e.printStackTrace();
}

RunUnit runUnit = new RunUnit();
XVsd138l vsd138L = (XVsd138l) runUnit.GetInstance(XVsd138l.class);

vsd138l.XVsd138l(sl_ext_uebergabe, sextuebergabe, sl_uebergabevsdl18l, suebergabevsdl18l);

XVsd138L is a Cobol Program as Bytecode with ILSMARTLINKAGE. It does some SELECTS from "mycooldb2" and returns the values. I would like to use the database connection that has been established with java. The Documentation speaks about using "DB2 BIND CONNECTION" inside COBOL. But I have no clue what to do in java in order to get this working.

Some Code examples would be great

Kind regards

Michael


Viewing all articles
Browse latest Browse all 4356

Trending Articles