Skip to main content

Where Are All the Other SQL Connectios?

  • March 14, 2024
  • 2 replies
  • 0 views

I inherited a substantial application written in Micro Focus COBOL.  I need to make changes to the way the connection strings are used.  I sniffed through the code - and found 22 (!) with CONNECT USING statements.  The application contains hundreds of programs, each compiled and deployed individually, with a handful of EXEC SQL statements - and as far as I can tell every one of them has no problem getting to the database.  How are all the other programs connecting?

2 replies

Chris Glazier
Forum|alt.badge.img+2
  • Moderator
  • 3697 replies
  • March 15, 2024

I inherited a substantial application written in Micro Focus COBOL.  I need to make changes to the way the connection strings are used.  I sniffed through the code - and found 22 (!) with CONNECT USING statements.  The application contains hundreds of programs, each compiled and deployed individually, with a handful of EXEC SQL statements - and as far as I can tell every one of them has no problem getting to the database.  How are all the other programs connecting?

What SQL preprocessor are you using to precompile your code, OpenESQL (ODBC) or Oracle ProCOBOL?

Once a connection is made then it stays in effect until it is disconnected. So if program1 does a CONNECT and then calls program2, program2 does not have to do a CONNECT.
There are also implicit connection methods available:

     OpenESQL lusing SQL compiler directives, INIT, DB and PASS.
     ProCOBOL using option AUTO_CONNECT


  • 0 replies
  • March 15, 2024

What SQL preprocessor are you using to precompile your code, OpenESQL (ODBC) or Oracle ProCOBOL?

Once a connection is made then it stays in effect until it is disconnected. So if program1 does a CONNECT and then calls program2, program2 does not have to do a CONNECT.
There are also implicit connection methods available:

     OpenESQL lusing SQL compiler directives, INIT, DB and PASS.
     ProCOBOL using option AUTO_CONNECT

in the ESODBCXA which executes as part of the startup of the application I spotted another CONNECT - that must be what establishes the connection