Class OracleDatabase

Description

A OracleDatabase class provides the tools to connect, query, etc., a Oracle database.

  • version: $Id: OracleDatabase.class.php,v 1.15 2007/09/05 21:39:00 adamfranco Exp $
  • license: GNU General Public License (GPL)
  • copyright: Copyright © 2005, Middlebury College

Located in /harmoni/core/DBHandler/Oracle/OracleDatabase.class.php (line 28)

DatabaseAbstract
   |
   --OracleDatabase
Variable Summary
string $_dbHost
string $_dbName
string $_dbPass
string $_dbUser
integer $_failedQueries
mixed $_linkId
Method Summary
integer OracleDatabase (string $dbName, string $dbUser, string $dbPass)
mixed connect ()
boolean disconnect ()
ref fromDBDate (mixed $value)
string generateSQL (object $query)
string getStringName ()
array getTableList ()
boolean isConnected ()
mixed pConnect ()
mixed query (Query $query)
boolean selectDatabase (string $database)
mixed toDBDate (DateAndTime $dateAndTime)
mixed _query (mixed $query)
Variables
string $_dbHost (line 38)

The hostname of the database, i.e. myserver.mydomain.edu.

The hostname of the database, i.e. myserver.mydomain.edu.

  • var: The hostname of the database, i.e. myserver.mydomain.edu.
  • access: private
string $_dbName (line 46)

The name of the default database to use.

The name of the default database to use.

  • var: The name of the default database to use.
  • access: private
string $_dbPass (line 62)

The password for $_dbUser with which to connect to the database.

The password for $_dbUser with which to connect to the database.

  • var: The password for $_dbUser with which to connect to the database.
  • access: private
string $_dbUser (line 54)

The username with which to connect to the database.

The username with which to connect to the database.

  • var: The username with which to connect to the database.
  • access: private
integer $_failedQueries (line 90)

The total number of failed queries executed since the last call to connect().

The total number of failed queries executed since the last call to connect().

  • var: The total number of failed queries executed since the last call to connect().
  • access: private
mixed $_linkId (line 72)

Stores the current connection's link identifier.

If a connection is open, this stores the connection's identifier. Otherwise, it stores FALSE.

  • var: If a connection is open, this stores the connection's identifier. Otherwise, it stores FALSE.
  • access: private
integer $_successfulQueries (line 81)

The total number of successful queries executed since the last call to connect().

The total number of failed queries executed since the last call to connect().

  • var: The total number of failed queries executed since the last call to connect().
  • access: private
Methods
Constructor OracleDatabase (line 101)

Creates a new database connection.

  • return: The index of the new database
  • access: public
integer OracleDatabase (string $dbName, string $dbUser, string $dbPass)
  • string $dbName: The TNS name of the database to use (found in tnsnames.ora file).
  • string $dbUser: The username with which to connect to the database.
  • string $dbPass: The password for $_dbUser with which to connect to the database.
beginTransaction (line 472)

Begin a transaction.

  • since: 3/9/05
  • access: public
void beginTransaction ()
commitTransaction (line 484)

Commit a transaction. This will roll-back changes if errors occured in the transaction block.

  • since: 3/9/05
  • access: public
void commitTransaction ()
connect (line 156)

Connects to the database.

Connects to the database.

  • return: The connection's link identifier, if successful; False, otherwise.
  • access: public
mixed connect ()
disconnect (line 351)

Disconnects from the database.

Disconnects from the database.

  • return: True, if successful; False, otherwise.
  • access: public
boolean disconnect ()
fromDBDate (line 446)

Converts a database datetime/timestamp/time value (that has been fetched from the db) to a DateAndTime object.

  • return: object The DateAndTime object.
  • access: public
ref fromDBDate (mixed $value)
  • mixed $value: A database datetime/timestamp/time value (that has been fetched from the db).
generateSQL (line 290)

Answer the string SQL for the query

  • since: 11/14/06
  • access: public
string generateSQL (object $query)
  • object $query
getNumberFailedQueries (line 398)

Returns the total number of failed queries executed since the last call to connect().

Returns the total number of failed queries executed since the last call to connect().

  • return: The total number of failed queries executed since the last call to connect().
  • access: public
integer getNumberFailedQueries ()
getNumberSuccessfulQueries (line 386)

Returns the total number of successful queries executed since the last call to connect().

Returns the total number of successful queries executed since the last call to connect().

  • return: The total number of successful queries executed since the last call to connect().
  • access: public
integer getNumberSuccessfulQueries ()
getStringName (line 124)

Returns a short string name for this database type. Example: 'MySQL'

  • access: public
string getStringName ()
getTableList (line 133)

Returns a list of the tables that exist in the currently connected database.

  • access: public
array getTableList ()
isConnected (line 372)

Indicates whether there is an open connection to the database.

Indicates whether there is an open connection to the database.

  • return: True if there is an open connection to the database; False, otherwise.
  • access: public
boolean isConnected ()
pConnect (line 186)

Makes a persistent database connection.

Makes a persistent database connection.

  • return: The connection's link identifier, if successful; False, otherwise.
  • access: public
mixed pConnect ()
query (line 222)

Executes an SQL query.

Executes an SQL query. The method is passed a query object, which it converts to a SQL query string using the appropriate SQLGenerator object.

  • return: The appropriate QueryResult object. If the query failed, it would return NULL.
  • access: public
mixed query (Query $query)
  • object Query $query: A Query object from which the SQL query will be constructed.
rollbackTransaction (line 495)

Roll-back a transaction manually instead of committing

  • since: 3/9/05
  • access: public
void rollbackTransaction ()
selectDatabase (line 410)

This method selects the default database to use in queries.

  • return: True, if successful; False, otherwise.
  • access: public
boolean selectDatabase (string $database)
  • string $database: database The name of the default database.
supportsTransactions (line 461)

Return TRUE if this database supports transactions.

  • since: 3/9/05
  • access: public
boolean supportsTransactions ()
toDBDate (line 427)

Converts a DateAndTime object to a proper datetime/timestamp/time representation for this Database.

  • return: A proper datetime/timestamp/time representation for this Database.
  • access: public
mixed toDBDate (DateAndTime $dateAndTime)
  • ref $dateAndTime: object dateAndTime The DateAndTime object to convert.
_query (line 305)

Executes an SQL query.

Executes an SQL query.

  • return: For a SELECT statement, a resource identifier, if successful; For INSERT, DELETE, UPDATE statements, TRUE if successful; for all: FALSE, if not successful. If
    1. $query
    had several queries, this would be the result for the last one.
  • access: private
mixed _query (mixed $query)
  • mixed $query: query Either a string (this would be the case, normally) or an array of strings. Each string is corresponding to an SQL query.

Inherited Methods

Inherited From DatabaseAbstract

DatabaseAbstract::getConnectionErrorInfo()

Documentation generated on Wed, 19 Sep 2007 10:25:18 -0400 by phpDocumentor 1.3.0RC3