Class JDatabaseSQLSrv

Description

SQL Server database driver

Located in /libraries/joomla/database/database/sqlsrv.php (line 22)

JDatabase
   |
   --JDatabaseSQLSrv
Direct descendents
Class Description
JDatabaseSQLAzure SQL Server database driver
Variable Summary
string $dbMinimum
string $name
string $nameQuote
string $nullDate
Method Summary
static boolean test ()
JDatabaseSQLSrv __construct (array $options)
void __destruct ()
boolean checkFieldExists (string $table, string $field)
boolean connected ()
JDatabaseSQLSrv dropTable (string $tableName, [boolean $ifExists = true])
string escape (string $text, [boolean $extra = false])
mixed execute ()
string explain ()
mixed fetchArray ([mixed $cursor = null])
mixed fetchAssoc ([mixed $cursor = null])
mixed fetchObject ([mixed $cursor = null], [string $class = 'stdClass'])
void freeResult ([mixed $cursor = null])
integer getAffectedRows ()
mixed getCollation ()
JDatabaseExporterSQLAzure getExporter ()
JDatabaseImporterSQLAzure getImporter ()
integer getNumRows ([resource $cursor = null])
mixed getQuery ([boolean $new = false])
array getTableColumns (mixed $table, [boolean $typeOnly = true])
array getTableConstraints (string $tableName)
array getTableCreate (mixed $tables)
array getTableKeys (string $table)
array getTableList ()
string getVersion ()
boolean hasUTF ()
integer insertid ()
boolean insertObject (string $table, object &$object, [string $key = null])
string limit (string $sql, integer $limit, integer $offset)
mixed loadResult ()
JDatabase lockTable (string $tableName)
mixed queryBatch ([boolean $abortOnError = true], [boolean $transactionSafe = false])
string quote (string $text, [boolean $escape = true])
void renameConstraints ([array $constraints = array()], [string $prefix = null], [string $backup = null])
JDatabase renameTable (string $oldTable, string $newTable, [string $backup = null], [string $prefix = null])
string replacePrefix (string $sql, [string $prefix = '#__'])
boolean select (string $database)
boolean setUTF ()
Variables
string $dbMinimum = '10.50.1600.1' (line 56)
  • var: The minimum supported database version.
  • since: 12.1
  • access: protected

Redefinition of:
JDatabase::$dbMinimum
string $name = 'sqlsrv' (line 30)

The name of the database driver.

  • since: 11.1
  • access: public

Redefinition of:
JDatabase::$name
The name of the database driver.

Redefined in descendants as:
string $nameQuote = '[]' (line 41)

The character(s) used to quote SQL statement names such as table names or field names, etc. The child classes should define this as necessary. If a single character string the same character is used for both sides of the quoted name, else the first character will be used for the opening quote and the second for the closing quote.

  • since: 11.1
  • access: protected

Redefinition of:
JDatabase::$nameQuote
string $nullDate = '1900-01-01 00:00:00' (line 50)

The null or zero representation of a timestamp for the database driver. This should be defined in child classes to hold the appropriate value for the engine.

  • since: 11.1
  • access: protected

Redefinition of:
JDatabase::$nullDate

Inherited Variables

Inherited from JDatabase

JDatabase::$connection
JDatabase::$count
JDatabase::$cursor
JDatabase::$debug
JDatabase::$errorMsg
JDatabase::$errorNum
JDatabase::$hasQuoted
JDatabase::$instances
JDatabase::$limit
JDatabase::$log
JDatabase::$offset
JDatabase::$quoted
JDatabase::$sql
JDatabase::$tablePrefix
JDatabase::$utf
JDatabase::$_database
Methods
static method test (line 65)

Test to see if the SQLSRV connector is available.

  • return: True on success, false otherwise.
  • since: 11.1
  • access: public
static boolean test ()
Constructor __construct (line 77)

Constructor.

  • since: 11.1
  • access: protected
JDatabaseSQLSrv __construct (array $options)
  • array $options: List of options used to configure the connection

Redefinition of:
JDatabase::__construct()
Constructor.
Destructor __destruct (line 148)

Destructor.

  • since: 11.1
  • access: public
void __destruct ()
checkFieldExists (line 1085)

Method to check and see if a field exists in a table.

  • return: True if the field exists in the table.
  • since: 11.1
  • access: protected
boolean checkFieldExists (string $table, string $field)
  • string $table: The table in which to verify the field.
  • string $field: The field to verify.
connected (line 234)

Determines if the connection to the server is active.

  • return: True if connected to the database engine.
  • since: 11.1
  • access: public
