ConnectionCommon Class Reference

Inherits Connection.

Inherited by MSSQLConnection, MySQLConnection, OCI8Connection, PgSQLConnection, and SQLiteConnection.

List of all members.

Public Member Functions

Public Attributes


Member Function Documentation

ConnectionCommon::__sleep ()

 

This "magic" method is invoked upon serialize() and works in tandem with the __wakeup() method to ensure that your database connection is serializable.

This method returns an array containing the names of any members of your class which need to be serialized in order to allow the class to re-connect to the database when it is unserialized.

Developers:

Note that you cannot serialize resources (connection links) and expect them to be valid when you unserialize. For this reason, you must re-connect to the database in the __wakeup() method.

It's up to your class implimentation to ensure that the necessary data is serialized. You probably at least need to serialize:

(1) the DSN array used by connect() method (2) Any flags that were passed to the connection (3) Possibly the autocommit state

Returns array The class variable names that should be serialized.

See also __wakeup()

DriverManager::getConnection()

DatabaseInfo::__sleep()

ConnectionCommon::__wakeup ()

 

This "magic" method is invoked upon unserialize(). This method will re-connects to the database using the information that was stored using the __sleep() method.

See also __sleep()

ConnectionCommon::getResource ()

 

See also Connection::getResource()

Reimplemented from Connection.

ConnectionCommon::getDSN ()

 

See also Connection::getDSN()

Reimplemented from Connection.

ConnectionCommon::getFlags ()

 

See also Connection::getFlags()

Reimplemented from Connection.

ConnectionCommon::prepareCall ( &$  sql)

 

Creates a CallableStatement object for calling database stored procedures.

Parameters:
string $sql

Returns CallableStatement

Reimplemented in MySQLConnection.

ConnectionCommon::applyLimit ( &$  sql,  $  offset,  $  limit )

 

If RDBMS supports native LIMIT/OFFSET then query SQL is modified so that no emulation is performed in ResultSet.

By default this method adds LIMIT/OFFSET in the style " LIMIT $limit OFFSET $offset" to end of SQL.

Parameters:
string &$sql The query that will be modified.
int $offset
int $limit

Returns boolean Whether the query was modified.

Exceptions:
SQLException - if unable to modify query for any reason.

Reimplemented from Connection.

Reimplemented in MSSQLConnection, and OCI8Connection.

ConnectionCommon::getAutoCommit ()

 

Get auto-commit status.

Returns boolean

Reimplemented from Connection.

ConnectionCommon::setAutoCommit ( $  bit)

 

Enable/disable automatic commits.

Pushes SQLWarning onto $warnings stack if the autocommit value is being changed mid-transaction. This function is overridden by driver classes so that they can perform the necessary begin/end transaction SQL.

If auto-commit is being set to TRUE, then the current transaction will be committed immediately.

Parameters:
boolean $bit New value for auto commit.

Returns TRUE on success, FALSE on mid-transaction, SQLException otherwise.

Reimplemented from Connection.


Member Data Documentation

ConnectionCommon::$transactionOpcount = 0

 

ConnectionCommon::$autocommit = true

 

ConnectionCommon::$dblink

 

ConnectionCommon::$dsn

 

ConnectionCommon::$flags = 0

 


This file is part of the Creole[php4] library.


Copyright © 2004 Hans Lellelid  
Creole[php4] CVS