class JDatabaseDriverOracle extends JDatabaseDriverPdo

Oracle database driver

Properties

string $name The name of the database driver.
string $serverType The type of the database server family supported by this driver.

Methods

mixed
query()

Execute the SQL statement.

from JDatabase
static  array
getConnectors()

Get a list of available database connectors. The list will only be populated with connectors that both the class exists and the static test method returns true. This gives us the ability to have a multitude of connector classes that are self-aware as to whether or not they are able to be used on a given system.

string
getErrorMsg( boolean $escaped = false)

Gets the error message from the database connection.

from JDatabase
integer
getErrorNum()

Gets the error number from the database connection.

from JDatabase
static  JDatabaseDriver
getInstance( array $options = array())

Method to return a JDatabaseDriver instance based on the given options. There are three global options and then the rest are specific to the database driver. The 'driver' option defines which JDatabaseDriver class is used for the connection -- the default is 'mysqli'. The 'database' option determines which database is to be used for the connection. The 'select' option determines whether the connector should automatically select the chosen database.

static  array
splitSql( string $sql)

Splits a string of multiple queries into an array of individual queries.

string
stderr( boolean $showSQL = false)

Return the most recent error message for the database connector.

from JDatabase
static  boolean
test()

Test to see if the connector is available.

from JDatabase
mixed
__call( string $method, array $args)

Magic method to provide method alias support for quote() and quoteName().

__construct( array $options)

Constructor.

string
alterDbCharacterSet( string $dbName)

Alter database's character set, obtaining query string from protected member.

boolean
alterTableCharacterSet( string $tableName, boolean $rethrow = false)

Alter a table's character set, obtaining an array of queries to do so from a protected method. The conversion is wrapped in a transaction, if supported by the database driver. Otherwise the table will be locked before the conversion. This prevents data corruption.

void
connect()

Connects to the database if needed.

boolean
connected()

Determines if the connection to the server is active.

string
createDatabase( stdClass $options, boolean $utf = true)

Create a new database using information from $options object, obtaining query string from protected member.

__destruct()

Destructor.

void
disconnect()

Disconnects the database.

void
addDisconnectHandler( callable $callable)

Adds a function callable just before disconnecting the database. Parameter of the callable is $this JDatabaseDriver

dropTable( string $tableName, boolean $ifExists = true)

Drops a table from the database.

string
escape( string $text, boolean $extra = false)

Method to escape a string for usage in an SQL statement.

integer
getAffectedRows()

Get the number of affected rows for the previous executed SQL statement.

string
getAlterDbCharacterSet( string $dbName)

Return the query string to alter the database character set.

string[]
getAlterTableCharacterSet( string $tableName)

Get the query strings to alter the character set and collation of a table.

string
convertUtf8mb4QueryToUtf8( string $query)

Automatically downgrade a CREATE TABLE or ALTER TABLE query from utf8mb4 (UTF-8 Multibyte) to plain utf8. Used when the server doesn't support UTF-8 Multibyte.

mixed
getCollation()

Method to get the database collation in use by sampling a text field of a table in the database.

string
getConnectionCollation()

Method to get the database connection collation, as reported by the driver. If the connector doesn't support reporting this value please return an empty string.

resource
getConnection()

Method that provides access to the underlying database connection. Useful for when you need to call a proprietary method such as postgresql's lo_* methods.

integer
getCount()

Get the total number of SQL statements executed by the database driver.

string
getDateFormat()

Returns the current date format This method should be useful in the case that somebody actually wants to use a different date format and needs to check what the current one is to see if it needs to be changed.

array
getLog()

Get the database driver SQL statement log.

array
getTimings()

Get the database driver SQL statement log.

array
getCallStacks()

Get the database driver SQL statement log.

string
getMinimum()

Get the minimum supported database version.

string
getNullDate()

Get the null or zero representation of a timestamp for the database driver.

integer
getNumRows( resource $cursor = null)

Get the number of returned rows for the previous executed SQL statement.

string
getPrefix()

Get the common table prefix for the database driver.

getExporter()

Gets an exporter class object.

getImporter()

Gets an importer class object.

string
getName()

Get the name of the database driver. If $this->name is not set it will try guessing the driver name from the class name.