boolean connected ()

Redefinition of:
JDatabase::connected()
Determines if the connection to the server is active.
dropTable (line 251)

Drops a table from the database.

  • return: Returns this object to support chaining.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
JDatabaseSQLSrv dropTable (string $tableName, [boolean $ifExists = true])
  • string $tableName: The name of the database table to drop.
  • boolean $ifExists: Optionally specify that the table must exist before it is dropped.

Redefinition of:
JDatabase::dropTable()
Drops a table from the database.
escape (line 209)

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

The escaping for MSSQL isn't handled in the driver though that would be nice. Because of this we need to handle the escaping ourselves.

  • return: The escaped string.
  • since: 11.1
  • access: public
string escape (string $text, [boolean $extra = false])
  • string $text: The string to be escaped.
  • boolean $extra: Optional parameter to provide extra escaping.

Redefinition of:
JDatabase::escape()
Method to escape a string for usage in an SQL statement.
execute (line 621)

Execute the SQL statement.

  • return: A database cursor resource on success, boolean false on failure.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
mixed execute ()

Redefinition of:
JDatabase::execute()
Execute the SQL statement.
explain (line 961)

Diagnostic method to return explain information for a query.

string explain ()

Redefinition of:
JDatabase::explain()
Diagnostic method to return explain information for a query.
fetchArray (line 904)

Method to fetch a row from the result set cursor as an array.

  • return: Either the next row from the result set or false if there are no more rows.
  • since: 11.1
  • access: protected
mixed fetchArray ([mixed $cursor = null])
  • mixed $cursor: The optional result set cursor from which to fetch the row.

Redefinition of:
JDatabase::fetchArray()
Method to fetch a row from the result set cursor as an array.
fetchAssoc (line 918)

Method to fetch a row from the result set cursor as an associative array.

  • return: Either the next row from the result set or false if there are no more rows.
  • since: 11.1
  • access: protected
mixed fetchAssoc ([mixed $cursor = null])
  • mixed $cursor: The optional result set cursor from which to fetch the row.

Redefinition of:
JDatabase::fetchAssoc()
Method to fetch a row from the result set cursor as an associative array.
fetchObject (line 933)

Method to fetch a row from the result set cursor as an object.

  • return: Either the next row from the result set or false if there are no more rows.
  • since: 11.1
  • access: protected
mixed fetchObject ([mixed $cursor = null], [string $class = 'stdClass'])
  • mixed $cursor: The optional result set cursor from which to fetch the row.
  • string $class: The class name to use for the returned row object.

Redefinition of:
JDatabase::fetchObject()
Method to fetch a row from the result set cursor as an object.
freeResult (line 947)

Method to free up the memory used for the result set.

  • since: 11.1
  • access: protected
void freeResult ([mixed $cursor = null])
  • mixed $cursor: The optional result set cursor from which to fetch the row.

Redefinition of:
JDatabase::freeResult()
Method to free up the memory used for the result set.
getAffectedRows (line 278)

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

  • return: The number of affected rows.
  • since: 11.1
  • access: public
integer getAffectedRows ()

Redefinition of:
JDatabase::getAffectedRows()
Get the number of affected rows for the previous executed SQL statement.
getCollation (line 290)

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

  • return: The collation in use by the database or boolean false if not supported.
  • since: 11.1
  • access: public
mixed getCollation ()

Redefinition of:
JDatabase::getCollation()
Method to get the database collation in use by sampling a text field of a table in the database.
getExporter (line 304)

Gets an exporter class object.

  • return: An exporter object.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
JDatabaseExporterSQLAzure getExporter ()
getImporter (line 326)

Gets an importer class object.

  • return: An importer object.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
JDatabaseImporterSQLAzure getImporter ()
getNumRows (line 349)

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

  • return: The number of returned rows.
  • since: 11.1
  • access: public
integer getNumRows ([resource $cursor = null])
  • resource $cursor: An optional database cursor resource to extract the row count from.

Redefinition of:
JDatabase::getNumRows()
Get the number of returned rows for the previous executed SQL statement.
getQuery (line 364)

Get the current or query, or new JDatabaseQuery object.

  • return: The current value of the internal SQL variable or a new JDatabaseQuery object.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
mixed getQuery ([boolean $new = false])
  • boolean $new: False to return the last query set, True to return a new JDatabaseQuery object.

Redefinition of:
JDatabase::getQuery()
Get the current query object or a new JDatabaseQuery object.

Redefined in descendants as:
getTableColumns (line 392)

Retrieves field information about the given tables.

  • return: An array of fields.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
