mi_integer mi_get_connection_info(conn, conn_info)
MI_CONNECTION *conn;
MI_CONNECTION_INFO *conn_info;
Valid in Client LIBMI Application? | Valid in User-Defined Routine? |
---|---|
Yes | Yes |
The mi_get_connection_info( ) function puts the current connection parameters for the connection that conn references into the descriptor (MI_CONNECTION_INFO structure) that conn_info references. The connection parameters in this structure include the name of the database server, the number of the server port, and a GLS locale:
typedef struct mi_connection_info { char *server_name; /* INFORMIXSERVER */ mi_integer server_port; /* SERVERNUM */ char *locale; /* Processing locale */ mi_integer reserved1; /* unused */ mi_integer reserved2; /* unused */ } MI_CONNECTION_INFO;
You can pass the connection-information descriptor to mi_server_connect( ) to specify the connection parameters for a connection from the client LIBMI application to the database server.
The mi_get_connection_info( ) function initializes the DataBlade API when it is the first DataBlade API function in a client LIBMI application or a C user-defined routine.
The GLS locale in the connection parameters refers to the server locale in a C UDR or to the database locale in a client LIBMI application. For more information about GLS locales, see the IBM Informix: GLS User's Guide.
See also the descriptions of mi_get_connection_user_data( ), mi_get_database_info( ), mi_get_default_connection_info( ), mi_get_parameter_info( ), mi_get_serverenv( ), mi_server_connect( ), and mi_set_default_connection_info( ).
For a description of the connection-information descriptor, more information on how to examine the connection-information descriptor, or more information on ways to interact with the session environment, see the IBM Informix: DataBlade API Programmer's Guide.