Home | Previous Page | Next Page   Function Descriptions >

mi_get_connection_info( )

The mi_get_connection_info( ) function populates a connection-information descriptor with current connection parameters for an open connection.

Syntax

mi_integer mi_get_connection_info(conn, conn_info)
   MI_CONNECTION *conn;
   MI_CONNECTION_INFO *conn_info;
conn
is a pointer to a connection descriptor established by a previous call to mi_open( ), mi_server_connect( ), or mi_server_reconnect( ).
conn_info
is a pointer to a user-provided connection-information descriptor, to store the current connection parameters.
Valid in Client LIBMI Application? Valid in User-Defined Routine?
Yes Yes

Usage

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;

Tip:
You must allocate this connection-information descriptor before you call mi_get_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.

Global Language Support

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.

End of Global Language Support

Return Values

MI_OK
indicates that the function was successful.
MI_ERROR
indicates that the function was not successful.

Related Topics

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.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]