string
getServerType()

Get the server family type, e.g. mysql, postgresql, oracle, sqlite, mssql. If $this->serverType is not set it will attempt guessing the server family type from the driver name. If this is not possible the driver name will be returned instead.

getQuery( boolean $new = false)

Get the current query object or a new JDatabaseQuery object.

getIterator( string $column = null, string $class = 'stdClass')

Get a new iterator on the current query.

array
getTableColumns( string $table, boolean $typeOnly = true)

Retrieves field information about a given table.

array
getTableCreate( mixed $tables)

Shows the table CREATE statement that creates the given tables.

array
getTableKeys( string $table)

Get the details list of keys for a table.

array
getTableList( string $databaseName = null, boolean $includeDatabaseName = false)

Method to get an array of all tables in the database (schema).

boolean
getUTFSupport()

Determine whether or not the database engine supports UTF-8 character encoding.

boolean
hasUTFSupport()

Determine whether or not the database engine supports UTF-8 character encoding.

boolean
hasUTF8mb4Support()

Determine whether the database engine support the UTF-8 Multibyte (utf8mb4) character encoding. This applies to MySQL databases.

string
getVersion()

Get the version of the database connector.

mixed
insertid()

Method to get the auto-incremented value from the last INSERT statement.

boolean
insertObject( string $table, object $object, string $key = null)

Inserts a row into a table based on an object's properties.

boolean
isMinimumVersion()

Method to check whether the installed database version is supported by the database driver

mixed
loadAssoc()

Method to get the first row of the result set from the database query as an associative array of ['fieldname' => 'rowvalue'].

mixed
loadAssocList( string $key = null, string $column = null)

Method to get an array of the result set rows from the database query where each row is an associative array of ['fieldname' => 'rowvalue']. The array of rows can optionally be keyed by a field name, but defaults to a sequential numeric array.

mixed
loadColumn( integer $offset)

Method to get an array of values from the $offset field in each row of the result set from the database query.

mixed
loadNextObject( string $class = 'stdClass')

Method to get the next row in the result set from the database query as an object.

mixed
loadNextRow()

Method to get the next row in the result set from the database query as an array.

mixed
loadObject( string $class = 'stdClass')

Method to get the first row of the result set from the database query as an object.

mixed
loadObjectList( string $key = '', string $class = 'stdClass')

Method to get an array of the result set rows from the database query where each row is an object. The array of objects can optionally be keyed by a field name, but defaults to a sequential numeric array.

mixed
loadResult()

Method to get the first field of the first row of the result set from the database query.

mixed
loadRow()

Method to get the first row of the result set from the database query as an array. Columns are indexed numerically so the first column in the result set would be accessible via $row[0], etc.

mixed
loadRowList( integer $index = null)

Method to get an array of the result set rows from the database query where each row is an array. The array of objects can optionally be keyed by a field offset, but defaults to a sequential numeric array.

lockTable( string $table)

Locks a table in the database.

string|array
quote( mixed $text, boolean $escape = true)

Quotes and optionally escapes a string to database requirements for use in database queries.

mixed
quoteName( mixed $name, mixed $as = null)

Wrap an SQL statement identifier name such as column, table or database names in quotes to prevent injection risks and reserved word conflicts.

string
replacePrefix( string $query, string $prefix = '#__')

This function replaces a string identifier $prefix with the string held is the tablePrefix class variable.

renameTable( string $oldTable, string $newTable, string $backup = null, string $prefix = null)

Renames a table in the database.

boolean
select( string $database)

Select a database for use.

boolean
setDebug( boolean $level)

Sets the database debugging state for the driver.

setQuery( mixed $query, integer $offset = null, integer $limit = null, array $driverOptions = array())

Sets the SQL statement string for later execution.

boolean
setUtf()

Set the connection to use UTF-8 character encoding.

void
transactionCommit( boolean $toSavepoint = false)

Method to commit a transaction.

void
transactionRollback( boolean $toSavepoint = false)

Method to roll back a transaction.

void
transactionStart( boolean $asSavepoint = false)

Method to initialize a transaction.

void
truncateTable( string $table)

Method to truncate a table.