array getTableColumns (mixed $table, [boolean $typeOnly = true])
  • mixed $table: A table name
  • boolean $typeOnly: True to only return field types.

Redefinition of:
JDatabase::getTableColumns()
Retrieves field information about the given tables.
getTableConstraints (line 165)

Get table constraints

  • return: Any constraints available for the table.
  • since: 11.1
  • access: protected
array getTableConstraints (string $tableName)
  • string $tableName: The name of the database table.
getTableCreate (line 436)

Shows the table CREATE statement that creates the given tables.

This is unsupported by MSSQL.

  • return: A list of the create SQL for the tables.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
array getTableCreate (mixed $tables)
  • mixed $tables: A table name or a list of table names.

Redefinition of:
JDatabase::getTableCreate()
Shows the table CREATE statement that creates the given tables.
getTableKeys (line 451)

Get the details list of keys for a table.

  • return: An array of the column specification for the table.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
array getTableKeys (string $table)
  • string $table: The name of the table.

Redefinition of:
JDatabase::getTableKeys()
Retrieves field information about the given tables.
getTableList (line 480)

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

  • return: An array of all the tables in the database.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
array getTableList ()

Redefinition of:
JDatabase::getTableList()
Method to get an array of all tables in the database.
getVersion (line 496)

Get the version of the database connector.

  • return: The database connector version.
  • since: 11.1
  • access: public
string getVersion ()

Redefinition of:
JDatabase::getVersion()
Get the version of the database connector
hasUTF (line 509)

Determines if the database engine supports UTF-8 character encoding.

  • return: True if supported.
  • since: 11.1
  • access: public
boolean hasUTF ()

Redefinition of:
JDatabase::hasUTF()
Determines if the database engine supports UTF-8 character encoding.
insertid (line 574)

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

  • return: The value of the auto-increment field from the last inserted row.
  • since: 11.1
  • access: public
integer insertid ()

Redefinition of:
JDatabase::insertid()
Method to get the auto-incremented value from the last INSERT statement.
insertObject (line 526)

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

  • return: True on success.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
boolean insertObject (string $table, object &$object, [string $key = null])
  • string $table: The name of the database table to insert into.
  • 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.

Redefinition of:
JDatabase::insertObject()
Inserts a row into a table based on an object's properties.
limit (line 1113)

Method to wrap an SQL statement to provide a LIMIT and OFFSET behavior for scrolling through a result set.

  • return: The processed SQL statement.
  • since: 11.1
  • access: protected
string limit (string $sql, integer $limit, integer $offset)
  • string $sql: The SQL statement to process.
  • integer $limit: The maximum affected rows to set.
  • integer $offset: The affected row offset to set.
loadResult (line 589)

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

  • return: The return value or null if the query failed.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
mixed loadResult ()

Redefinition of:
JDatabase::loadResult()
Method to get the first field of the first row of the result set from the database query.
lockTable (line 1171)

Locks a table in the database.

  • return: Returns this object to support chaining.
  • since: 11.4
  • throws: JDatabaseException
  • access: public
JDatabase lockTable (string $tableName)
  • string $tableName: The name of the table to lock.

Redefinition of:
JDatabase::lockTable()
Locks a table in the database.
queryBatch (line 1029)

Execute a query batch.

  • return: A database resource if successful, false if not.
  • deprecated: 12.1
  • since: 11.1
  • access: public
mixed queryBatch ([boolean $abortOnError = true], [boolean $transactionSafe = false])
  • boolean $abortOnError: Abort on error.
  • boolean $transactionSafe: Transaction safe queries.

Redefinition of:
JDatabase::queryBatch()
Execute a query batch.
quote (line 467)

Method to quote and optionally escape a string to database requirements for insertion into the database.

  • return: The quoted input string.
  • since: 11.1
  • access: public
string quote (string $text, [boolean $escape = true])
  • string $text: The string to quote.
  • boolean $escape: True to escape the string, false to leave it unchanged.

Redefinition of:
JDatabase::quote()
Method to quote and optionally escape a string to database requirements for insertion into the database.
renameConstraints (line 187)

Rename constraints.

  • since: 11.1
  • access: protected
void renameConstraints ([array $constraints = array()], [string $prefix = null], [string $backup = null])
  • array $constraints: Array(strings) of table constraints
  • string $prefix: A string
  • string $backup: A string
renameTable (line 1143)

Renames a table in the database.

  • return: Returns this object to support chaining.
  • since: 11.4
  • throws: JDatabaseException
  • access: public
