Документация по Joomla 1.7

Joomla.Platform\JDatabaseSQLAzure
libraries/joomla/database/database/sqlazure.php at line 25

Class JDatabaseSQLAzure

JDatabase
└─JDatabaseSQLAzure

public class JDatabaseSQLAzure
extends JDatabase

SQL Server database driver

Subpackage:
Database
See Also:
http://msdn.microsoft.com/en-us/library/ee336279.aspx
Since:
11.1

Field Summary
string

$name

The name of the database driver.

protected string

$nameQuote

The character(s) used to quote SQL statement names such as table names or field names, etc.

protected string

$nullDate

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

Fields inherited from Joomla.Platform\JDatabase
connection, count, cursor, debug, errorMsg, errorNum, hasQuoted, instances, limit, log, name, nameQuote, nullDate, offset, quoted, sql, tablePrefix, utf
Constructor Summary
protected void

__construct(array options)

Constructor.

Method Summary
static boolean

test()

Test to see if the SQLSRV connector is available.

protected Any

_getTableConstraints(string tableName)

Get table constraints

protected void

_renameConstraints(array constraints, string prefix, string backup)

Rename constraints

string

escape(string text, boolean extra, string The, bool Optional)

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

boolean

connected()

Determines if the connection to the server is active.

JDatabaseSQLSrv

dropTable(string tableName, bool ifExists)

Drops a table from the database.

integer

getAffectedRows()

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

mixed

getCollation()

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

JDatabaseExporterSQLAzure

getExporter()

Gets an exporter class object.

JDatabaseImporterSQLAzure

getImporter()

Gets an importer class object.

integer

getNumRows(resource cursor)

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

mixed

getQuery(boolean new)

Get the current query or new JDatabaseQuery object.

array

getTableColumns(mixed tables, bool typeOnly)

Retrieves field information about the given tables.

array

getTableCreate(mixed tables)

Shows the table CREATE statement that creates the given tables.

array

getTableKeys(string table, mixed tables)

Get the details list of keys for a table.

array

getTableList()

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

string

getVersion()

Get the version of the database connector.

boolean

hasUTF()

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

integer

insertid()

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

mixed

query()

Execute the SQL statement.

boolean

select(string database)

Select a database for use.

boolean

setUTF()

Set the connection to use UTF-8 character encoding.

void

transactionCommit()

Method to commit a transaction.

void

transactionRollback()

Method to roll back a transaction.

void

transactionStart()

Method to initialize a transaction.

protected mixed

fetchArray(mixed cursor)

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

protected mixed

fetchAssoc(mixed cursor)

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

protected mixed

fetchObject(mixed cursor, string class)

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

protected void

freeResult(mixed cursor)

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

string

explain()

Diagnostic method to return explain information for a query.

mixed

queryBatch(bool abortOnError, bool transactionSafe)

Execute a query batch.

protected boolean

_checkFieldExists(string table, string field)

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

protected string

_limit(string sql, integer offset, integer limit)

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

Methods inherited from Joomla.Platform\JDatabase
__call, __construct, addQuoted, connected, debug, escape, explain, fetchArray, fetchAssoc, fetchObject, freeResult, getAffectedRows, getCollation, getConnection, getConnectors, getCount, getDateFormat, getErrorMsg, getErrorNum, getEscaped, getInstance, getLog, getNullDate, getNumRows, getPrefix, getQuery, getTableColumns, getTableCreate, getTableFields, getTableKeys, getTableList, getTicker, getUTFSupport, getVersion, hasUTF, insertObject, insertid, isQuoted, loadAssoc, loadAssocList, loadColumn, loadNextObject, loadNextRow, loadObject, loadObjectList, loadResult, loadResultArray, loadRow, loadRowList, nameQuote, query, queryBatch, quote, quoteName, replacePrefix, select, setDebug, setQuery, setUTF, splitSql, stderr, transactionCommit, transactionRollback, transactionStart, updateObject

