The explicit connection
When you use the CONNECT statement to connect to a database environment, you establish an explicit connection.
The application connects directly to the database server that you specify. If you do not specify the name of a database server in the CONNECT statement, the application establishes an explicit connection to the default database server (that the ONEDB_SERVER environment variable identifies).
An explicit connection enables an application to support multiple connections to one or more database environments. Although the application can connect to several database environments during its execution, only one connection can be current at a time. Dormant connections are connections that the application has established but is not currently using. The application must have a current connection to execute SQL statements.
- The CONNECT statement establishes an explicit connection between a database environment and the application.
- The SET CONNECTION statement switches between explicit connections. It makes a dormant connection the current connection.
- The DISCONNECT statement terminates a connection to a database environment.
- Compliance with ANSI and X/Open standards for database connections
- A uniform syntax for local and remote data access for use in a distributed client-server environment
- Support for multiple connections within a single application
- At run time, if you have set the DBANSIWARN environment variable
- At compile time, if you have compiled the source file with the -ansi preprocessor option