Connecting to a Database System
Once you have created a session object, you can connect to the database system using the connect member function. This is done in the following way:
if (session->connect()) {
...
}
else
IlvPrint(“Error: %s”, session->getErrorMessage().getMessage());
During the session, you can check whether the session is still connected using the isConnected member function. An example of this is shown in the following code:
if (!session->isConnected())
IlvPrint(“Not connected”);
To end a session, use the disconnect member function. This method rolls back any (uncommitted) work in progress and breaks the communication channel with the database system.
session->disconnect();
Published date: 05/24/2022
Last modified date: 02/24/2022