Database pathThe database path, by default, is the server directory for client/server applications, or the application directory for non-server applications. To set a different database path, when the database is being created, just insert the appropriate path as the third parameter in ctdbCreateDatabase(). With this information stored in the Session dictionary, the user doesn't need to know where it is located, since it will be automatically retrieved given the database name (ctdbConnect()). Once the database is successfully connect to a session, the database path can be obtained by calling ctdbGetDatabasePath(). /* display database properties */ void DisplayDatabaseProperties(CTHANDLE hDatabase) {
printf(“Database: %s\n”, ctdbGetDatabaseName(hDatabase)); printf( “Path: %s\n”, ctdbGetDatabasePath(hDatabase)); printf(“Number of tables: %d\n”, ctdbGetTableCount(hDatabase)); } |
|||