boolean
updateObject( string $table, object $object, array $key, boolean $nulls = false)

Updates a row in a table based on an object's properties.

mixed
execute()

Execute the SQL statement.

unlockTables()

Unlocks tables in the database.

string|array
q($text, $escape = true)

Alias for quote method

string|array
qn($name, $as = null)

Alias for quoteName method

mixed
getOption( mixed $key)

Retrieve a PDO database connection attribute

string
getConnectedQuery()

Get a query to run and verify the database is operational.

boolean
setOption( integer $key, mixed $value)

Sets an attribute on the PDO database handle.

static  boolean
isSupported()

Test to see if the PDO ODBC connector is available.

mixed
loadNextAssoc()

Method to get the next row in the result set from the database query as an array.

array
__sleep()

PDO does not support serialize

array
__wakeup()

Wake up after serialization

boolean
setDateFormat( string $dateFormat = 'DD-MON-RR')

Sets the Oracle Date Format for the session Default date format for Oracle is = DD-MON-RR The default date format for this driver is: 'RRRR-MM-DD HH24:MI:SS' since it is the format that matches the MySQL one used within most Joomla tables.

Details

mixed query()

Execute the SQL statement.

Return Value

mixed A database cursor resource on success, boolean false on failure.

Exceptions

RuntimeException

static array getConnectors()

Get a list of available database connectors. The list will only be populated with connectors that both the class exists and the static test method returns true. This gives us the ability to have a multitude of connector classes that are self-aware as to whether or not they are able to be used on a given system.

Return Value

array An array of available database connectors.

string getErrorMsg( boolean $escaped = false)

Gets the error message from the database connection.

Parameters

boolean $escaped True to escape the message string for use in JavaScript.

Return Value

string The error message for the most recent query.

integer getErrorNum()

Gets the error number from the database connection.

Return Value

integer The error number for the most recent query.

static JDatabaseDriver getInstance( array $options = array())

Method to return a JDatabaseDriver instance based on the given options. There are three global options and then the rest are specific to the database driver. The 'driver' option defines which JDatabaseDriver class is used for the connection -- the default is 'mysqli'. The 'database' option determines which database is to be used for the connection. The 'select' option determines whether the connector should automatically select the chosen database.

Instances are unique to the given options and new objects are only created when a unique options array is passed into the method. This ensures that we don't end up with unnecessary database connection resources.

Parameters

array $options Parameters to be passed to the database driver.

Return Value

JDatabaseDriver A database object.

Exceptions

RuntimeException

static array splitSql( string $sql)

Splits a string of multiple queries into an array of individual queries.

Single line or line end comments and multi line comments are stripped off.

Parameters

string $sql Input SQL string with which to split into individual queries.

Return Value

array The queries from the input string separated into an array.

string stderr( boolean $showSQL = false)

Return the most recent error message for the database connector.

Parameters

boolean $showSQL True to display the SQL statement sent to the database as well as the error.

Return Value

string The error message for the most recent query.

static boolean test()

Test to see if the connector is available.

Return Value

boolean True on success, false otherwise.

mixed __call( string $method, array $args)

Magic method to provide method alias support for quote() and quoteName().

Parameters

string $method The called method.
array $args The array of arguments passed to the method.

Return Value

mixed The aliased method's return value or null.

__construct( array $options)

Constructor.

Parameters

array $options List of options used to configure the connection

string alterDbCharacterSet( string $dbName)

Alter database's character set, obtaining query string from protected member.

Parameters

string $dbName The database name that will be altered

Return Value

string The query that alter the database query string

Exceptions

RuntimeException

boolean alterTableCharacterSet( string $tableName, boolean $rethrow = false)

Alter a table's character set, obtaining an array of queries to do so from a protected method. The conversion is wrapped in a transaction, if supported by the database driver. Otherwise the table will be locked before the conversion. This prevents data corruption.

Parameters

string $tableName The name of the table to alter
boolean $rethrow True to rethrow database exceptions. Default: false (exceptions are suppressed)

Return Value

boolean True if successful

Exceptions

RuntimeException If the table name is empty
Exception Relayed from the database layer if a database error occurs and $rethrow == true

void connect()

Connects to the database if needed.

