Figure 7 4 DB2 CLI activities
The Example 7 46 shows the implementation of the task defined by the figure.
Example 7 46 DB2 CLI application, connecting to database
#include /* Include DB2 CLI variable and function definition */
int main()
{
SQLRETURN ret = SQL_SUCCESS;
int rc = 0;
SQLHANDLE henv; /* environment handle */
SQLHANDLE hdbc; /* connection handle */
/* Allocate an environment handle */
ret = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &henv);
if (ret != SQL_SUCCESS)
{
/* handle error */
return 1;
}
/* Allocate a connection handle */
202
MySQL to DB2 UDB Conversion Guide
footer
Our partners:
PHP: Hypertext Preprocessor Cheap Web Hosting
JSP Web Hosting
Ontario Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Java Hosting
Cheapest Hosting
Visionwebhosting.net Business web hosting division of Vision Web Hosting Inc.. All rights reserved