Overview

Packages

  • Auth
  • Config
  • Controller
  • Date
  • Db
  • Feed
    • Abstract
    • Writers
  • File
    • Decorator
  • Form
    • Element
  • Image
  • Log
    • Writer
  • Net
    • Exception
    • REST
  • None
  • PHP
  • PHPMailer
  • Session
  • Util
  • Validate
    • Validator
  • Zend
    • Db
      • Adapter
      • Expr
      • Profiler
      • Select
      • Statement
      • Table
    • Loader
      • Autoloader
      • PluginLoader
    • Registry

Classes

  • Zend_Db_Adapter_Abstract
  • Zend_Db_Adapter_Db2
  • Zend_Db_Adapter_Mysqli
  • Zend_Db_Adapter_Oracle
  • Zend_Db_Adapter_Pdo_Abstract
  • Zend_Db_Adapter_Pdo_Ibm
  • Zend_Db_Adapter_Pdo_Ibm_Db2
  • Zend_Db_Adapter_Pdo_Ibm_Ids
  • Zend_Db_Adapter_Pdo_Mssql
  • Zend_Db_Adapter_Pdo_Mysql
  • Zend_Db_Adapter_Pdo_Oci
  • Zend_Db_Adapter_Pdo_Pgsql
  • Zend_Db_Adapter_Pdo_Sqlite
  • Zend_Db_Adapter_Sqlsrv

Exceptions

  • Zend_Db_Adapter_Db2_Exception
  • Zend_Db_Adapter_Exception
  • Zend_Db_Adapter_Mysqli_Exception
  • Zend_Db_Adapter_Oracle_Exception
  • Zend_Db_Adapter_Sqlsrv_Exception
  • Overview
  • Package
  • Class
  • Tree

Class Zend_Db_Adapter_Db2

Zend_Db_Adapter_Abstract
Extended by Zend_Db_Adapter_Db2
Package: Zend\Db\Adapter
Copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
License: New BSD License
Located at Zend/Db/Adapter/Db2.php
Methods summary
protected
# _connect( )

Creates a connection resource.

Creates a connection resource.

public boolean
# isConnected( )

Test if a connection is active

Test if a connection is active

Returns

boolean
public
# closeConnection( )

Force the connection to close.

Force the connection to close.

public Zend_Db_Statement_Db2
# prepare( string $sql )

Returns an SQL statement for preparation.

Returns an SQL statement for preparation.

Parameters

$sql
string
The SQL statement with placeholders.

Returns

Zend_Db_Statement_Db2
public integer
# _getExecuteMode( )

Gets the execution mode

Gets the execution mode

Returns

integer
the execution mode (DB2_AUTOCOMMIT_ON or DB2_AUTOCOMMIT_OFF)
public
# _setExecuteMode( integer $mode )

Parameters

$mode
integer
protected string
# _quote( string $value )

Quote a raw string.

Quote a raw string.

Parameters

$value
string
Raw string

Returns

string
Quoted string
public string
# getQuoteIdentifierSymbol( )

Returns

string
public array
# listTables( string $schema = null )

Returns a list of the tables in the database.

Returns a list of the tables in the database.

Parameters

$schema
string
OPTIONAL

Returns

array
public array
# describeTable( string $tableName, string $schemaName = null )

Returns the column descriptions for a table.

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 DB2 not supports UNSIGNED integer. PRIMARY => boolean; true if column is part of the primary key PRIMARY_POSITION => integer; position of column in primary key IDENTITY => integer; true if column is auto-generated with unique values

Parameters

$tableName
string
$schemaName
string
OPTIONAL

Returns

array
public string
# lastSequenceId( string $sequenceName )

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.

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.

Parameters

$sequenceName
string

Returns

string
public string
# nextSequenceId( string $sequenceName )

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.

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.

Parameters

$sequenceName
string

Returns

string
public string
# lastInsertId( string $tableName = null, string $primaryKey = null, string $idType = null )

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

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.

Parameters

$tableName
string
OPTIONAL
$primaryKey
string
OPTIONAL
$idType
string
OPTIONAL used for i5 platform to define sequence/idenity unique value

Returns