Return Value

void Returns void if the database connected successfully.

Exceptions

RuntimeException

boolean connected()

Determines if the connection to the server is active.

Return Value

boolean True if connected to the database engine.

string createDatabase( stdClass $options, boolean $utf = true)

Create a new database using information from $options object, obtaining query string from protected member.

Parameters

stdClass $options Object used to pass user and database name to database driver. This object must have "dbname" and "dbuser" set.
boolean $utf True if the database supports the UTF-8 character set.

Return Value

string The query that creates database

Exceptions

RuntimeException

__destruct()

Destructor.

void disconnect()

Disconnects the database.

Return Value

void

void addDisconnectHandler( callable $callable)

Adds a function callable just before disconnecting the database. Parameter of the callable is $this JDatabaseDriver

Parameters

callable $callable Function to call in disconnect() method just before disconnecting from database

Return Value

void

JDatabaseDriver dropTable( string $tableName, boolean $ifExists = true)

Drops a table from the database.

Note: The IF EXISTS flag is unused in the Oracle driver.

Parameters

string $tableName The name of the database table to drop.
boolean $ifExists Optionally specify that the table must exist before it is dropped.

Return Value

JDatabaseDriver Returns this object to support chaining.

string escape( string $text, boolean $extra = false)

Method to escape a string for usage in an SQL statement.

Oracle escaping reference: http://www.orafaq.com/wiki/SQLFAQ#HowdoesoneescapespecialcharacterswhenwritingSQLqueries.3F

SQLite escaping notes: http://www.sqlite.org/faq.html#q14

Method body is as implemented by the Zend Framework

Note: Using query objects with bound variables is preferable to the below.

Parameters

string $text The string to be escaped.
boolean $extra Optional parameter to provide extra escaping.

Return Value

string The escaped string.

integer getAffectedRows()

Get the number of affected rows for the previous executed SQL statement.

Only applicable for DELETE, INSERT, or UPDATE statements.

Return Value

integer The number of affected rows.

string getAlterDbCharacterSet( string $dbName)

Return the query string to alter the database character set.

Parameters

string $dbName The database name

Return Value

string The query that alter the database query string

string[] getAlterTableCharacterSet( string $tableName)

Get the query strings to alter the character set and collation of a table.

Parameters

string $tableName The name of the table

Return Value

string[] The queries required to alter the table's character set and collation

string convertUtf8mb4QueryToUtf8( string $query)

Automatically downgrade a CREATE TABLE or ALTER TABLE query from utf8mb4 (UTF-8 Multibyte) to plain utf8. Used when the server doesn't support UTF-8 Multibyte.

Parameters

string $query The query to convert

Return Value

string The converted query

mixed getCollation()

Method to get the database collation in use by sampling a text field of a table in the database.

Return Value

mixed The collation in use by the database or boolean false if not supported.

string getConnectionCollation()

Method to get the database connection collation, as reported by the driver. If the connector doesn't support reporting this value please return an empty string.

Return Value

string

resource getConnection()

Method that provides access to the underlying database connection. Useful for when you need to call a proprietary method such as postgresql's lo_* methods.

Return Value

resource The underlying database connection resource.

integer getCount()

Get the total number of SQL statements executed by the database driver.

Return Value

integer

string getDateFormat()

Returns the current date format This method should be useful in the case that somebody actually wants to use a different date format and needs to check what the current one is to see if it needs to be changed.

Return Value

string The format string.

array getLog()

Get the database driver SQL statement log.

Return Value

array SQL statements executed by the database driver.

array getTimings()

Get the database driver SQL statement log.

Return Value

array SQL statements executed by the database driver.

array getCallStacks()

Get the database driver SQL statement log.

Return Value

array SQL statements executed by the database driver.

string getMinimum()

Get the minimum supported database version.

Return Value

string The minimum version number for the database driver.

string getNullDate()

Get the null or zero representation of a timestamp for the database driver.

Return Value

string Null or zero representation of a timestamp.

integer getNumRows( resource $cursor = null)

Get the number of returned rows for the previous executed SQL statement.

Only applicable for DELETE, INSERT, or UPDATE statements.

Parameters

resource $cursor An optional database cursor resource to extract the row count from.