Field Detail

libraries/joomla/database/database/sqlazure.php at line 33

name

public string $name = 'sqlzure'

The name of the database driver.

Since:
11.1

libraries/joomla/database/database/sqlazure.php at line 44

nameQuote

protected string $nameQuote

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

libraries/joomla/database/database/sqlazure.php at line 53

nullDate

protected string $nullDate = '1900-01-01 00:00:00'

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

Constructor Detail

libraries/joomla/database/database/sqlazure.php at line 76

__construct

protected void __construct(array options)

Constructor.

Parameters:
options - List of options used to configure the connection
Since:
11.1

Method Detail

libraries/joomla/database/database/sqlazure.php at line 62

test

public static boolean test()

Test to see if the SQLSRV connector is available.

Returns:
True on success, false otherwise.
Since:
11.1

libraries/joomla/database/database/sqlazure.php at line 158

_getTableConstraints

protected Any _getTableConstraints(string tableName)

Get table constraints

Parameters:
tableName - The name of the database table.
Returns:
constraints available for the table
Since:
11.1

libraries/joomla/database/database/sqlazure.php at line 181

_renameConstraints

protected void _renameConstraints(array constraints, string prefix, string backup)

Rename constraints

Parameters:
constraints - Array of strings
prefix - A string
backup - A string
Since:
11.1

libraries/joomla/database/database/sqlazure.php at line 203

escape

public string escape(string text, boolean extra, string The, bool Optional)

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.

Parameters:
text - The string to be escaped.
extra - Optional parameter to provide extra escaping.
Returns:
The escaped string.
Since:
11.1

libraries/joomla/database/database/sqlazure.php at line 226

connected

public boolean connected()

Determines if the connection to the server is active.

Returns:
True if connected to the database engine.
Since:
11.1

libraries/joomla/database/database/sqlazure.php at line 242

dropTable

public JDatabaseSQLSrv dropTable(string tableName, bool ifExists)

Drops a table from the database.

Parameters:
tableName - The name of the database table to drop.
ifExists - Optionally specify that the table must exist before it is dropped.
Returns:
Returns this object to support chaining.
Since:
11.1

libraries/joomla/database/database/sqlazure.php at line 264

getAffectedRows

public integer getAffectedRows()

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

Returns:
The number of affected rows.
Since:
11.1

libraries/joomla/database/database/sqlazure.php at line 276

getCollation

public mixed getCollation()

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

Returns:
The collation in use by the database or boolean false if not supported.
Since:
11.1

libraries/joomla/database/database/sqlazure.php at line 290

getExporter

public JDatabaseExporterSQLAzure getExporter()

Gets an exporter class object.

Returns:
An exporter object.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database/sqlazure.php at line 311

getImporter

public JDatabaseImporterSQLAzure getImporter()

Gets an importer class object.

Returns:
An importer object.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database/sqlazure.php at line 333

getNumRows

public integer getNumRows(resource cursor)

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

Parameters:
cursor - An optional database cursor resource to extract the row count from.
Returns:
The number of returned rows.
Since:
11.1

libraries/joomla/database/database/sqlazure.php at line 348

getQuery

public mixed getQuery(boolean new)

Get the current query or new JDatabaseQuery object.

Parameters:
new - False to return the last query set, True to return a new JDatabaseQuery object.
Returns:
The current value of the internal SQL variable or a new JDatabaseQuery object.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database/sqlazure.php at line 373

getTableColumns

public array getTableColumns(mixed tables, bool typeOnly)

Retrieves field information about the given tables.

Parameters:
tables - A table name or a list of table names.
typeOnly - True to only return field types.
Returns:
An array of fields by table.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database/sqlazure.php at line 421

getTableCreate

public array getTableCreate(mixed tables)

Shows the table CREATE statement that creates the given tables.

This is unsupported by MSSQL.

Parameters:
tables - A table name or a list of table names.
Returns:
A list of the create SQL for the tables.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database/sqlazure.php at line 436

