CONNECT

Core command OPEN CONN CON

CONNECT <id> opens a connection to a database defined in the Connections Definition File. CONNECT API <api>:<environment> establishes an active API session context instead - the API and environment RUN and SHOW ENDPOINTS use when none is repeated on the command line. The two contexts are entirely independent: connecting to an API never closes or replaces the current database connection, and connecting to a database never clears an active API context. The prompt shows both when both are active, for example $CDF [API DESK:PROD]>. Use DISCONNECT API to clear only the API context.

Arguments

a valid connection ID (mandatory); or API <api>:<environment> to establish an API session context

Examples

CONNECT db01; CONNECT API DESK_DEFINITION:PROD;

Notes

Opens a connection to a database: CONNECT <id>.

id is mandatory and must be a connection defined in the Connections Definition File (CDF) - the command fails otherwise. The connection is tested first; if the test fails, the command reports the failure and the current connection is left untouched.

On success, any currently open connection is closed automatically before the new one is opened, and the prompt changes to reflect the new connection. Unless connecting to the CDF itself, the session is added to the query log file if logging is enabled by default. SHOW DBINFO and SHOW AUTOCOMMIT are run automatically afterwards to summarize the new connection.

If the connection's database type has no JDBC driver class available on the classpath, the test fails with a clear error naming the missing driver class rather than a raw exception. Copy the matching driver .jar file into the drivers/ or lib/ folder and restart BroadSQL, then try again.

Last modified in release 5.2.3.