## Zend_Db_Adapter_Db2

Description

- author: Joscha Feth <jffeth@de.ibm.com>
- author: Salvador Ledezma <ledezma@us.ibm.com>
- license: Zend
- copyright: Copyright (c) 2005-2006 Zend Technologies Inc. (http://www.zend.com)

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

    Zend_Db_Adapter_Abstract
       |
       --Zend_Db_Adapter_Db2

Variable Summary
array $_config
int $_execute_mode
string $_lastInsertTable
Method Summary
Zend_Db_Adapter_Db2 __construct (array $config)
array describeTable (mixed $table)
string fetchAssoc (string $sql, [array $bind = null])
int insert (string $table, array $bind)
integer lastInsertId ([string $tableName = null], [string $primaryKey = null])
string limit ( $sql, $count, $offset)
array listTables ()
Zend_Db_Statement_Db2 prepare (string $sql)
string quoteIdentifier ( $string, string $ident)
void setFetchMode (integer $mode)
int update (string $table, array $bind, string $where)
void _beginTransaction ()
void _commit ()
void _connect ()
int _getExecuteMode ()
string _quote (string $value)
void _rollBack ()
void _setExecuteMode ( $mode)
Variables
array $_config = array(
'dbname' => null,
'username' => null,
'password' => null,
'host' => 'localhost',
'port' => '50000',
'protocol' => 'TCPIP',
'persistent' => false
) (line 58)

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 74)

Execution mode

- var: execution flag (DB2_AUTOCOMMIT_ON or DB2_AUTOCOMMIT_OFF)
- access: protected

string $_lastInsertTable = null (line 84)

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 105)

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

- array $config: An array of configuration keys.

Redefinition of:

Zend_Db_Adapter_Abstract::__construct()
  Constructor.

describeTable (line 280)

Returns the column descriptions for a table.

- access: public

array describeTable (mixed $table)

Redefinition of:

Zend_Db_Adapter_Abstract::describeTable()
  Returns the column descriptions for a table.

fetchAssoc (line 514)

Fetches all SQL result rows as an associative array.

The first column is the key, the entire row array is the value.

- access: public

string fetchAssoc (string $sql, [array $bind = null])

- string $sql: An SQL SELECT statement.
- array $bind: Data to bind into SELECT placeholders.

Redefinition of:

Zend_Db_Adapter_Abstract::fetchAssoc()
  Fetches all SQL result rows as an associative array.

insert (line 434)

Inserts a table row with specified data.

- return: The number of affected rows.
- access: public

int insert (string $table, array $bind)

- string $table: The table to insert data into.
- array $bind: Column-value pairs.

Redefinition of:

Zend_Db_Adapter_Abstract::insert()
  Inserts a table row with specified data.

lastInsertId (line 312)

Gets the last inserted ID.

- access: public
- todo: can we skip the select COLNAME query, if primaryKey is available?

integer lastInsertId ([string $tableName = null], [string $primaryKey = null])

- string $tableName: name of table associated with sequence
- string $primaryKey: primary key in $tableName (not used in this adapter)

Redefinition of:

Zend_Db_Adapter_Abstract::lastInsertId()
  Gets the last inserted ID.

limit (line 403)

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

- access: public

string limit ( $sql, $count, $offset)

- $sql
- $count
- $offset

Redefinition of:

Zend_Db_Adapter_Abstract::limit()
  Adds an adapter-specific LIMIT clause to the SELECT statement.

listTables (line 258)

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.

prepare (line 195)

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.

quoteIdentifier (line 246)

Quotes an identifier.

- return: The quoted identifier.
- access: public

string quoteIdentifier ( $string, string $ident)

- string $ident: The identifier.
- $string

Redefinition of:

Zend_Db_Adapter_Abstract::quoteIdentifier()
  Quotes an identifier.

setFetchMode (line 383)

Set the fetch mode.

- access: public

void setFetchMode (integer $mode)

- integer $mode

Redefinition of:

Zend_Db_Adapter_Abstract::setFetchMode()
  Set the fetch mode.

update (line 480)

Updates table rows with specified data based on a WHERE clause.

- return: The number of affected rows.
- access: public

int update (string $table, array $bind, string $where)

- string $table: The table to udpate.
- array $bind: Column-value pairs.
- string $where: UPDATE WHERE clause.

Redefinition of:

Zend_Db_Adapter_Abstract::update()
  Updates table rows with specified data based on a WHERE clause.

_beginTransaction (line 348)

Begin a transaction.

- access: protected

void _beginTransaction ()

Redefinition of:

Zend_Db_Adapter_Abstract::_beginTransaction()
  Begin a transaction.

_commit (line 356)

Commit a transaction.

- access: protected

void _commit ()

Redefinition of:

Zend_Db_Adapter_Abstract::_commit()
  Commit a transaction.

_connect (line 137)

Creates a connection resource.

- access: protected

void _connect ()

Redefinition of:

Zend_Db_Adapter_Abstract::_connect()
  Creates a connection to the database.

_getExecuteMode (line 208)

Gets the execution mode

- return: the execution mode (DB2_AUTOCOMMIT_ON or DB2_AUTOCOMMIT_OFF)
- access: public

int _getExecuteMode ()
_quote (line 233)

Quote a raw string

- return: Quoted string
- access: protected

string _quote (string $value)

- string $value: Raw string

Redefinition of:

Zend_Db_Adapter_Abstract::_quote()
  Quote a raw string.

_rollBack (line 369)

Roll-back a transaction.

- access: protected

void _rollBack ()

Redefinition of:

Zend_Db_Adapter_Abstract::_rollBack()
  Roll-back a transaction.

_setExecuteMode (line 213)

- access: public

void _setExecuteMode ( $mode)

- $mode

#### Inherited Methods

Inherited From Zend_Db_Adapter_Abstract

> Zend_Db_Adapter_Abstract::__construct()
> Zend_Db_Adapter_Abstract::beginTransaction()
> 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::insert()
> Zend_Db_Adapter_Abstract::lastInsertId()
> Zend_Db_Adapter_Abstract::limit()
> Zend_Db_Adapter_Abstract::listTables()
> Zend_Db_Adapter_Abstract::prepare()
> Zend_Db_Adapter_Abstract::query()
> Zend_Db_Adapter_Abstract::quote()
> Zend_Db_Adapter_Abstract::quoteIdentifier()
> Zend_Db_Adapter_Abstract::quoteInto()
> 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::_rollBack()

Documentation generated on Tue, 11 Jul 2006 12:16:51 -0500 by phpDocumentor 1.3.0RC6