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

RWDBDatabase

Module:  DB Interface Module   Group:  Database Classes


Does not inherit

Local Index

Members

Synopsis

#include <rw/db/dbase.h>
#include <rw/db/dbmgr.h>

RWDBDatabase dBase = 
  RWDBManager::database("accessLib", "", "", "", "",
                        "XA=xaParameter");

Description

RWDBDatabase manages connections with database servers. A database object represents a server, a user on that server, and a database opened for that user. In the DB Interface Module, database objects are produced by calling RWDBManager::database() and defining the propertyString parameter with key XA=xaParameter. Class RWDBDatabase provides an interface for obtaining XA-enabled database-specific objects. For database-specific values of xaParameter, see the User's Guide.


NOTE -- In an XA environment, use of DDL calls may result in a server error. DDL calls can be used before XA connectivity is established.

RWDBDatabase is designed around the Interface/Implementation paradigm. An RWDBDatabase instance is an interface to a reference-counted implementation; copy constructors and assignment operators produce additional references to a shared implementation. An RWDBDatabase implementation is a base class from which a family of database-specific implementations is derived.

Every valid RWDBDatabase implementation has a database type that applies to both XA and non-XA implementations. For example, the database type might be SYBASE. Applications request RWDBDatabases of a particular type by specifying the type to the RWDBManager; once a valid RWDBDatabase instance is obtained, its implementation type is transparent to the application. Objects produced by an RWDBDatabase instance automatically have the same implementation type as the producer. For example, a SYBASE type RWDBDatabase automatically produces SYBASE-type RWDBTables.

Public Enum and Defines

enum tableType(UserTable = 1, SystemTable = 2, View = 4, 
               Synonym = 8)
#define rwdbAllTypes (SystemTable|UserTable|View| Synonym)

Public Constructors

RWDBDatabase();
RWDBDatabase(const RWDBDatabase& dbase);

Public Member Operators

RWDBDatabase&
operator=(const RWDBDatabase& dbase);
bool 
operator==(const RWDBDatabase& dbase) const;
bool
operator!=(const RWDBDatabase& dbase) const;

Public Member Functions

void
acquire() const;
RWCString::caseCompare
caseCompare() const;
RWCString::caseCompare
caseCompare(RWCString::caseCompare cmp);
static bool
connect() const
static void
connect(bool enable);
RWDBConnection
connection(RWDBConnection::ConnectionType type = 
           RWDBConnection::Synchronous) const;
