The mi_get_default_connection_info() function

The mi_get_default_connection_info() function populates a connection-information descriptor with the default connection parameters.

Syntax

mi_integer mi_get_default_connection_info(conn_info)
   MI_CONNECTION_INFO *conn_info;
conn_info
A pointer to a user-allocated connection-information descriptor in which to store the default connection parameters.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_get_default_connection_info() function retrieves default connection parameters into the connection-information descriptor (MI_CONNECTION_INFO structure) that conn_info references. The connection parameters include the name of the database server and a GLS locale.

Server only: In a C UDR, the GLS locale in the default connection parameters refers to the server locale.
Client only: In a client LIBMI application, the GLS locale in the default connection parameters refers to the database locale.

For more information about GLS locales, see the HCL OneDB™ GLS User's Guide.

You can pass the conn_info descriptor to mi_server_connect() to specify the default connection parameters for a connection.
Tip: You must allocate this connection-information descriptor before you call mi_get_default_connection_info().

If no default value exists for a particular field, the mi_get_default_connection_info() function sets string fields to a NULL-valued pointer and integer fields to 0.

When mi_get_default_connection_info() is the first DataBlade® API function in a client LIBMI application or a user-defined routine, it also initializes the DataBlade API.

Server only: In a C UDR, the mi_get_default_connection_info() function returns the same information as the mi_get_connection_info() function.
Client only: In a client LIBMI application, you can set the connection parameters with the mi_set_default_connection_info() function.

For a description of the connection-information descriptor, more information about how to use the connection-information descriptor, or more information about ways to interact with the session environment, see the HCL OneDB DataBlade API Programmer's Guide.

Return values

MI_OK
The function was successful.
MI_ERROR
The function was not successful.