Class Zend_Db_Adapter_Db2

Description

Located in /Zend/Db/Adapter/Db2.php (line 40)

Zend_Db_Adapter_Abstract
   |
   --Zend_Db_Adapter_Db2
Variable Summary
Method Summary
 Zend_Db_Adapter_Db2 __construct ( $config)
 void closeConnection ()
 array describeTable (string $tableName, [string $schemaName = null])
 integer lastInsertId ([string $tableName = null], [string $primaryKey = 'id'])
 integer lastSequenceId (string $sequenceName)
 string limit (string $sql, integer $count, [integer $offset = 0])
 array listTables ()
 integer nextSequenceId (string $sequenceName)
 void setFetchMode (integer $mode)
 void _commit ()
 void _connect ()
 void _rollBack ()
 void _setExecuteMode (integer $mode)
Variables
array $_config = array(
'dbname' => null,
'username' => null,
'password' => null,
'host' => 'localhost',
'port' => '50000',
'protocol' => 'TCPIP',
'persistent' => false
)
(line 57)

User-provided configuration.

Basic keys are:

username => (string) Connect to the database as this username. password => (string) Password associated with the username. host => (string) What host to connect to (default 127.0.0.1) dbname => (string) The name of the database to user protocol => (string) Protocol to use, defaults to "TCPIP" port => (integer) Port number to use for TCP/IP if protocol is "TCPIP" persistent => (boolean) Set TRUE to use a persistent connection (db2_pconnect)

  • access: protected

Redefinition of:
Zend_Db_Adapter_Abstract::$_config
User-provided configuration
int $_execute_mode = DB2_AUTOCOMMIT_ON (line 73)

Execution mode

  • var: execution flag (DB2_AUTOCOMMIT_ON or DB2_AUTOCOMMIT_OFF)
  • access: protected
string $_lastInsertTable = null (line 83)

Table name of the last accessed table for an insert operation This is a DB2-Adapter-specific member variable with the utmost probability you might not find it in other adapters...

  • access: protected

Inherited Variables

Inherited from Zend_Db_Adapter_Abstract

Zend_Db_Adapter_Abstract::$_connection
Zend_Db_Adapter_Abstract::$_fetchMode
Zend_Db_Adapter_Abstract::$_profiler
Methods
Constructor __construct (line 102)

Constructor.

$config is an array of key/value pairs containing configuration options. These options are common to most adapters:

dbname => (string) The name of the database to user username => (string) Connect to the database as this username. password => (string) Password associated with the username. host => (string) What host to connect to, defaults to localhost port => (string) The port of the database, defaults to 50000 persistent => (boolean) Whether to use a persistent connection or not, defaults to false protocol => (string) The network protocol, defaults to TCPIP options => (array) Other database options such as autocommit, case, and cursor options

  • access: public
Zend_Db_Adapter_Db2 __construct ( $config)
  • array $config: An array of configuration keys.

Redefinition of:
Zend_Db_Adapter_Abstract::__construct()
Constructor.
closeConnection (line 199)

Force the connection to close.

  • access: public
void closeConnection ()

Redefinition of:
Zend_Db_Adapter_Abstract::closeConnection()
Force the connection to close.
describeTable (line 309)

Returns the column descriptions for a table.

The return value is an associative array keyed by the column name, as returned by the RDBMS.

The value of each array element is an associative array with the following keys:

SCHEMA_NAME => string; name of database or schema TABLE_NAME => string; COLUMN_NAME => string; column name COLUMN_POSITION => number; ordinal position of column in table DATA_TYPE => string; SQL datatype name of column DEFAULT => string; default expression of column, null if none NULLABLE => boolean; true if column can have nulls LENGTH => number; length of CHAR/VARCHAR SCALE => number; scale of NUMERIC/DECIMAL PRECISION => number; precision of NUMERIC/DECIMAL UNSIGNED => boolean; unsigned property of an integer type PRIMARY => boolean; true if column is part of the primary key PRIMARY_POSITION => integer; position of column in primary key

  • access: public
  • todo: Discover integer unsigned property.
array describeTable (string $tableName, [string $schemaName = null])
  • string $tableName
  • string $schemaName: OPTIONAL

Redefinition of:
Zend_Db_Adapter_Abstract::describeTable()
Returns the column descriptions for a table.
getQuoteIdentifierSymbol (line 250)
  • access: public
string getQuoteIdentifierSymbol ()

Redefinition of:
Zend_Db_Adapter_Abstract::getQuoteIdentifierSymbol()
Returns the symbol the adapter uses for delimited identifiers.
lastInsertId (line 414)

Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT column.

As a convention, on RDBMS brands that support sequences (e.g. Oracle, PostgreSQL, DB2), this method forms the name of a sequence from the arguments and returns the last id generated by that sequence. On RDBMS brands that support IDENTITY/AUTOINCREMENT columns, this method returns the last value generated for such a column, and the table name argument is disregarded.

The IDENTITY_VAL_LOCAL() function gives the last generated identity value in the current process, even if it was for a GENERATED column.

  • access: public
  • throws: Zend_Db_Adapter_Db2_Exception
integer lastInsertId ([string $tableName = null], [string $primaryKey = 'id'])
  • string $tableName: OPTIONAL
  • string $primaryKey: OPTIONAL

Redefinition of:
Zend_Db_Adapter_Abstract::lastInsertId()
Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT column.
lastSequenceId (line 361)

Return the most recent value from the specified sequence in the database.