getTableKeys

public array getTableKeys(string table, mixed tables)

Get the details list of keys for a table.

Parameters:
table - The name of the table.
Returns:
An arry of the column specification for the table.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database/sqlazure.php at line 450

getTableList

public array getTableList()

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

Returns:
An array of all the tables in the database.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database/sqlazure.php at line 466

getVersion

public string getVersion()

Get the version of the database connector.

Returns:
The database connector version.
Since:
11.1

libraries/joomla/database/database/sqlazure.php at line 479

hasUTF

public boolean hasUTF()

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

Returns:
True if supported.
Since:
11.1

libraries/joomla/database/database/sqlazure.php at line 491

insertid

public integer insertid()

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

Returns:
The value of the auto-increment field from the last inserted row.
Since:
11.1

libraries/joomla/database/database/sqlazure.php at line 506

query

public mixed query()

Execute the SQL statement.

Returns:
A database cursor resource on success, boolean false on failure.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database/sqlazure.php at line 592

select

public boolean select(string database)

Select a database for use.

Parameters:
database - The name of the database to select for use.
Returns:
True if the database was successfully selected.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database/sqlazure.php at line 622

setUTF

public boolean setUTF()

Set the connection to use UTF-8 character encoding.

Returns:
True on success.
Since:
11.1

libraries/joomla/database/database/sqlazure.php at line 635

transactionCommit

public void transactionCommit()

Method to commit a transaction.

Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database/sqlazure.php at line 649

transactionRollback

public void transactionRollback()

Method to roll back a transaction.

Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database/sqlazure.php at line 663

transactionStart

public void transactionStart()

Method to initialize a transaction.

Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database/sqlazure.php at line 678

fetchArray

protected mixed fetchArray(mixed cursor)

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

Parameters:
cursor - The optional result set cursor from which to fetch the row.
Returns:
Either the next row from the result set or false if there are no more rows.
Since:
11.1

libraries/joomla/database/database/sqlazure.php at line 692

fetchAssoc

protected mixed fetchAssoc(mixed cursor)

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

Parameters:
cursor - The optional result set cursor from which to fetch the row.
Returns:
Either the next row from the result set or false if there are no more rows.
Since:
11.1

libraries/joomla/database/database/sqlazure.php at line 707

fetchObject

protected mixed fetchObject(mixed cursor, string class)

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

Parameters:
cursor - The optional result set cursor from which to fetch the row.
class - The class name to use for the returned row object.
Returns:
Either the next row from the result set or false if there are no more rows.
Since:
11.1

libraries/joomla/database/database/sqlazure.php at line 721

freeResult

protected void freeResult(mixed cursor)

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

Parameters:
cursor - The optional result set cursor from which to fetch the row.
Since:
11.1

libraries/joomla/database/database/sqlazure.php at line 735

explain

public string explain()

Diagnostic method to return explain information for a query.

Returns:
The explain output.
Deprecated:
12.1
See Also:
http://msdn.microsoft.com/en-us/library/aa259203%28SQL.80%29.aspx
Since:
11.1

libraries/joomla/database/database/sqlazure.php at line 798

queryBatch

public mixed queryBatch(bool abortOnError, bool transactionSafe)

Execute a query batch.

Returns:
A database resource if successful, false if not.
Since:
11.1
Deprecated:
12.1

libraries/joomla/database/database/sqlazure.php at line 849

_checkFieldExists

protected boolean _checkFieldExists(string table, string field)

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

Parameters:
table - The table in which to verify the field.
field - The field to verify.
Returns:
True if the field exists in the table.
Since:
11.1

libraries/joomla/database/database/sqlazure.php at line 876

_limit

protected string _limit(string sql, integer offset, integer limit)

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

Parameters:
sql - The SQL statement to process.
offset - The affected row offset to set.
limit - The maximum affected rows to set.
Returns:
The processed SQL statement.
Since:
11.1

Документация по Joomla 1.7