Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
DB XA Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

RWDBManager

Module:  DB Interface Module   Group:  Database Classes


Does not inherit

Local Index

Members

Synopsis

#include <rw/db/dbmgr.h>
RWDBDatabase myDbase = RWDBManager::database("myDbaseType", "",
                               "", "", "", "XA=xaParameter");

Description

As in SourcePro Core, you use the RWDBManager::database() function to request an RWDBDatabase instance from RWDBManager. In the DB Interface Module, however, you also provide the sixth parameter, propertyString, defined with key XA=xaParameter. This produces XA-enabled RWDBDatabase objects. For database-specific values of xaParameter, see the User's Guide.

There is a single, global RWDBManager in charge of producing RWDBDatabases typed according to the application's request. It mediates access to database servers, abstracting details of access to vendor-supplied libraries, including any dynamic loading and linking. The RWDBManager, through its database() method, is responsible for filling requests for database implementations of a particular type. To do so, it maintains a set of database types for which it is able to produce an implementation.

Associated with each database type is a method that produces the implementation. This method may reside in a dynamically-linked library, or may be statically linked with a specialized object. In the former case, the method is identified by a conventional name, rwdbNewDatabaseImp, with any ambiguity alleviated by the containing library. In the latter case, each method must be uniquely named, as in rwdbNewSybaseDatabaseImp, for example. The association between method names and database types is made at link time via static initialization.

When presented with a request for a particular type of database implementation, the RWDBManager consults its set of known implementations. If no entry is found, and the operating environment supports dynamic linking, a search is made for a dynamically-linked library (DLL) whose name matches the requested type. If a DLL is found, it is loaded, the conventionally-named method is located, and the association is added to the set of implementations of the RWDBManager. Once an entry is located, its method is invoked to obtain an implementation of the requested type, a connection is established, and the result is returned to the caller. If no entry is found, the object returned to the caller has a status of RWDBStatus::notFound.

Public Member Functions

static RWDBDatabase
database(const RWCString& serverType,
         const RWCString& serverName, 
         const RWCString& userName, 
         const RWCString& password, 
         const RWCString& databaseName,
         const RWDBDatabaseCallback& databasecb
               = RWDBDatabaseCallback());
static RWDBDatabase
database(const RWCString& serverType,
         const RWCString& serverName, 
         const RWCString& userName, 
         const RWCString& passWord, 
         const RWCString& databaseName,
         const RWCString& propertyString,
         const RWDBDatabaseCallback& databasecb
               = RWDBDatabaseCallback());

NOTE -- Arguments passed for non-XA connections differ from those passed for XA connections. For XA connection arguments, see the DB Interface Module User's Guide.
static bool
emptyStringIsNull();
static void
emptyStringIsNull(bool n);
static RWDBStatus::ErrorHandler
errorHandler() const;
static RWDBStatus::ErrorHandler
setErrorHandler(RWDBStatus::ErrorHandler handler);
static RWCString
version();
static void*
xaSwitch(const RWCString& accessLib);


Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.