Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

O3DBIDatabase Class Reference

#include <O3DBIDatabase.h>

Inheritance diagram for O3DBIDatabase:

Inheritance graph
[legend]
Collaboration diagram for O3DBIDatabase:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 O3DBIDatabase ()
 O3DBIDatabase (PC_TCHAR pchUsername, PC_TCHAR pchPasswd, PC_TCHAR pchHost)
virtual ~O3DBIDatabase ()
void LogOn (PC_TCHAR pchUsername, PC_TCHAR pchPasswd, PC_TCHAR pchHost)
void LogOff (void)
bool IsConnected (void) const
bool IsConnectionValid (void) const
virtual TO3DBIString ToString (void) const

Detailed Description

This class represents an Oracle Database.

Definition at line 51 of file O3DBIDatabase.h.


Constructor & Destructor Documentation

O3DBIDatabase::O3DBIDatabase  ) 
 

The standard constructor.

Definition at line 20 of file O3DBIDatabase.cpp.

O3DBIDatabase::O3DBIDatabase PC_TCHAR  pchUsername,
PC_TCHAR  pchPasswd,
PC_TCHAR  pchHost
 

This constructor constructs a new O3DBIDatabase object and connects to an Oracle Database simultanously.

Parameters:
pchUsername is a pointer to a zero-terminated string containing the username.
pchPasswd is a pointer to a zero-terminated string containing the user's password.
pchHost is a pointer to a zero-terminated string containing the name of the database to connect to.
Exceptions:
O3DBIException - if the logon fails.

Definition at line 29 of file O3DBIDatabase.cpp.

References LogOn().

O3DBIDatabase::~O3DBIDatabase  )  [virtual]
 

The virtual destructor.

Definition at line 39 of file O3DBIDatabase.cpp.

References LogOff().


Member Function Documentation

bool O3DBIDatabase::IsConnected void   )  const
 

Call this member function to check a connection to an Oracle Database.

Returns:
true if a connection exists, false otherwise.

Definition at line 108 of file O3DBIDatabase.cpp.

bool O3DBIDatabase::IsConnectionValid void   )  const
 

Call this member function to validate a connection.

Returns:
true if the connection is valid, false if the connection is aborted or malfunctioning.

Definition at line 113 of file O3DBIDatabase.cpp.

void O3DBIDatabase::LogOff void   ) 
 

Call this member function to close a connection to an Oracle Database. O3DBIDatabase::LogOff is also called by the destructor, if a session was not released before.

Definition at line 91 of file O3DBIDatabase.cpp.

References TO3DBIString, TOCIErrorcode, and TOCIResult.

Referenced by ~O3DBIDatabase().

void O3DBIDatabase::LogOn PC_TCHAR  pchUsername,
PC_TCHAR  pchPasswd,
PC_TCHAR  pchHost
 

Call this member function to create a simple logon session.

Parameters:
pchUsername is a pointer to a zero-terminated string containing the username.
pchPasswd is a pointer to a zero-terminated string containing the user's password.
pchHost is a pointer to a zero-terminated string containing the name of the database to connect to.
Exceptions:
O3DBIException - if the logon fails.
Example of usage
        try
        {
            // Try to connect to data base
            O3DBIDatabase db;
            db.LogOn(_T("Scott"), _T("Tiger"), _T("oradb"));
        }
        catch (O3DBIException* pEx)
        {
            // Print error information on std out
            ::_tprintf(_T("Context: %s - Errorcode: %d\n%s\n"),
                pEx->GetFailedMethodName(), pEx->GetErrorNumber(),
                pEx->GetErrorText());
            delete pEx;
        }

Definition at line 61 of file O3DBIDatabase.cpp.

References TO3DBIString, TOCIErrorcode, and TOCIResult.

Referenced by O3DBIDatabase().

TO3DBIString O3DBIDatabase::ToString void   )  const [virtual]
 

This member function returns a string that "textually represents" this object.

Returns:
A TO3DBIString object containing the string.

Reimplemented from O3DBIObject.

Definition at line 118 of file O3DBIDatabase.cpp.

References TO3DBIString.


The documentation for this class was generated from the following files:


SourceForge.net Logo Generated on Sun Jan 23 11:36:45 2005 for Oracle Object Oriented Database Interface (O3DBI) by  doxygen 1.3.9.1