Product Documentation

c-treeDB API for Java

Previous Topic

Next Topic

Done

When an application and/or process has completed operations with the database, it must release resources by closing the open files and disconnecting from the database engine.

Below is the code for Done():

//

// Done()

//

// This function handles the housekeeping of closing, freeing,

// disconnecting and logging out of the database

//

static void Done() throws IOException {

System.out.println("DONE");

try {

// close table

System.out.println("\tClose table...");

MyTable.Close();

// logout

System.out.println("\tLogout...");

MySession.Logoff();

// This section is only needed for the AppServer DLL model.

// Stop the AppServer DatabaseEngine

boolean AppServerModel = true;

if (AppServerModel) {

CTSession.StopDatabaseEngine();

}

} catch (CTException E) {

Handle_Exception(E);

}

}

TOCIndex