Getting Connected with the DB XA Module
In the DB XA Module you establish database connectivity in much the same way as inthe DB Interface Module—by requesting an
RWDBDatabase instance from
RWDBManager. You still use the
RWDBManager::database() method, but for XA-compliant database connectivity, you also provide an XA key in the sixth parameter,
propertyString.
Here is the signature for static method RWDBManager::database():
static RWDBDatabase
database(const RWCString& accessLib,
const RWCString& serverName,
const RWCString& userName,
const RWCString& passWord,
const RWCString& databaseName,
const RWCString& propertyString);
To establish a non-XA connection with DB Interface Module, you would provide arguments for all of the listed parameters, as shown here:
RWDBManager::database("accessLib", "serverName", "userName",
"password", "databaseName",
"propertyString");
To establish an XA-enabled connection with the DB XA Module, however, you must provide only two arguments, accessLib and propertyString. All other parameters are not required, as shown here:
RWDBDatabase xaDB = RWDBManager::database("myAccessLib", "", "", "",
"", "XA=xaParameter");
The value of the required arguments is specific to each access module. Note, for example, that the
propertyString parameter is defined with argument
"XA=xaParameter". The value of this argument is database-specific. For details specific to each access module, see
Chapter 5.
To establish connections in a non-XA environment, see the DB Interface Module User’s Guide. You can always produce non-XA connections, even when you have the DB XA Module.