Documentation

OCI8Connection
in package
implements Connection, ServerInfoAwareConnection

OCI8 implementation of the Connection interface.

Tags
since
2.0

Interfaces, Classes and Traits

Connection
Connection interface.
ServerInfoAwareConnection
Contract for a connection that is able to provide information about the server it is connected to.

Table of Contents

$dbh  : resource
$executeMode  : int
__construct()  : mixed
Creates a Connection to an Oracle Database using oci8 extension.
beginTransaction()  : bool
Initiates a transaction.
commit()  : bool
Commits a transaction.
errorCode()  : string|null
Returns the error code associated with the last operation on the database handle.
errorInfo()  : array<string|int, mixed>
Returns extended error information associated with the last operation on the database handle.
exec()  : int
Executes an SQL statement and return the number of affected rows.
getExecuteMode()  : int
Returns the current execution mode.
getServerVersion()  : string
Returns the version number of the database server connected to.
lastInsertId()  : string
Returns the ID of the last inserted row or sequence value.
prepare()  : Statement
Prepares a statement for execution and returns a Statement object.
query()  : Statement
Executes an SQL statement, returning a result set as a Statement object.
quote()  : string
Quotes a string for use in a query.
requiresQueryForServerVersion()  : bool
Checks whether a query is required to retrieve the database server version.
rollBack()  : bool
Rolls back the current transaction, as initiated by beginTransaction().

Properties

Methods

__construct()

Creates a Connection to an Oracle Database using oci8 extension.

public __construct(string $username, string $password, string $db[, string|null $charset = null ][, int $sessionMode = OCI_DEFAULT ][, bool $persistent = false ]) : mixed
Parameters
$username : string
$password : string
$db : string
$charset : string|null = null
$sessionMode : int = OCI_DEFAULT
$persistent : bool = false
Tags
throws
OCI8Exception
Return values
mixed

beginTransaction()

Initiates a transaction.

public beginTransaction() : bool
Return values
bool

TRUE on success or FALSE on failure.

commit()

Commits a transaction.

public commit() : bool
Return values
bool

TRUE on success or FALSE on failure.

errorCode()

Returns the error code associated with the last operation on the database handle.

public errorCode() : string|null
Return values
string|null

The error code, or null if no operation has been run on the database handle.

errorInfo()

Returns extended error information associated with the last operation on the database handle.

public errorInfo() : array<string|int, mixed>
Return values
array<string|int, mixed>

exec()

Executes an SQL statement and return the number of affected rows.

public exec(mixed $statement) : int
Parameters
$statement : mixed
Return values
int

getExecuteMode()

Returns the current execution mode.

public getExecuteMode() : int
Return values
int

getServerVersion()

Returns the version number of the database server connected to.

public getServerVersion() : string
Tags
throws
UnexpectedValueException

if the version string returned by the database server does not contain a parsable version number.

Return values
string

lastInsertId()

Returns the ID of the last inserted row or sequence value.

public lastInsertId([mixed $name = null ]) : string
Parameters
$name : mixed = null
Return values
string

prepare()

Prepares a statement for execution and returns a Statement object.

public prepare(mixed $prepareString) : Statement
Parameters
$prepareString : mixed
Return values
Statement

quote()

Quotes a string for use in a query.

public quote(mixed $value[, mixed $type = PDO::PARAM_STR ]) : string
Parameters
$value : mixed
$type : mixed = PDO::PARAM_STR
Return values
string

requiresQueryForServerVersion()

Checks whether a query is required to retrieve the database server version.

public requiresQueryForServerVersion() : bool
Return values
bool

True if a query is required to retrieve the database server version, false otherwise.

rollBack()

Rolls back the current transaction, as initiated by beginTransaction().

public rollBack() : bool
Return values
bool

TRUE on success or FALSE on failure.

Search results