Return Value

integer The number of returned rows.

string getPrefix()

Get the common table prefix for the database driver.

Return Value

string The common database table prefix.

JDatabaseExporter getExporter()

Gets an exporter class object.

Return Value

JDatabaseExporter An exporter object.

Exceptions

RuntimeException

JDatabaseImporter getImporter()

Gets an importer class object.

Return Value

JDatabaseImporter An importer object.

Exceptions

RuntimeException

string getName()

Get the name of the database driver. If $this->name is not set it will try guessing the driver name from the class name.

Return Value

string

string getServerType()

Get the server family type, e.g. mysql, postgresql, oracle, sqlite, mssql. If $this->serverType is not set it will attempt guessing the server family type from the driver name. If this is not possible the driver name will be returned instead.

Return Value

string

JDatabaseQuery getQuery( boolean $new = false)

Get the current query object or a new JDatabaseQuery object.

Parameters

boolean $new False to return the current query object, True to return a new JDatabaseQuery object.

Return Value

JDatabaseQuery The current query object or a new object extending the JDatabaseQuery class.

Exceptions

RuntimeException

JDatabaseIterator getIterator( string $column = null, string $class = 'stdClass')

Get a new iterator on the current query.

Parameters

string $column An option column to use as the iterator key.
string $class The class of object that is returned.

Return Value

JDatabaseIterator A new database iterator.

Exceptions

RuntimeException

array getTableColumns( string $table, boolean $typeOnly = true)

Retrieves field information about a given table.

Parameters

string $table The name of the database table.
boolean $typeOnly True (default) to only return field types.

Return Value

array An array of fields by table.

Exceptions

RuntimeException

array getTableCreate( mixed $tables)

Shows the table CREATE statement that creates the given tables.

Note: You must have the correct privileges before this method will return usable results!

Parameters

mixed $tables A table name or a list of table names.

Return Value

array A list of the create SQL for the tables.

Exceptions

RuntimeException

array getTableKeys( string $table)

Get the details list of keys for a table.

Parameters

string $table The name of the table.

Return Value

array An array of keys for the table.

Exceptions

RuntimeException

array getTableList( string $databaseName = null, boolean $includeDatabaseName = false)

Method to get an array of all tables in the database (schema).

Parameters

string $databaseName The database (schema) name
boolean $includeDatabaseName Whether to include the schema name in the results

Return Value

array An array of all the tables in the database.

Exceptions

RuntimeException

boolean getUTFSupport()

Determine whether or not the database engine supports UTF-8 character encoding.

Return Value

boolean True if the database engine supports UTF-8 character encoding.

boolean hasUTFSupport()

Determine whether or not the database engine supports UTF-8 character encoding.

Return Value

boolean True if the database engine supports UTF-8 character encoding.

boolean hasUTF8mb4Support()

Determine whether the database engine support the UTF-8 Multibyte (utf8mb4) character encoding. This applies to MySQL databases.

Return Value

boolean True if the database engine supports UTF-8 Multibyte.

string getVersion()

Get the version of the database connector.

Return Value

string The database connector version.

mixed insertid()

Method to get the auto-incremented value from the last INSERT statement.

Return Value

mixed The value of the auto-increment field from the last inserted row.

boolean insertObject( string $table, object $object, string $key = null)

Inserts a row into a table based on an object's properties.

Parameters

string $table The name of the database table to insert into.
object $object &$object A reference to an object whose public properties match the table fields.
string $key The name of the primary key. If provided the object property is updated.

Return Value

boolean True on success.

Exceptions

RuntimeException

boolean isMinimumVersion()

Method to check whether the installed database version is supported by the database driver

Return Value

boolean True if the database version is supported

mixed loadAssoc()

Method to get the first row of the result set from the database query as an associative array of ['fieldname' => 'rowvalue'].

Return Value

mixed The return value or null if the query failed.

Exceptions

RuntimeException

mixed loadAssocList( string $key = null, string $column = null)

Method to get an array of the result set rows from the database query where each row is an associative array of ['fieldname' => 'rowvalue']. The array of rows can optionally be keyed by a field name, but defaults to a sequential numeric array.