JDatabase renameTable (string $oldTable, string $newTable, [string $backup = null], [string $prefix = null])
  • 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

Redefinition of:
JDatabase::renameTable()
Renames a table in the database.
replacePrefix (line 719)

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

  • return: The processed SQL statement.
  • since: 11.1
  • access: public
string replacePrefix (string $sql, [string $prefix = '#__'])
  • string $sql: The SQL statement to prepare.
  • string $prefix: The common table prefix.

Redefinition of:
JDatabase::replacePrefix()
This function replaces a string identifier $prefix with the string held is the tablePrefix class variable.
select (line 814)

Select a database for use.

  • return: True if the database was successfully selected.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
boolean select (string $database)
  • string $database: The name of the database to select for use.

Redefinition of:
JDatabase::select()
Select a database for use.
setUTF (line 848)

Set the connection to use UTF-8 character encoding.

  • return: True on success.
  • since: 11.1
  • access: public
boolean setUTF ()

Redefinition of:
JDatabase::setUTF()
Set the connection to use UTF-8 character encoding.
transactionCommit (line 861)

Method to commit a transaction.

  • since: 11.1
  • throws: JDatabaseException
  • access: public
void transactionCommit ()

Redefinition of:
JDatabase::transactionCommit()
Method to commit a transaction.
transactionRollback (line 875)

Method to roll back a transaction.

  • since: 11.1
  • throws: JDatabaseException
  • access: public
void transactionRollback ()

Redefinition of:
JDatabase::transactionRollback()
Method to roll back a transaction.
transactionStart (line 889)

Method to initialize a transaction.

  • since: 11.1
  • throws: JDatabaseException
  • access: public
void transactionStart ()

Redefinition of:
JDatabase::transactionStart()
Method to initialize a transaction.
unlockTables (line 1184)

Unlocks tables in the database.

  • return: Returns this object to support chaining.
  • since: 11.4
  • throws: JDatabaseException
  • access: public
JDatabase unlockTables ()

Redefinition of:
JDatabase::unlockTables()
Unlocks tables in the database.

Inherited Methods

Inherited From JDatabase

JDatabase::__construct()
JDatabase::addQuoted()
JDatabase::connected()
JDatabase::debug()
JDatabase::dropTable()
JDatabase::escape()
JDatabase::execute()
JDatabase::explain()
JDatabase::fetchArray()
JDatabase::fetchAssoc()
JDatabase::fetchObject()
JDatabase::freeResult()
JDatabase::getAffectedRows()
JDatabase::getCollation()
JDatabase::getConnection()
JDatabase::getConnectors()
JDatabase::getCount()
JDatabase::getDatabase()
JDatabase::getDateFormat()
JDatabase::getErrorMsg()
JDatabase::getErrorNum()
JDatabase::getEscaped()
JDatabase::getInstance()
JDatabase::getLog()
JDatabase::getMinimum()
JDatabase::getNullDate()
JDatabase::getNumRows()
JDatabase::getPrefix()
JDatabase::getQuery()
JDatabase::getTableColumns()
JDatabase::getTableCreate()
JDatabase::getTableFields()
JDatabase::getTableKeys()
JDatabase::getTableList()
JDatabase::getTicker()
JDatabase::getUTFSupport()
JDatabase::getVersion()
JDatabase::hasUTF()
JDatabase::insertid()
JDatabase::insertObject()
JDatabase::isMinimumVersion()
JDatabase::isQuoted()
JDatabase::loadAssoc()
JDatabase::loadAssocList()
JDatabase::loadColumn()
JDatabase::loadNextObject()
JDatabase::loadNextRow()
JDatabase::loadObject()
JDatabase::loadObjectList()
JDatabase::loadResult()
JDatabase::loadResultArray()
JDatabase::loadRow()
JDatabase::loadRowList()
JDatabase::lockTable()
JDatabase::nameQuote()
JDatabase::query()
JDatabase::queryBatch()
JDatabase::quote()
JDatabase::quoteName()
JDatabase::quoteNameStr()
JDatabase::renameTable()
JDatabase::replacePrefix()
JDatabase::select()
JDatabase::setDebug()
JDatabase::setQuery()
JDatabase::setUTF()
JDatabase::splitSql()
JDatabase::stderr()
JDatabase::transactionCommit()
JDatabase::transactionRollback()
JDatabase::transactionStart()
JDatabase::truncateTable()
JDatabase::unlockTables()
JDatabase::updateObject()
JDatabase::__call()

Documentation generated on Mon, 25 Jun 2012 13:59:44 -0500 by phpDocumentor 1.4.4