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

RWDBConnection

Module:  DB Interface Module   Group:  Database Classes


Does not inherit

Local Index

Members

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);
bool 
operator==(const RWDBConnection& conn) const;
bool 
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);
bool
isReady() const;
bool
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 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.