NOTE: Chosing to key the result array by a non-unique field name can result in unwanted behavior and should be avoided.

Parameters

string $key The name of a field on which to key the result array.
string $column An optional column name. Instead of the whole row, only this column value will be in the result array.

Return Value

mixed The return value or null if the query failed.

Exceptions

RuntimeException

mixed loadColumn( integer $offset)

Method to get an array of values from the $offset field in each row of the result set from the database query.

Parameters

integer $offset The row offset to use to build the result array.

Return Value

mixed The return value or null if the query failed.

Exceptions

RuntimeException

mixed loadNextObject( string $class = 'stdClass')

Method to get the next row in the result set from the database query as an object.

Parameters

string $class The class name to use for the returned row object.

Return Value

mixed The result of the query as an array, false if there are no more rows.

Exceptions

RuntimeException

mixed loadNextRow()

Method to get the next row in the result set from the database query as an array.

Return Value

mixed The result of the query as an array, false if there are no more rows.

Exceptions

RuntimeException

mixed loadObject( string $class = 'stdClass')

Method to get the first row of the result set from the database query as an object.

Parameters

string $class The class name to use for the returned row object.

Return Value

mixed The return value or null if the query failed.

Exceptions

RuntimeException

mixed loadObjectList( string $key = '', string $class = 'stdClass')

Method to get an array of the result set rows from the database query where each row is an object. The array of objects can optionally be keyed by a field name, but defaults to a sequential numeric array.

NOTE: Choosing to key the result array by a non-unique field name can result in unwanted behavior and should be avoided.

Parameters

string $key The name of a field on which to key the result array.
string $class The class name to use for the returned row objects.

Return Value

mixed The return value or null if the query failed.

Exceptions

RuntimeException

mixed loadResult()

Method to get the first field of the first row of the result set from the database query.

Return Value

mixed The return value or null if the query failed.

Exceptions

RuntimeException

mixed loadRow()

Method to get the first row of the result set from the database query as an array. Columns are indexed numerically so the first column in the result set would be accessible via $row[0], etc.

Return Value

mixed The return value or null if the query failed.

Exceptions

RuntimeException

mixed loadRowList( integer $index = null)

Method to get an array of the result set rows from the database query where each row is an array. The array of objects can optionally be keyed by a field offset, but defaults to a sequential numeric array.

NOTE: Choosing to key the result array by a non-unique field can result in unwanted behavior and should be avoided.

Parameters

integer $index The index of a field on which to key the result array.

Return Value

mixed The return value or null if the query failed.

Exceptions

RuntimeException

JDatabaseDriver lockTable( string $table)

Locks a table in the database.

Parameters

string $table The name of the table to unlock.

Return Value

JDatabaseDriver Returns this object to support chaining.

Exceptions

RuntimeException

string|array quote( mixed $text, boolean $escape = true)

Quotes and optionally escapes a string to database requirements for use in database queries.

Parameters

mixed $text A string or an array of strings to quote.
boolean $escape True (default) to escape the string, false to leave it unchanged.

Return Value

string|array The quoted input.

mixed quoteName( mixed $name, mixed $as = null)

Wrap an SQL statement identifier name such as column, table or database names in quotes to prevent injection risks and reserved word conflicts.

Parameters

mixed $name The identifier name to wrap in quotes, or an array of identifier names to wrap in quotes. Each type supports dot-notation name.
mixed $as The AS query part associated to $name. It can be string or array, in latter case it has to be same length of $name; if is null there will not be any AS part for string or array element.

Return Value

mixed The quote wrapped name, same type of $name.

string replacePrefix( string $query, string $prefix = '#__')

This function replaces a string identifier $prefix with the string held is the tablePrefix class variable.

Parameters

string $query The SQL statement to prepare.
string $prefix The common table prefix.

Return Value

string The processed SQL statement.

JDatabaseDriver renameTable( string $oldTable, string $newTable, string $backup = null, string $prefix = null)

Renames a table in the database.

Parameters

string $oldTable The name of the table to be renamed
string $newTable The new name for the table.
string $backup Table prefix
string $prefix For the table - used to rename constraints in non-mysql databases

Return Value

JDatabaseDriver Returns this object to support chaining.

Exceptions

