class SQLAnywhereConnection implements Connection, ServerInfoAwareConnection (View source)

SAP Sybase SQL Anywhere implementation of the Connection interface.

Methods

__construct(string $dsn, bool $persistent = false)

Connects to database with given connection string.

beginTransaction()

Initiates a transaction.

commit()

Commits a transaction.

exec(string $statement)

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

string
getServerVersion()

Returns the version number of the database server connected to.

string
lastInsertId(string|null $name = null)

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

prepare(string $sql)

Prepares a statement for execution and returns a Statement object.

query(string $sql)

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

quote(string $input)

Quotes a string for use in a query.

bool
requiresQueryForServerVersion()

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

rollBack()

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

Details

__construct(string $dsn, bool $persistent = false)

Connects to database with given connection string.

Parameters

string $dsn The connection string.
bool $persistent Whether or not to establish a persistent connection.

Exceptions

SQLAnywhereException

beginTransaction()

Initiates a transaction.

Exceptions

DriverException

commit()

Commits a transaction.

Exceptions

DriverException

exec(string $statement)

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

Parameters

string $statement

Exceptions

DBALException

string getServerVersion()

Returns the version number of the database server connected to.

Return Value

string

string lastInsertId(string|null $name = null)

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

Parameters

string|null $name

Return Value

string

prepare(string $sql)

Prepares a statement for execution and returns a Statement object.

Parameters

string $sql

query(string $sql)

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

Parameters

string $sql

Exceptions

DBALException

quote(string $input)

Quotes a string for use in a query.

Parameters

string $input

bool requiresQueryForServerVersion()

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

Return Value

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().

Exceptions

DriverException