RWDBConnection
connection((const RWDBConnCallback& conncb,
            RWDBConnection::ConnectionType type = 
            RWDBConnection::Synchronous ) const;

NOTE -- With the exception of Sybase CT, this method produces a notSupported error if used to create more than one connection.
RWDBStatus
createProcedure(const RWCString& name, 
                const RWCString& sql) const;
RWDBStatus
createProcedure(const RWCString& name, const RWCString& sql,
                const RWDBConnection& connection) const;
RWDBStatus
createProcedure(const RWCString& name, const RWCString& sql,
                const RWDBSchema& params) const;
RWDBStatus
createProcedure(const RWCString& name, const RWCString& sql,
                const RWDBSchema& params, 
                const RWDBConnection& connection) const;
RWDBStatus
createProcedure(const RWDBStoredProc& proc) const;
RWDBStatus
createProcedure(const RWDBStoredProc& proc,
                const RWDBConnection& connection) const;
RWDBStatus
createTable(const RWDBTable& table) const;
RWDBStatus
createTable(const RWCString& name, 
            const RWDBSchema& schema) const;
RWDBStatus
createTable(const RWDBTable& table,
            const RWDBConnection& connection) const;
RWDBStatus
createTable(const RWCString& name, const RWDBSchema& schema, 
            const RWDBConnection& connection) const;
RWDBStatus
createView(const RWCString& viewName,
           const RWDBSelectorBase& select) const;
RWDBStatus
createView(const RWCString& viewName, 
           const RWDBSchema& columnList,
           const RWDBSelectorBase& select) const;
RWDBStatus
createView(const RWCString& viewName, 
           const RWDBSelectorBase& select, 
           const RWDBConnection& connection) const;
RWDBStatus
createView(const RWCString& viewName,
           const RWDBSchema& columnList,
           const RWDBSelectorBase& select, 
           const RWDBConnection& connection) const;
RWDBStatus
createView(const RWCString& viewName, 
           const RWCString& sql) const;
RWDBStatus
createView(const RWCString& viewName, 
           const RWDBSchema& columnList,
           const RWCString& sql) const;
RWDBStatus
createView(const RWCString& viewName, RWCString& sql, 
           const RWDBConnection& connection) const;
RWDBStatus
createView(const RWCString& viewName, 
           const RWDBSchema& columnList,
           const RWCString& sql, 
           const RWDBConnection& connection) const;
RWDBCursor     
cursor(const RWCString& select, 
       const RWDBSchema& updateCols, 
       const RWDBConnection& connection,
       RWDBCursor::CursorType cursorType = 
                              RWDBCursor::Sequential, 
       RWDBCursor::CursorAccess cursorAccess = 
                              RWDBCursor::Read) const;
RWDBCursor     
cursor(const RWCString& select, 
       const RWDBSchema& updateCols,
       RWDBCursor::CursorType cursorType = 
                              RWDBCursor::Sequential, 
       RWDBCursor::CursorAccess cursorAccess = 
                              RWDBCursor::Read) const;
RWDBCursor
cursor(const RWDBSelector& selector,
       const RWDBSchema& updateCols,
       const RWDBConnection& connection,
       RWDBCursor::CursorType cursorType =
                              RWDBCursor::Sequential, 
       RWDBCursor::CursorAccess cursorAccess = 
                              RWDBCursor::Read) const;
RWDBCursor     
cursor(const RWDBSelector& selector, 
       const RWDBSchema& updateCols, 
       RWDBCursor::CursorType cursorType =
                              RWDBCursor::Sequential, 
       RWDBCursor::CursorAccess cursorAccess = 
                              RWDBCursor::Read) const;
RWDBCursor
cursor(const RWDBCompoundSelector& selector, 
       const RWDBSchema& updateCols, 
       const RWDBConnection& connection,
       RWDBCursor::CursorType cursorType =
                              RWDBCursor::Sequential, 
       RWDBCursor::CursorAccess cursorAccess = 
                              RWDBCursor::Read) const;
RWDBCursor
cursor(const RWDBCompoundSelector& selector, 
       const RWDBSchema& updateCols, 
       RWDBCursor::CursorType cursorType =
                              RWDBCursor::Sequential, 
       RWDBCursor::CursorAccess cursorAccess = 
                              RWDBCursor::Read) const;
RWDBCursor
cursor(const RWCString& sql, 
       RWDBCursor::CursorType cursorType =
                              RWDBCursor::Sequential, 
       RWDBCursor::CursorAccess cursorAccess = 
                              RWDBCursor::Read) const;
RWDBCursor
cursor(const RWCString& sql, 
       const RWDBConnection& connection, 
       RWDBCursor::CursorType cursorType =
                              RWDBCursor::Sequential, 
       RWDBCursor::CursorAccess cursorAccess = 
                              RWDBCursor::Read) const;
RWDBCursor
cursor(const RWDBSelector& select, 
       RWDBCursor::CursorType cursorType =
                              RWDBCursor::Sequential, 
       RWDBCursor::CursorAccess cursorAccess = 
                              RWDBCursor::Read) const;
RWDBCursor
cursor(const RWDBSelector& select, 
       const RWDBConnection& connection, 
       RWDBCursor::CursorType cursorType =
                              RWDBCursor::Sequential, 
       RWDBCursor::CursorAccess cursorAccess = 
                              RWDBCursor::Read) const;
RWDBCursor
cursor(const RWDBCompoundSelector& select,
       RWDBCursor::CursorType cursorType =
                              RWDBCursor::Sequential, 
       RWDBCursor::CursorAccess cursorAccess = 
                              RWDBCursor::Read) const;
RWDBCursor
cursor(const RWDBCompoundSelector& select, 
       const RWDBConnection& connection, 
       RWDBCursor::CursorType cursorType =
                              RWDBCursor::Sequential, 
       RWDBCursor::CursorAccess cursorAccess = 
                              RWDBCursor::Read) const;
RWDBDateVector
dateVector(size_t n);
RWCString
dbName() const;
RWDBTable
dbStoredProcedures() const;
RWDBTable
dbStoredProcedures(const RWCString& name) const;
RWDBTable
dbStoredProcedures(const RWCString& name, 
const RWCString& owner) const;
RWDBTable
dbStoredProcedures(const RWDBConnection& conn) const;
RWDBTable
dbStoredProcedures(const RWDBConnection& conn, 
const RWCString& name) const;
RWDBTable
dbStoredProcedures(const RWDBConnection& conn, 
const RWCString& name,
const RWCString& owner) const;
RWDBTable
dbTables(int type = rwdbAllTypes) const;
RWDBTable
dbTables(const RWCString& name,int type=rwdbAllTypes) const;
RWDBTable
dbTables(const RWCString& name, const RWCString& owner, 
         int type = rwdbAllTypes) const;
RWDBTable
dbTables(const RWDBConnection& conn, 
         int type = rwdbAllTypes) const;
RWDBTable
dbTables(const RWDBConnection& conn, const RWCString& name,
         int type = rwdbAllTypes) const;
RWDBTable
dbTables(const RWDBConnection& conn, const RWCString& name, 
         const RWCString& owner,int type=rwdbAllTypes)const;
size_t
defaultConnections() const;
size_t
defaultConnections(size_t reqdConnections);

NOTE -- The DB Interface Module limits the number of valid connections to one. Therefore, setting the number of default connections to more than one serves no purpose.
RWDBDeleter
deleter(const RWDBTable& table) const;
RWDBDeleter
deleter(const RWDBTable& table, 
        const RWDBCriterion& criterion) const;
RWDBStatus
dropView(const RWCString& viewName);
RWDBStatus
dropView(const RWCString& viewName,
         const RWDBConnection& connection);
RWDBStatus::ErrorHandler
errorHandler() const;
bool
emptyStringIsNull() const;
RWDBEnvironmentHandle*
environmentHandle() const;
RWDBInserter
inserter(const RWDBTable& table) const;
RWDBInserter
inserter(const RWDBTable& table, 
         const RWDBSchema& columnList) const;
RWDBInserter
inserter(const RWDBTable& table,
         const RWDBSelector& selector)const;
RWDBInserter
inserter(const RWDBTable& table, const RWDBSelector& selector, 
         const RWDBSchema& columnList)const;
RWDBInserter
inserter(const RWDBTable& table, 
         const RWDBCompoundSelector& selector) const;
RWDBInserter
inserter(const RWDBTable& table, 
         const RWDBCompoundSelector & select, 
         const RWDBSchema& columnList)const;
bool
isReady() const;
bool
isValid() const;
RWDBMemTable
memTable(const RWCString& name, size_t capacity = 0) const;
RWDBMemTable
memTable(const RWCString& name,
         const RWDBConnection& connection, size_t capacity=0);
RWCString
passWord() const;
const RWDBPhraseBook&
phraseBook() const;
void
release() const;
RWDBSelector
selector() const;
RWDBSelector
selector(const RWDBCriterion& criterion) const;
RWCString
serverName() const;
RWCString
serverType() const;
void
setErrorHandler(RWDBStatus::ErrorHandler handler);
RWDBStatus
status() const;
RWDBStoredProc
storedProc(const RWCString& name) const;
RWDBStoredProc
storedProc(const RWCString& name, 
           const RWDBConnection& connection) const;
RWDBStoredProc
storedProc(const RWCString& name, 
           const RWDBSchema& schema,
constRWDBColumn& col = RWDBColumn()) const;
RWDBStoredProc
storedProc(const RWCString& name, 
           const RWDBConnection& connection
           const RWDBSchema& schema,
constRWDBColumn& col = RWDBColumn()) const;
RWDBTable
table(const RWCString& name) const;
size_t
totalConnections() const;

NOTE -- When the DB Interface Module is used with the Sybase CT Access Module the connection pool is disabled and, if used, returns 0.
RWDBTracer&
tracer();
RWDBUpdater
updater(const RWDBTable& table) const;
RWDBUpdater
updater(const RWDBTable& table, 
        const RWDBCriterion & criterion) const;
RWCString
userName() const;
bool
verboseAsString() const;
bool
verboseAsString(bool verbose) const;

NOTE -- Setting the verboseAsString member to true enables the asString()methods to return SQL in which placeholders are replaced by their bound values, but it does not affect the SQL passed to the database for execution.
RWCString
version() const;

.



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.