RuntimeException

boolean select( string $database)

Select a database for use.

Parameters

string $database The name of the database to select for use.

Return Value

boolean True if the database was successfully selected.

Exceptions

RuntimeException

boolean setDebug( boolean $level)

Sets the database debugging state for the driver.

Parameters

boolean $level True to enable debugging.

Return Value

boolean The old debugging level.

JDatabaseDriver setQuery( mixed $query, integer $offset = null, integer $limit = null, array $driverOptions = array())

Sets the SQL statement string for later execution.

Parameters

mixed $query The SQL statement to set either as a JDatabaseQuery object or a string.
integer $offset The affected row offset to set.
integer $limit The maximum affected rows to set.
array $driverOptions The optional PDO driver options.

Return Value

JDatabaseDriver This object to support method chaining.

boolean setUtf()

Set the connection to use UTF-8 character encoding.

Returns false automatically for the Oracle driver since you can only set the character set when the connection is created.

Return Value

boolean True on success.

void transactionCommit( boolean $toSavepoint = false)

Method to commit a transaction.

Parameters

boolean $toSavepoint If true, commit to the last savepoint.

Return Value

void

Exceptions

RuntimeException

void transactionRollback( boolean $toSavepoint = false)

Method to roll back a transaction.

Parameters

boolean $toSavepoint If true, rollback to the last savepoint.

Return Value

void

Exceptions

RuntimeException

void transactionStart( boolean $asSavepoint = false)

Method to initialize a transaction.

Parameters

boolean $asSavepoint If true and a transaction is already active, a savepoint will be created.

Return Value

void

Exceptions

RuntimeException

void truncateTable( string $table)

Method to truncate a table.

Parameters

string $table The table to truncate

Return Value

void

Exceptions

RuntimeException

boolean updateObject( string $table, object $object, array $key, boolean $nulls = false)

Updates a row in a table based on an object's properties.

Parameters

string $table The name of the database table to update.
object $object &$object A reference to an object whose public properties match the table fields.
array $key The name of the primary key.
boolean $nulls True to update null fields or false to ignore them.

Return Value

boolean True on success.

Exceptions

RuntimeException

mixed execute()

Execute the SQL statement.

Return Value

mixed A database cursor resource on success, boolean false on failure.

Exceptions

RuntimeException
Exception

JDatabaseDriver unlockTables()

Unlocks tables in the database.

Return Value

JDatabaseDriver Returns this object to support chaining.

Exceptions

RuntimeException

string|array q($text, $escape = true)

Alias for quote method

Parameters

$text
$escape

Return Value

string|array

string|array qn($name, $as = null)

Alias for quoteName method

Parameters

$name
$as

Return Value

string|array

mixed getOption( mixed $key)

Retrieve a PDO database connection attribute

Usage: $db->getOption(PDO::ATTR_CASE);

Parameters

mixed $key One of the PDO::ATTR_* Constants

Return Value

mixed

string getConnectedQuery()

Get a query to run and verify the database is operational.

Return Value

string The query to check the health of the DB.

boolean setOption( integer $key, mixed $value)

Sets an attribute on the PDO database handle.

Usage: $db->setOption(PDO::ATTRCASE, PDO::CASEUPPER);

Parameters

integer $key One of the PDO::ATTR_* Constants
mixed $value One of the associated PDO Constants related to the particular attribute key.

Return Value

boolean

static boolean isSupported()

Test to see if the PDO ODBC connector is available.

Return Value

boolean True on success, false otherwise.

mixed loadNextAssoc()

Method to get the next row in the result set from the database query as an array.

Return Value

mixed The result of the query as an array, false if there are no more rows.

Exceptions

RuntimeException

array __sleep()

PDO does not support serialize

Return Value

array

array __wakeup()

Wake up after serialization

Return Value

array

boolean setDateFormat( string $dateFormat = 'DD-MON-RR')

Sets the Oracle Date Format for the session Default date format for Oracle is = DD-MON-RR The default date format for this driver is: 'RRRR-MM-DD HH24:MI:SS' since it is the format that matches the MySQL one used within most Joomla tables.

Parameters

string $dateFormat Oracle Date Format String

Return Value

boolean