DB Link
API Reference Guide
Product Documentation:

Visualization DB Link
Documentation Home
Functions
ildconn.h File Reference
#include <ildblink/ild.h>

Functions

IldDbmsIldAllocConnect (const char *dbmsName, const char *connectionStr)
 This function creates and returns a new instance of the class IldDbms, the actual connection to a particular database. More...
 
IldDbmsIldAllocConnect (const char *dbmsName, const char *database, const char *userName, const char *password)
 Allocates the connection with the connection string split into its three components: database URL + user name + password. More...
 
IldDbmsIldNewDbms (const char *dbmsName, const char *connectionStr)
 This inline function creates and returns a new instance of the class IldDbms, the actual connection to a particular database. More...
 
IldDbmsIldNewDbms (const char *dbmsName, const char *database, const char *userName, const char *password)
 Allocate the connection with the connection string split into its three components: database URL + user name + password. More...
 

Detailed Description

Library: dbkernel

Function Documentation

◆ IldAllocConnect() [1/2]

IldDbms* IldAllocConnect ( const char *  dbmsName,
const char *  connectionStr 
)

This function creates and returns a new instance of the class IldDbms, the actual connection to a particular database.

Parameters
dbmsNameIndicates the RDBMS used by your application.
connectionStrUsed to connect an application to a database.

The value of the connection string depends on the RDBMS used. See the readme.htm file, in the standard distribution of the product, for a table of the valid connection string formats. The section "Connection String Format" in the Rogue Wave DB Link User's Manual also explains how to use connection strings.

The dbmsName argument must take one of the following values:

  • "db2"
  • "db29x"
  • "informix"
  • "mysql"
  • "odbc"
  • "oledb"
  • "oracle"
  • "oracle10"
  • "oracle11"
  • "sybase"

The maximum number of simultaneous connections to a database depends on the RDBMS.

This function can raise the following errors:

  • ILD_UNKNOWN_RDBMS. If the argument dbmsName does not designate an RDBMS supported by DB Link, the function returns an instance of IldDbms along with this error. This kind of object is called an "error object"; it is always linked to an error message. A call to the usual member function of the IldDbms class does not work with this error object – because the member functions are inoperative in this case – and raises the error ILD_USING_ERROR_DBMS.
  • ILD_DBMS_FATAL_ERROR indicates a problem at a very low level, for example, with the connection itself. Perhaps the client has not been installed correctly. In other words, if you encounter this error, you should try to troubleshoot the system rather than look for an error in DB Link. Indeed, the error occurred at such a low level that the IldDbms object can no longer be used.
  • ILD_LIB_NLNKD means that the function could not find the driver while the application was statically linked.
  • ILD_MEMORY_EXHAUSTED means that the function encountered a problem when trying to allocate memory.

If the value of the argument connectionStr is invalid for the RDBMS, it causes an error in the RDBMS. Then, the function returns an IldDbms object along with the error message from the RDBMS. The connection cannot be made under such conditions. However, you can use the object again after having reconnected successfully.

You must explicitly close a connection when you no longer need it, either by calling the member function IldDbms::disconnect or by destroying the connection (that is, by deleting the IldDbms object).

See also
"Connection String Format" in the Rogue Wave DB Link User's Manual.

◆ IldAllocConnect() [2/2]

IldDbms* IldAllocConnect ( const char *  dbmsName,
const char *  database,
const char *  userName,
const char *  password 
)

Allocates the connection with the connection string split into its three components: database URL + user name + password.

Parameters
dbmsNameIndicates the RDBMS used.
databaseDatabase URL.
userNameThe username.
passwordThe password.

The database argument can take one of the following forms:

DB2 <database alias>
Informix <database name>[&lt;server>]
MySQL <db>/<host>
Odbc <data source name>
Oledb <database name>/<server name>
Oracle &lt;service>
Sybase <database name>/<server name>

The Oracle <service> may be:

  • An entry name as can be found in the file ORACLE_HOME/network/admin.tnsnames.ora. This is not possible if using Oracle Instant Client
  • The network identification of the instance: //myhost:port/myinstance
  • An Oracle Net descriptor, for exemple: (DESCRIPTION=(ADDRESS= (PROTOCOL=TCP)(HOST=myhost)(PORT=1521)) (CONNECT_DATA=(SERVICE_NAME=myinstance)))

◆ IldNewDbms() [1/2]

IldDbms* IldNewDbms ( const char *  dbmsName,
const char *  connectionStr 
)

This inline function creates and returns a new instance of the class IldDbms, the actual connection to a particular database.

Parameters
dbmsNameIndicates the RDBMS used by your application. *
connectionStrUsed to connect an application to a database. The value of the connection string depends on the RDBMS used.

The dbmsName argument must take one of the following values:

  • "db2"
  • "db29x"
  • "informix"
  • "mysql"
  • "odbc"
  • "oledb"
  • "oracle"
  • "oracle10"
  • "oracle11"
  • "sybase"
Note
This inline function is deprecated. You should use the function IldAllocConnect.
See also
IldAllocConnect

◆ IldNewDbms() [2/2]

IldDbms* IldNewDbms ( const char *  dbmsName,
const char *  database,
const char *  userName,
const char *  password 
)

Allocate the connection with the connection string split into its three components: database URL + user name + password.

Parameters
dbmsNameIndicates the RDBMS used (see the description above).
databaseDatabase URL.
userNameThe username.
passwordThe password.

The database argument can take one of the following forms:

DB2 <database alias>
Informix *lt;database name>[&lt;server>
MySQL <db>/<host>
Odbc <data source name>
Oledb <database name>/<server name>
Oracle &lt;service>
Sybase <database name>/<server name>

The Oracle <service> may be:

  • An entry name as can be found in the file ORACLE_HOME/network/admin.tnsnames.ora. This is not possible if using Oracle Instant Client
  • The network identification of the instance: //myhost:port/myinstance
  • An Oracle Net descriptor, for exemple: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=myhost)(PORT=1521)) (CONNECT_DATA=(SERVICE_NAME=myinstance)))
Note
This inline function is deprecated. You should prefer using the function IldAllocConnect.
See also
IldAllocConnect