Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
DB Interface 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", "Servername",
                        "Username", "PassWord",
                        "DatabaseName");

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. Database objects are produced by the RWDBManager. Class RWDBDatabase provides an interface for obtaining database-specific objects and data definition language (DDL) concepts.

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. For example, the database type might be Sybase or Oracle. 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 Enums and Defines

enum tableType{ UserTable = 1, SystemTable = 2, View = 4, 
                Synonym = 8 }
enum AdjustCaseType { Exact = 0, Normalize = 1 };
#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;
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,
     AdjustCaseType adjustCase = Normalize) const;
RWDBTable
dbStoredProcedures(const RWCString& name, 
const RWCString& owner, AdjustCaseType adjustCase = Normalize) const;
RWDBTable
dbStoredProcedures(const RWDBConnection& conn) const;
RWDBTable
dbStoredProcedures(const RWDBConnection& conn, 
const RWCString& name, AdjustCaseType adjustCase = Normalize) const;
RWDBTable
dbStoredProcedures(const RWDBConnection& conn, 
const RWCString& name,
const RWCString& owner, AdjustCaseType adjustCase = Normalize) const;
RWDBTable
dbTables(int type = rwdbAllTypes) const;
RWDBTable
dbTables(const RWCString& name, 
     int type = rwdbAllTypes,
     AdjustCaseType adjustCase = Normalize) const;
RWDBTable
dbTables(const RWCString& name, const RWCString& owner, 
     int type = rwdbAllTypes,
     AdjustCaseType adjustCase = Normalize) const;
RWDBTable
dbTables(const RWDBConnection& conn, int type = rwdbAllTypes) const;
RWDBTable
dbTables(const RWDBConnection& conn, const RWCString& name,
     int type = rwdbAllTypes,
     AdjustCaseType adjustCase = Normalize) const;
RWDBTable
dbTables(const RWDBConnection& conn, 
     const RWCString& name, const RWCString& owner,
     int type = rwdbAllTypes,
     AdjustCaseType adjustCase = Normalize) const;
size_t
defaultConnections() const;
size_t
defaultConnections(size_t reqdConnections);
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, size_t cache=1) const;

NOTE -- When using Access Modules that support an inserter cache, increasing the cache value can greatly improve performance. However, setting the cache parameter greater than one may adversely affect transactions. Check your Access Module documentation for limitations and warnings.
RWDBInserter
inserter(const RWDBTable& table, 
         const RWDBSchema& schema,
         size_t cache=1) const;

NOTE -- When using Access Modules that support an inserter cache, increasing the cache value can greatly improve performance. However, setting the cache parameter greater than one may adversely affect transactions. Check your Access Module documentation for limitations and warnings.
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;
RWCString
passWord(const RWCString& pwd);
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,
           const RWDBColumn& col = RWDBColumn()) const;
RWDBStoredProc
storedProc(const RWCString& name, 
           const RWDBConnection& connection,
           const RWDBSchema& schema,
           const RWDBColumn& col = RWDBColumn()) const;
RWDBTable
table(const RWCString& name) const;
RWDBTable
table(const RWDBSelectorBase& selector) const;
size_t
totalConnections() const;
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.
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.