The application requester can implicitly connect to an application server.
Implicit connection occurs when the application requester detects the first SQL statement issued for the activation group and it is not a CONNECT statement with parameters.
For a distributed program, the implicit connection is made to the relational database specified on the RDB parameter. For a nondistributed program, the implicit connection is made to the local relational database.
Implicit disconnection can occur at the following parts of a process:
If the job level commitment definition is active and not at a unit of work boundary then SQL is placed in the exited state.
The following example program is not distributed (no connection is required). It is a program run at a Spiffy Corporation regional office to gather local repair information into a report.
CRTSQLxxx PGM(SPIFFY/FIXTOTAL) COMMIT(*CHG) RDB(*NONE)
PROC: FIXTOTAL;
.
.
.
SELECT * INTO :SERVICE A
FROM REPAIRTOT;
EXEC SQL
COMMIT;
.
.
.
END FIXTOTAL;
Another program, such as the following example, can gather the same information from Spiffy dealerships in the Kansas City region. This is an example of a distributed program that is implicitly connected and disconnected:
CRTSQLxxx PGM(SPIFFY/FIXES) COMMIT(*CHG) RDB(KC101) RDBCNNMTH(*RUW) PROC: FIXES; . . . EXEC SQL SELECT * INTO :SERVICE B FROM SPIFFY.REPAIR1; EXEC SQL C COMMIT; . . . END FIXES; D