string
protected
# _beginTransaction( )

Begin a transaction.

Begin a transaction.

protected
# _commit( )

Commit a transaction.

Commit a transaction.

protected
# _rollBack( )

Rollback a transaction.

Rollback a transaction.

public
# setFetchMode( integer $mode )

Set the fetch mode.

Set the fetch mode.

Parameters

$mode
integer

Throws

Zend_Db_Adapter_Db2_Exception
public string
# limit( string $sql, integer $count, integer $offset = 0 )

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

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

Parameters

$sql
string
$count
integer
$offset
integer
OPTIONAL

Returns

string
public boolean
# supportsParameters( string $type )

Check if the adapter supports real SQL parameters.

Check if the adapter supports real SQL parameters.

Parameters

$type
string
'positional' or 'named'

Returns

boolean
public string
# getServerVersion( )

Retrieve server version in PHP style

Retrieve server version in PHP style

Returns

string
public boolean
# isI5( )

Return whether or not this is running on i5

Return whether or not this is running on i5

Returns

boolean
protected
# _determineI5( )

Check the connection parameters according to verify type of used OS

Check the connection parameters according to verify type of used OS

protected array
# _i5listTables( $schema = null )

Db2 On I5 specific method

Db2 On I5 specific method

Returns a list of the tables in the database . Used only for DB2/400.

Returns

array
protected
# _i5LastInsertId( $objectName = null, $idType = null )
Methods inherited from Zend_Db_Adapter_Abstract
__construct(), __sleep(), __wakeup(), _checkRequiredOptions(), _quoteIdentifier(), _quoteIdentifierAs(), _whereExpr(), beginTransaction(), commit(), delete(), fetchAll(), fetchAssoc(), fetchCol(), fetchOne(), fetchPairs(), fetchRow(), foldCase(), getConfig(), getConnection(), getFetchMode(), getProfiler(), getStatementClass(), insert(), query(), quote(), quoteColumnAs(), quoteIdentifier(), quoteInto(), quoteTableAs(), rollBack(), select(), setProfiler(), setStatementClass(), update()
Properties summary
protected array $_config array( 'dbname' => null, 'username' => null, 'password' => null, 'host' => 'localhost', 'port' => '50000', 'protocol' => 'TCPIP', 'persistent' => false, 'os' => null, 'schema' => null )
#

User-provided configuration.

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) os => (string) This should be set to 'i5' if the db is on an os400/i5 schema => (string) The default schema the connection should use

protected integer $_execute_mode DB2_AUTOCOMMIT_ON
#

Execution mode

Execution mode

protected string $_defaultStmtClass 'Zend_Db_Statement_Db2'
#

Default class name for a DB statement.

Default class name for a DB statement.

protected boolean $_isI5 false
#
protected array $_numericDataTypes array( Zend_Db::INT_TYPE => Zend_Db::INT_TYPE, Zend_Db::BIGINT_TYPE => Zend_Db::BIGINT_TYPE, Zend_Db::FLOAT_TYPE => Zend_Db::FLOAT_TYPE, 'INTEGER' => Zend_Db::INT_TYPE, 'SMALLINT' => Zend_Db::INT_TYPE, 'BIGINT' => Zend_Db::BIGINT_TYPE, 'DECIMAL' => Zend_Db::FLOAT_TYPE, 'NUMERIC' => Zend_Db::FLOAT_TYPE )
#

Keys are UPPERCASE SQL datatypes or the constants Zend_Db::INT_TYPE, Zend_Db::BIGINT_TYPE, or Zend_Db::FLOAT_TYPE.

Keys are UPPERCASE SQL datatypes or the constants Zend_Db::INT_TYPE, Zend_Db::BIGINT_TYPE, or Zend_Db::FLOAT_TYPE.

Values are: 0 = 32-bit integer 1 = 64-bit integer 2 = float or decimal

Properties inherited from Zend_Db_Adapter_Abstract
$_allowSerialization, $_autoQuoteIdentifiers, $_autoReconnectOnUnserialize, $_caseFolding, $_connection, $_defaultProfilerClass, $_fetchMode, $_profiler
Pry Framework API documentation generated by ApiGen 2.6.1