Database parameters

To indicate which database it needs to connect to, the client LIBMI application uses database parameters. The DataBlade® API provides a database-information descriptor, MI_DATABASE_INFO, to access database parameters. This data type structure identifies the database for a particular session.

Unlike most DataBlade API structures, the database-information descriptor is not an opaque C data structure. To access database information, you must allocate a database-information descriptor and directly access its fields. The following table shows the fields in the database-information descriptor.
Table 1. Fields in the database-information descriptor
Field Data type Description
database_name char * The name of the database
user_name char * The user account name, as defined by the operating system
password char * The account password, as defined by the operating system

The milib.h header file defines the MI_DATABASE_INFO structure.

With the database-information descriptor, you can use the following DataBlade API functions to perform the database-parameter tasks.
Database-parameter task DataBlade API function
Access the default database parameters to determine the database and user for the connection mi_set_default_database_info(), mi_get_default_database_info()
Obtain current database parameters for an open connection mi_get_database_info()