skip to main content
Interface Provider class : ipConnect
 

ipConnect

This method connects to the given logical database data source using the supplied user name and password. The IP can validate the user and password and generate a DAM_FAILURE if the user is not authorized to access the database. The IP can also set up data structures to enforce user rights to select, delete, insert and update tables. This method is called immediately after OpenAccess SDK has created the IP object.
int ipConnect(
    long   tmHandle,
    long   dam_hdbc,
    String sDataSourceName,
    String sUserName,
    String sPassword,
    String sCurrentCatalog,
    String sIPProperties,
    String sIPCustomProperties)
Table 14. Parameters for ipConnect
Parameter
Type
Description
INPUT
tmHandle
long
A handle for use with the tm_trace() method.
dam_hdbc
long
The OpenAccess SDK SQL engine connection handle.
sDataSourceName
String
The name of the data source to which the connection is being made.
sUserName
String
User name passed in by the client.
sPassword
String
Password typed in by the client.
sCurrentCatalog
String
Name of the catalog to use. The value can be specified by the client or in the DataSourceCurrentCatalog attribute
sIPProperties
String
Data source specific information that is set in the DataSourceIPProperties attribute.
sIPCustomProperties
String
Custom properties passed in by the client. The keywords that can appear in this string are based on the setting of the DataSourceIPCustomProperties attribute.
RETURN
int
DAM_SUCCESS – on success
DAM_FAILURE – on failure
Note: The default value is DAM_SUCCESS. If no return value is specified, the OpenAccess SDK SQL engine assumes that the return value is DAM_SUCCESS. The IP does not generate a DAM_FAILURE unless specified.
The sUserName and sPassword parameters are valid only if the data sourceproperty DataSourceLogonMethod is set toDBMSLogon(UID,PWD) or DBMSLogon(DBUID,DBPWD). Please refer to the OpenAccess SDK Administrator's Guide for information about what this method needs to do to support Microsoft Windows authentication (NTLM or Kerberos).
The sIPCustomProperties string contains all the information that was supplied by the user, including any custom options your IP will support. The string contains all the options as semicolon separated values. Each value consists of the option name and its setting. This allows your IP to supports its own keywords for specifying connection level information.

Supporting failover and load balancing

Refer to the OpenAccess SDK Administrator's Guide to learn how OpenAccess SDK supports failover and load balancing.