What Is DB Link?
DB Link gives you a simple yet powerful interface to one or more RDBMSs. Its API (Application Programming Interface) is independent of both the platform and the RDBMS. This applies at several levels:
-
With regard to the RDBMS APIs: The DB Link API hides all the proprietary, RDBMS-specific API calls, as well as RDBMS-specific call sequencing. Using one single call, you can have your SQL statement executed.
-
With regard to platforms and compilers: Your code can be used to communicate with different RDBMSs simultaneously. As DB Link is platform-independent, you do not have to rewrite any code when changing your platform or compiler. The DB Link API is similar to the Call Level Interface (CLI) ISO standard but adapted to the C++ language.
-
With regard to the contents of the SQL statements: Usually, DB Link does not change the contents of the SQL statements you send to the RDBMS. The only exception is for MS SQL Server, which does not support placeholders. The DB Link Library interface lacks the necessary functionality. In fact, most of the time, DB Link does not even read the SQL statements you send. This allows you to send any query you want, but it also means that DB Link does not check whether your SQL code complies with a standard such as SQL92 or the SQL implementation specific to a given RDBMS.
DB Link accepts and processes queries that use RDBMS-specific features, but such queries may cause an error with RDBMSs that lack the specific feature.
There are two ways of using DB Link:
-
If the target RDBMSs are known from the beginning, the application can be linked with the appropriate drivers.
-
If the application does not specify one or more target RDBMSs, it can be linked with the DB Link driver manager, which will dynamically load the appropriate drivers when necessary.






