informix
INFORMIX-ESQL/C Programmer's Manual
Working with the Database Server

Using ESQL/C Connection Library Functions in a Windows Environment

To establish an explicit connection (sometimes called a direct connection), ESQL/C supports the SQL connection statements. For a complete description of the SQL connection statements, see the Informix Guide to SQL: Syntax. ESQL/C also supports the connection library functions that Figure 12-11 lists for establishing an explicit connection from a Windows environment.

Figure 12-11
ESQL/C Connection Library Functions and Their SQL Equivalents

ESQL/C for Windows Library Function Description SQL Equivalent Page
Reference
GetConnect() Requests an explicit connection and returns a pointer to the connection information CONNECT TO '@dbservername' WITH CONCURRENT TRANSACTION B-88
SetConnect() Switches the connection to an established (dormant) explicit connection SET CONNECT TO
(without the DEFAULT option)
B-358
ReleaseConnect() Closes an established explicit connection DISCONNECT
(without the DEFAULT,
CURRENT, or ALL options)
B-300

Important: ESQL/C supports the connection library functions for backward compatibility with Version 5.01 ESQL/C for Windows applications. When you write new ESQL/C applications for Windows environments, use the SQL connection statements (CONNECT, DISCONNECT, and SET CONNECTION) instead of the ESQL/C connection library functions.

ESQL/C uses an internal structure that contains the handle for the connection and other connection information. The ESQL/C connection library functions use the connection handle, together with the information in the internal structure, to pass connection information to and from the application. The application can use the connection handle to identify an explicit connection.

If you use these connection functions to establish explicit connections, keep the following restrictions in mind:

When you compile your ESQL/C program, the esql command processor automatically links the ESQL/C connection functions to your program. The library functions are located in Appendix B, ESQL/C Function Library.


INFORMIX-ESQL/C Programmer's Manual, Version 9.21
Copyright © 1999, Informix Software, Inc. All rights reserved