Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

RWDBManager



Data Type and Member Function Indexes
(exclusive of constructors and destructors)

Synopsis

#include <rw/db/dbmgr.h>
RWDBDatabase myDbase = RWDBManager::database("myDbaseType", "myDbaseServerName",
  "myLoginName", "myPassword", "myDbaseName");

Description

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& accessLib,
         const RWCString& serverName, 
         const RWCString& userName, 
         const RWCString& passWord, 
         const RWCString& databaseName);
static RWDBStatus::ErrorHandler
errorHandler() const;
static RWDBStatus::ErrorHandler
setErrorHandler(RWDBStatus::ErrorHandler handler);
static RWCString
version();


Previous fileTop of DocumentContentsIndexNext file

©Copyright 1999, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.