Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

RWDBConnection



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

Synopsis

#include <rw/db/connect.h>

RWDBConnection connection = myDbase.connection();

Description

Connections represent a scarce resource that applications can allocate and manage themselves. An RWDBConnection is an object that may be requested from an RWDBDatabase, and passed to many methods to specify that the method should use the given connection. Operations requested without supplying a connection are performed using a connection supplied invisibly by RWDBDatabase. If none are available, an error results. Thus, the use of explicit connections eliminates one likely source of errors, at some cost in program complexity.

Each RWDBConnection knows which RWDBDatabase produced it, and each RWDBDatabase knows what connections it has produced.

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

Public Enum

These are the values used for the isolation() methods:

enum IsolationType {
Unknown,                   //  the default
ANSILevel1,
ANSILevel2,
ANSILevel3
}

These are the values used for the connectionType() method:

enum ConnectionType {
Synchronous = 1
Asynchronous
}

Public Constructors

RWDBConnection();
RWDBConnection(const RWDBConnection& connection);

Public Member Operators

RWDBConnection&
operator=(const RWDBConnection& connection);
RWBoolean 
operator==(const RWDBConnection& conn) const;
RWBoolean 
operator!=(const RWDBConnection& conn) const;

Public Member Functions

void
acquire() const;
RWDBStatus
beginTransaction(const RWCString& name=RWCString());
RWDBStatus
close(); 
RWDBStatus
commitTransaction(const RWCString& name=RWCString());
RWDBConnection::ConnectionType
connectionType() const;
RWDBDatabase
database() const;
RWDBStatus::ErrorHandler
errorHandler() const;
RWDBResult
executeSql(const RWCString& sqlProgram) const;
RWDBConnection::IsolationType
isolation() const;
RWDBStatus
isolation (RWDBConnection::IsolationType level);
RWBoolean
isReady() const;
RWBoolean
isValid() const;
RWDBStatus
open(); 
void
release() const;
RWDBStatus
rollbackTransaction(const RWCString& name=RWCString());
void
setErrorHandler(RWDBStatus::ErrorHandler handler);
RWDBStatus
setSavepoint(const RWCString& name); 
RWDBStatus
status() const;
RWDBSystemHandle*
systemHandle();


Previous fileTop of DocumentContentsIndexNext file

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