ConnectionCommon Class Reference

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

List of all members.

Public Member Functions

Protected Attributes


Member Function Documentation

array 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()

ConnectionCommon::getDSN ( )

 

See also Connection::getDSN()

ConnectionCommon::getFlags ( )

 

See also Connection::getFlags()

CallableStatement ConnectionCommon::prepareCall ( $sql )

 

Creates a CallableStatement object for calling database stored procedures.

Parameters
string $sql

Returns CallableStatement

Reimplemented in MSSQLConnection, MySQLConnection, OCI8Connection, PgSQLConnection, and SQLiteConnection.

boolean 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 in MSSQLConnection, and OCI8Connection.

boolean ConnectionCommon::getAutoCommit ( )

 

Get auto-commit status.

Returns boolean

void 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 void


Member Data Documentation

ConnectionCommon::$transactionOpcount = 0 [protected]

 

ConnectionCommon::$autocommit = true [protected]

 

ConnectionCommon::$dblink [protected]

 

ConnectionCommon::$dsn [protected]

 

ConnectionCommon::$flags = 0 [protected]

 


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


Copyright © 2004 Hans Lellelid  
Creole[php5] CVS