#include <ildblink/ild.h>
Functions | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
Library: dbkernel
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.
dbmsName | Indicates the RDBMS used by your application. |
connectionStr | Used 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:
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).
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.
dbmsName | Indicates the RDBMS used. |
database | Database URL. |
userName | The username. |
password | The password. |
The database argument can take one of the following forms:
DB2 | <database alias> |
Informix | <database name>[<server>] |
MySQL | <db>/<host> |
Odbc | <data source name> |
Oledb | <database name>/<server name> |
Oracle | <service> |
Sybase | <database name>/<server name> |
The Oracle <service> may be:
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.
dbmsName | Indicates the RDBMS used by your application. * |
connectionStr | Used 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:
IldAllocConnect
. 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.
dbmsName | Indicates the RDBMS used (see the description above). |
database | Database URL. |
userName | The username. |
password | The password. |
The database argument can take one of the following forms:
DB2 | <database alias> |
Informix | *lt;database name>[<server> |
MySQL | <db>/<host> |
Odbc | <data source name> |
Oledb | <database name>/<server name> |
Oracle | <service> |
Sybase | <database name>/<server name> |
The Oracle <service> may be:
IldAllocConnect
.