informix
Informix DataBlade API Programmer's Manual
Establishing a Connection

Initializing the DataBlade API

Before you can use the DataBlade API to communicate with the database server, you must make sure that it is initialized. When you establish a connection, the DataBlade API function automatically initializes the DataBlade API. However, if your DataBlade API module does not establish a connection, it must still ensure that it initializes the DataBlade API.

Important: If the DataBlade API was not initialized, calls to subsequent DataBlade API functions generate errors.

Figure 7-7 lists the functions that can initialize the DataBlade API.

Figure 7-7
DataBlade API Functions That Initialize the DataBlade API

DataBlade API Initialization Function Valid in Client LIBMI Application? Valid in User-Defined Routine?
mi_open() Yes Yes
mi_server_connect() Yes No
mi_init_library() Yes No
mi_register_callback() Yes Yes
mi_sysname() Yes Yes
mi_get_parameter_info() Yes Yes
mi_set_parameter_info() Yes No
mi_get_default_connection_info() Yes Yes
mi_set_default_connection_info() Yes Ignored
mi_get_default_database_info() Yes Yes
mi_set_default_database_info() Yes Ignored
mi_get_next_sysname() Yes No
mi_client_locale() Yes Yes

One of the functions listed in Figure 7-7 must be the first DataBlade API function called in a DataBlade API session. If you do not call one of these functions, the DataBlade API is not initialized and all subsequent DataBlade API calls return error status.


Informix DataBlade API Programmer's Manual, Version 9.2
Copyright © 1999, Informix Software, Inc. All rights reserved