Switch between multiple database connections

The application can make a number of simultaneous database connections with a CONNECT statement. These connections can be to several database environments or can be multiple connections to the same database environment. To switch between connections, the application must follow these steps:
  1. Establish a connection with the CONNECT STATEMENT
  2. Handle any active transactions

    If the current connection has an active transaction, you can switch connections only if the CONNECT statement with the WITH CONCURRENT TRANSACTION clause establishes the current connection.

  3. Make a connection current with the SET CONNECTION or CONNECT statement