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
- Allocate a database-information descriptor.
- 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.
- 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.