Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

wx::DBI::Database Class Reference

Generic interface to databases. More...

#include <dbi.h>

Collaboration diagram for wx::DBI::Database:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Database ()
 Default ctor.

virtual ~Database ()
 dtor.

virtual void Connect (const ConnectionInfo &cni)=0
 Connect to the database.

virtual void Disconnect ()=0
 Disconnect from the database.

virtual bool IsConnected ()=0
 Is the database connected.

virtual void Begin ()
 Start a new transaction.

virtual void Rollback ()
 Rollback to the start of the transaction.

virtual void Commit ()
 Commit changes made since the start of the transaction.

virtual StatementPrepare (const wxString &sQuery)=0
 Prepare a query.

virtual wxArrayString GetDatabases ()=0
 List all other databases on the same server as the currently connected database.

virtual bool DatabaseExists (const wxString &sDatabaseName)=0
 Indicates whether a certain database exists on the current server.

virtual wxArrayString GetTables ()=0
 Returns an array containing the names of tables in the database.

virtual bool TableExists (const wxString &sTableName)=0
 Indicates whether a certain table exists in the current databse.


Protected Attributes

ConnectionInfo m_cni

Detailed Description

Generic interface to databases.

Define one (or more) of the wxDBI_XXXX flags to include the interfaces to specific database engines.

Definition at line 82 of file dbi.h.


Constructor & Destructor Documentation

wx::DBI::Database::Database  )  [inline]
 

Default ctor.

Definition at line 128 of file dbi.h.

virtual wx::DBI::Database::~Database  )  [inline, virtual]
 

dtor.

Implementations should call the Disconnect() method.

Definition at line 135 of file dbi.h.


Member Function Documentation

virtual void wx::DBI::Database::Begin  )  [inline, virtual]
 

Start a new transaction.

Definition at line 176 of file dbi.h.

virtual void wx::DBI::Database::Commit  )  [inline, virtual]
 

Commit changes made since the start of the transaction.

Definition at line 192 of file dbi.h.

virtual void wx::DBI::Database::Connect const ConnectionInfo cni  )  [pure virtual]
 

Connect to the database.

Use the values in the ConnectionInfo hash to connect to the database.

Normal connection parameters are:

  • Name The name of the database.
  • Logon The user name for authentication.
  • Password The password for authentication.
  • Host The IP or fully qualified name of the remote host.
  • Port The IP port on which to attempt the connection.

virtual bool wx::DBI::Database::DatabaseExists const wxString &  sDatabaseName  )  [pure virtual]
 

Indicates whether a certain database exists on the current server.

Parameters:
sDatabaseName The database name.
Returns:
bool True is the database exists, otherwise false.

virtual void wx::DBI::Database::Disconnect  )  [pure virtual]
 

Disconnect from the database.

virtual wxArrayString wx::DBI::Database::GetDatabases  )  [pure virtual]
 

List all other databases on the same server as the currently connected database.

Returns:
An wxStringArray of database names.

virtual wxArrayString wx::DBI::Database::GetTables  )  [pure virtual]
 

Returns an array containing the names of tables in the database.

virtual bool wx::DBI::Database::IsConnected  )  [pure virtual]
 

Is the database connected.

virtual Statement* wx::DBI::Database::Prepare const wxString &  sQuery  )  [pure virtual]
 

Prepare a query.

Note that the returned Statement pointer must be destroyed with delete.

Parameters:
sQuery The SQL query.
Returns:
A Statement pointer for the query.

virtual void wx::DBI::Database::Rollback  )  [inline, virtual]
 

Rollback to the start of the transaction.

Definition at line 184 of file dbi.h.

virtual bool wx::DBI::Database::TableExists const wxString &  sTableName  )  [pure virtual]
 

Indicates whether a certain table exists in the current databse.

Parameters:
sTableName The name of the table.
Returns:
bool True is the table exists, otherwise false.


Member Data Documentation

ConnectionInfo wx::DBI::Database::m_cni [protected]
 

Definition at line 245 of file dbi.h.


The documentation for this class was generated from the following file:
Generated on Wed Jan 25 08:13:20 2006 for Sherpa wxWidgets Classes by doxygen 1.3.6