do a connection to the database, using properties of the given profile
jDbConnection
__construct
(array $profile)
-
array
$profile: profile properties
Redefined in descendants as:
void
__destruct
()
Redefined in descendants as:
begin a transaction. Call it before query, limitQuery, exec
And then commit() or rollback()
void
beginTransaction
()
Redefined in descendants as:
validate all queries and close a transaction
void
commit
()
Redefined in descendants as:
void
encloseFieldName
( $fieldName)
enclose the field name
string
encloseName
(string $fieldName)
-
string
$fieldName: the field name
Redefined in descendants as:
integer
errorCode
()
Redefined in descendants as:
string
errorInfo
()
Redefined in descendants as:
Launch a SQL Query (update, delete..) which doesn't return rows
integer
exec
(string $query)
-
string
$query: the SQL query
Not implemented
string
getAttribute
(integer $id)
-
integer
$id: the attribut id
Check if the current connection has a table prefix set
boolean
hasTablePrefix
()
void
lastIdInTable
( $fieldName, $tableName)
return the id value of the last inserted row.
Some driver need a sequence name, so give it at first parameter
integer
lastInsertId
([string $fromSequence = ''])
-
string
$fromSequence: the sequence name
Redefined in descendants as:
Launch a SQL Query with limit parameter (so only a subset of a result)
jDbResultSet|boolean
limitQuery
(
string $queryString,
integer $limitOffset,
integer $limitCount)
-
string
$queryString: the SQL query
-
integer
$limitOffset: the offset of the first row to return
-
integer
$limitCount: the maximum of number of rows to return
Prefix the given table with the prefix specified in the connection's profile If there's no prefix for the connection's profile, return the table's name unchanged.
string
prefixTable
( $table_name, string $table)
-
string
$table: the table's name
-
$table_name
prepare a query
statement
prepare
(string $query)
-
string
$query: a sql query with parameters
Redefined in descendants as:
Launch a SQL Query which returns rows (typically, a SELECT statement)
jDbResultSet|boolean
query
(
string $queryString, [
integer $fetchmode =
self::FETCH_OBJ], [
$arg1 =
null], [
array $ctoargs =
null],
string|object $param)
-
string
$queryString: the SQL query
-
integer
$fetchmode: FETCH_OBJ, FETCH_CLASS or FETCH_INTO
-
string|object
$param: class name if FETCH_CLASS, an object if FETCH_INTO. else null.
-
array
$ctoargs: arguments for the constructor if FETCH_CLASS
-
$arg1
Escape and quotes strings. if null, will only return the text "NULL"
string
quote
(string $text, [boolean $checknull = true], [ $binary = false])
-
string
$text: string to quote
-
boolean
$checknull: if true, check if $text is a null value, and then return NULL
-
$binary
cancel all queries of a transaction and close the transaction
void
rollback
()
Redefined in descendants as:
Not implemented
void
setAttribute
(integer $id, string $value)
-
integer
$id: the attribut id
-
string
$value: the attribute value
sets the autocommit state
void
setAutoCommit
([boolean $state = true])
-
boolean
$state: state the status of autocommit
Notify the changes on autocommit
Drivers may overload this
void
_autoCommitNotify
(boolean $state)
-
boolean
$state: state the new state of autocommit
Redefined in descendants as:
return a connection identifier or false/null if there is an error
integer
_connect
()
Redefined in descendants as:
do a disconnection
(no need to do a test on the connection id)
void
_disconnect
()
Redefined in descendants as:
do a query which return nothing
jDbResultSet/boolean
_doExec
( $queryString)
Redefined in descendants as:
do a query which return a limited number of results
jDbResultSet/boolean
_doLimitQuery
( $queryString, $offset, $number)
-
$queryString
-
$offset
-
$number
Redefined in descendants as:
do a query which return results
jDbResultSet/boolean
_doQuery
( $queryString)
Redefined in descendants as:
do the escaping of a string.
you should override it into the driver
void
_quote
(string $text, boolean $binary)
-
string
$text: the text to escape
-
boolean
$binary: true if the content of the string is a binary content
Redefined in descendants as: