Establish an explicit connection in a Windows environment
With an implicit connection, one connection to the database server
can exist for each module
and this connection cannot be shared. An explicit connection allows
multiple connections within a client application. You might want to
design an application that needs to perform multiple connections for
one of the following reasons:
When you want multiple modules
(either .exe or .dll) to
use the same connection to manipulate database data
The scenario on the left requires that APP1.EXE establish
an explicit connection to the dbserverA database server. After
this connection is established, APP1 can pass the connection information
required to set the connection in the APP2 DLL.
The scenario on the right requires that APP3.EXE establish
an explicit connection to the dbserverB database server. Both
the APP4 and APP5 DLLs can share this connection when APP3 passes
the appropriate connection information. Figure 1: Two scenarios in which multiple applications
use a single connection to a database server
You can also use explicit connections if you want one application
to establish connections to two separate database servers at the same
time, as the following shows. Figure 2: One application that uses connections to more than one database
server at the same time