Overriding the system-default database parameters

About this task

The database server obtains values for the database parameters from the database-information descriptor. The database server initializes the database-information descriptor with the system-default database parameters in System-default database parameters. You can initialize your own database-information descriptor to override the default database parameters. When you override system-default database parameters, you enable your application to have database information that is independent of the client/server environment in which it runs.

To override the system-default database parameters:

Procedure

  1. Allocate a database-information descriptor.
  2. Fill the fields of the database-information descriptor with the default database parameters you need.

    If you do not set a particular field, the database server uses the system-default value in System-default database parameters for the associated database parameter.

  3. Pass a pointer to this database-information descriptor to the mi_set_default_database_info() function.

Results

The user-defined database parameters provide database information for all connections made within a client LIBMI application after these functions execute (unless the functions are called again to set new default values).

You can obtain existing default database parameters with the mi_get_default_database_info() function. This function populates a user-defined database-information descriptor with the current default database parameters.

Server only: In a C UDR, mi_get_default_database_info() obtains the same information as mi_get_database_info(). The mi_set_default_database_info() function is ignored.