ABAP Keyword Documentation → ABAP - Reference → Processing External Data → ABAP - Database Accesses → ADBC - ABAP Database Connectivity
CL_SQL_CONNECTION - Database Connections
The SQL statements that are represented by objects of the CL_SQL_STATEMENT and CL_SQL_PREPARED_STATEMENT classes work by default with the central database of the AS ABAP. Using ADBC it is possible to open additional connections to other database systems, as is supported for Native SQL. The following class is available for this purpose:
- CL_SQL_CONNECTION
The GET_CONNECTION method of this class can be passed a connection name from the column DBCON. The method
attempts to open the corresponding connection and, if successful, it creates an instance on CL_SQL_CONNECTION
and returns the corresponding reference. Instances of CL_SQL_CONNECTION that are created with CREATE OBJECT
represent the standard connection to the central database.
References to instances of CL_SQL_CONNECTION can be passed to the CON_REF parameter of the instance constructor of CL_SQL_STATEMENT or CL_SQL_PREPARED_STATEMENT. The instances created in this way execute their SQL statements on the database whose connection is represented by the instance of CL_SQL_CONNECTION.
The instance method CLOSE of CL_SQL_CONNECTION closes a database connection. The instance can no longer be used after this and statements that are already linked with the connection become invalid. CLOSE has no effect in instances that represent the standard connection.
The CL_SQL_CONNECTION class has further methods for handling a connection. This includes opening and closing:
Other versions: 7.31 | 7.40 | 7.54
Note
The possible connections of an AS ABAP to database systems are stored in database table DBCON. You can create and change entries in database table DBCON using the DBA Cockpit tool.