This is supported only on RDBMS brands that support sequences (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null.

  • access: public
  • throws: Zend_Db_Adapter_Db2_Exception
integer lastSequenceId (string $sequenceName)
  • string $sequenceName

Redefinition of:
Zend_Db_Adapter_Abstract::lastSequenceId()
Return the most recent value from the specified sequence in the database.
limit (line 507)

Adds an adapter-specific LIMIT clause to the SELECT statement.

  • access: public
string limit (string $sql, integer $count, integer $offset)
  • string $sql
  • integer $count
  • integer $offset: OPTIONAL

Redefinition of:
Zend_Db_Adapter_Abstract::limit()
Adds an adapter-specific LIMIT clause to the SELECT statement.
listTables (line 262)

Returns a list of the tables in the database.

  • access: public
array listTables ()

Redefinition of:
Zend_Db_Adapter_Abstract::listTables()
Returns a list of the tables in the database.
nextSequenceId (line 383)

Generate a new value from the specified sequence in the database, and return it.

This is supported only on RDBMS brands that support sequences (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null.

  • access: public
  • throws: Zend_Db_Adapter_Db2_Exception
integer nextSequenceId (string $sequenceName)
  • string $sequenceName

Redefinition of:
Zend_Db_Adapter_Abstract::nextSequenceId()
Generate a new value from the specified sequence in the database, and return it.
prepare (line 211)

Returns an SQL statement for preparation.

  • access: public
Zend_Db_Statement_Db2 prepare (string $sql)
  • string $sql: The SQL statement with placeholders.

Redefinition of:
Zend_Db_Adapter_Abstract::prepare()
Prepare a statement and return a PDOStatement-like object.
setFetchMode (line 484)

Set the fetch mode.

  • access: public
void setFetchMode (integer $mode)
  • integer $mode

Redefinition of:
Zend_Db_Adapter_Abstract::setFetchMode()
Set the fetch mode.
_beginTransaction (line 442)

Begin a transaction.

  • access: protected
void _beginTransaction ()

Redefinition of:
Zend_Db_Adapter_Abstract::_beginTransaction()
Begin a transaction.
_commit (line 452)

Commit a transaction.

  • access: protected
void _commit ()

Redefinition of:
Zend_Db_Adapter_Abstract::_commit()
Commit a transaction.
_connect (line 134)

Creates a connection resource.

  • access: protected
void _connect ()

Redefinition of:
Zend_Db_Adapter_Abstract::_connect()
Creates a connection to the database.
_getExecuteMode (line 224)

Gets the execution mode

  • return: the execution mode (DB2_AUTOCOMMIT_ON or DB2_AUTOCOMMIT_OFF)
  • access: public
int _getExecuteMode ()
_rollBack (line 468)

Rollback a transaction.

  • access: protected
void _rollBack ()

Redefinition of:
Zend_Db_Adapter_Abstract::_rollBack()
Roll-back a transaction.
_setExecuteMode (line 233)
  • access: public
void _setExecuteMode (integer $mode)
  • integer $mode

Inherited Methods

Inherited From Zend_Db_Adapter_Abstract

 Zend_Db_Adapter_Abstract::__construct()
 Zend_Db_Adapter_Abstract::beginTransaction()
 Zend_Db_Adapter_Abstract::closeConnection()
 Zend_Db_Adapter_Abstract::commit()
 Zend_Db_Adapter_Abstract::delete()
 Zend_Db_Adapter_Abstract::describeTable()
 Zend_Db_Adapter_Abstract::fetchAll()
 Zend_Db_Adapter_Abstract::fetchAssoc()
 Zend_Db_Adapter_Abstract::fetchCol()
 Zend_Db_Adapter_Abstract::fetchOne()
 Zend_Db_Adapter_Abstract::fetchPairs()
 Zend_Db_Adapter_Abstract::fetchRow()
 Zend_Db_Adapter_Abstract::getConnection()
 Zend_Db_Adapter_Abstract::getFetchMode()
 Zend_Db_Adapter_Abstract::getProfiler()
 Zend_Db_Adapter_Abstract::getQuoteIdentifierSymbol()
 Zend_Db_Adapter_Abstract::insert()
 Zend_Db_Adapter_Abstract::lastInsertId()
 Zend_Db_Adapter_Abstract::lastSequenceId()
 Zend_Db_Adapter_Abstract::limit()
 Zend_Db_Adapter_Abstract::listTables()
 Zend_Db_Adapter_Abstract::nextSequenceId()
 Zend_Db_Adapter_Abstract::prepare()
 Zend_Db_Adapter_Abstract::query()
 Zend_Db_Adapter_Abstract::quote()
 Zend_Db_Adapter_Abstract::quoteColumnAs()
 Zend_Db_Adapter_Abstract::quoteIdentifier()
 Zend_Db_Adapter_Abstract::quoteInto()
 Zend_Db_Adapter_Abstract::quoteTableAs()
 Zend_Db_Adapter_Abstract::rollBack()
 Zend_Db_Adapter_Abstract::select()
 Zend_Db_Adapter_Abstract::setFetchMode()
 Zend_Db_Adapter_Abstract::update()
 Zend_Db_Adapter_Abstract::_beginTransaction()
 Zend_Db_Adapter_Abstract::_commit()
 Zend_Db_Adapter_Abstract::_connect()
 Zend_Db_Adapter_Abstract::_quote()
 Zend_Db_Adapter_Abstract::_quoteIdentifier()
 Zend_Db_Adapter_Abstract::_quoteIdentifierAs()
 Zend_Db_Adapter_Abstract::_rollBack()

Documentation generated on Fri, 06 Apr 2007 18:17:36 -0700 by phpDocumentor 1.3.1