class OCI8Connection implements Connection, ServerInfoAwareConnection (View source)

OCI8 implementation of the Connection interface.

Properties

protected resource $dbh
protected integer $executeMode

Methods

__construct(string $username, string $password, string $db, string|null $charset = null, integer $sessionMode = OCI_DEFAULT, boolean $persistent = false)

Creates a Connection to an Oracle Database using oci8 extension.

string
getServerVersion()

Returns the version number of the database server connected to.

boolean
requiresQueryForServerVersion()

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

prepare(string $prepareString)

Prepares a statement for execution and returns a Statement object.

query()

Executes an SQL statement, returning a result set as a Statement object.

mixed
quote($value, integer $type = \PDO::PARAM_STR)

Quotes a string for use in a query.

integer
exec(string $statement)

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

string
lastInsertId(string|null $name = null)

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

integer
getExecuteMode()

Returns the current execution mode.

boolean
beginTransaction()

Initiates a transaction.

boolean
commit()

Commits a transaction.

boolean
rollBack()

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

string|null
errorCode()

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

array
errorInfo()

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

Details

__construct(string $username, string $password, string $db, string|null $charset = null, integer $sessionMode = OCI_DEFAULT, boolean $persistent = false)

Creates a Connection to an Oracle Database using oci8 extension.

Parameters

string $username
string $password
string $db
string|null $charset
integer $sessionMode
boolean $persistent

Exceptions

OCI8Exception

string getServerVersion()

Returns the version number of the database server connected to.

Return Value

string

boolean requiresQueryForServerVersion()

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

Return Value

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

Statement prepare(string $prepareString)

Prepares a statement for execution and returns a Statement object.

Parameters

string $prepareString

Return Value

Statement

Statement query()

Executes an SQL statement, returning a result set as a Statement object.

Return Value

Statement

mixed quote($value, integer $type = \PDO::PARAM_STR)

Quotes a string for use in a query.

Parameters

$value
integer $type

Return Value

mixed

integer exec(string $statement)

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

Parameters

string $statement

Return Value

integer

string lastInsertId(string|null $name = null)

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

Parameters

string|null $name

Return Value

string

integer getExecuteMode()

Returns the current execution mode.

Return Value

integer

boolean beginTransaction()

Initiates a transaction.

Return Value

boolean TRUE on success or FALSE on failure.

boolean commit()

Commits a transaction.

Return Value

boolean TRUE on success or FALSE on failure.

boolean rollBack()

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

Return Value

boolean TRUE on success or FALSE on failure.

string|null errorCode()

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

Return Value

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

array errorInfo()

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

Return Value

array