Establishing a connection to the DB2 Everyplace database

This task is part of the main task of Encrypting local data. After you have complete these steps, return to Overview of local data encryption.

Procedure

Any interaction with the DB2 Everyplace database requires a connection to be established. In addition, in order for a user to access or create encrypted tables, the application must connect to DB2 Everyplace with non-empty user ID and password, using the following CLI function:

 rc = SQLConnect(hdbc, "C:\temp\", SQL_NTS, "user1", SQL_NTS, "pwd1", SQL_NTS)

where "C:\temp\" is the directory of the database that the application is connect to, using the user ID "user1" and the password "pwd1".

For a JDBC interface, a database connection can be established similarly.

Související koncepce