| Method | Defined by | ||
|---|---|---|---|
|
SqlUtil()
Constructor
| SqlUtil | ||
|
buildInsert(table:String, rows:ArrayCollection):String
[static]
Build Insert SQL Statement
| SqlUtil | ||
|
buildSelectAll(db:SQLConnection, table:String):String
[static]
Build Select All SQL Statement
| SqlUtil | ||
|
buildTableDefs(db:SQLConnection, table:String):Array
[static]
Build Create Table SQL Statement
| SqlUtil | ||
|
createIndex(db:SQLConnection, table:String, indexDefs:ArrayCollection):Boolean
[static]
Create index of the specified table
| SqlUtil | ||
|
createTable(db:SQLConnection, table:String, tableDefs:ArrayCollection):Boolean
[static]
Create table to the specified database
| SqlUtil | ||
|
deleteRow(db:SQLConnection, table:String, keyColumn:String, keyValue:int):Boolean
[static]
Delete row from the specified table
| SqlUtil | ||
|
dropIndex(db:SQLConnection, index:String):Boolean
[static]
Drop the specified index from the DataBase
| SqlUtil | ||
|
dropTable(db:SQLConnection, table:String):Boolean
[static]
Drop the specified table from the DataBase
| SqlUtil | ||
|
executeSQLStatement(db:SQLConnection, sql:String):Object
[static]
private method
| SqlUtil | ||
|
existsIndex(db:SQLConnection, table:String, index:String):Boolean
[static]
Check if the index exists in the specified table
| SqlUtil | ||
|
existsTable(db:SQLConnection, table:String):Boolean
[static]
Check if the table exists in the database
| SqlUtil | ||
|
getColumnDef(db:SQLConnection, table:String):ArrayCollection
[static]
Get the columns definition of the specified table
| SqlUtil | ||
|
getData(db:SQLConnection, sql:String):Array
[static]
Get the Data & Column Defs of the table
| SqlUtil | ||
|
getIndexList(db:SQLConnection, table:String):ArrayCollection
[static]
Get the index list of the specified table
| SqlUtil | ||
|
getRowCount(db:SQLConnection, table:String):uint
[static]
Get the row count of the table
| SqlUtil | ||
|
getTableList(db:SQLConnection):Array
[static]
Get the table list of the specified DataBase
| SqlUtil | ||
|
insertRow(db:SQLConnection, table:String, rows:ArrayCollection):Boolean
[static]
Insert row to the specified table
| SqlUtil | ||
|
trancateTable(db:SQLConnection, table:String, keyColumn:String):Boolean
[static]
Remove the whole data of the specified table
| SqlUtil | ||
|
updateRow(db:SQLConnection, table:String, keyColumn:String, keyValue:int, updateColumn:String, updateValue:String, updateType:String):Boolean
[static]
Update row of the specified table
| SqlUtil | ||
| SqlUtil | () | constructor |
public function SqlUtil()Constructor
| buildInsert | () | method |
public static function buildInsert(table:String, rows:ArrayCollection):StringBuild Insert SQL Statement
Parameterstable:String — Table to insert data
|
|
rows:ArrayCollection — Data to insert
|
String — Insert SQL Statement
|
| buildSelectAll | () | method |
public static function buildSelectAll(db:SQLConnection, table:String):StringBuild Select All SQL Statement
Parametersdb:SQLConnection — The SQLConnection of the specified DataBase
|
|
table:String — Table to build the SQL statement
|
String — Select All SQL Statement
|
| buildTableDefs | () | method |
public static function buildTableDefs(db:SQLConnection, table:String):ArrayBuild Create Table SQL Statement
Parametersdb:SQLConnection — The SQLConnection of the specified DataBase
|
|
table:String — Table to build the SQL statement
|
Array — Create Table SQL Statement
|
| createIndex | () | method |
public static function createIndex(db:SQLConnection, table:String, indexDefs:ArrayCollection):BooleanCreate index of the specified table
Parametersdb:SQLConnection — The SQLConnection of the specified DataBase
|
|
table:String — The table to create index
|
|
indexDefs:ArrayCollection — ArrayCollection of the index definition
and it contains the following params.
- name : Index name
- columns: The list of the column
|
Boolean — true/false If it succeed to create the index
|
| createTable | () | method |
public static function createTable(db:SQLConnection, table:String, tableDefs:ArrayCollection):BooleanCreate table to the specified database
Parametersdb:SQLConnection — The SQLConnection of the specified DataBase
|
|
table:String — The table name
|
|
tableDefs:ArrayCollection — ArrayCollection of the table definition
and it contains the following params.
- name : Column name
- type : The data type of the column
- primaryKey : If the column is primary key
- autoIncrement: If it will increment the value automatically
- allowNull : If the column allows null value
|
Boolean — true/false If it succeed to create the table
|
| deleteRow | () | method |
public static function deleteRow(db:SQLConnection, table:String, keyColumn:String, keyValue:int):BooleanDelete row from the specified table
Parametersdb:SQLConnection — The SQLConnection of the specified DataBase
|
|
table:String — The table to delete the row
|
|
keyColumn:String — The column name that specify the row
|
|
keyValue:int — The column value that specify the row
|
Boolean — true/false If it succeed to delete the row
|
| dropIndex | () | method |
public static function dropIndex(db:SQLConnection, index:String):BooleanDrop the specified index from the DataBase
Parametersdb:SQLConnection — The SQLConnection of the specified DataBase
|
|
index:String — The Index to drop from DataBase
|
Boolean — true/false If it succed to drop the index
|
| dropTable | () | method |
public static function dropTable(db:SQLConnection, table:String):BooleanDrop the specified table from the DataBase
Parametersdb:SQLConnection — The SQLConnection of the specified DataBase
|
|
table:String — The Table to drop from DataBase
|
Boolean — true/false If it succed to drop the table
|
| executeSQLStatement | () | method |
public static function executeSQLStatement(db:SQLConnection, sql:String):Objectprivate method
Parametersdb:SQLConnection |
|
sql:String |
Object |
| existsIndex | () | method |
public static function existsIndex(db:SQLConnection, table:String, index:String):BooleanCheck if the index exists in the specified table
Parametersdb:SQLConnection — The SQLConnection of the specified DataBase
|
|
table:String — The table if contains the index
|
|
index:String — The index name to check
|
Boolean — true/false If the index exists in the table
|
| existsTable | () | method |
public static function existsTable(db:SQLConnection, table:String):BooleanCheck if the table exists in the database
Parametersdb:SQLConnection — The SQLConnection of the specified DataBase
|
|
table:String — The table name to check
|
Boolean — true/false If the table exists in the table
|
| getColumnDef | () | method |
public static function getColumnDef(db:SQLConnection, table:String):ArrayCollectionGet the columns definition of the specified table
Parametersdb:SQLConnection — The SQLConnection of the specified DataBase
|
|
table:String — The table name which you want the column defs
|
ArrayCollection — The ArrayCollection of the columns definition
and it contains the following params
- name : Column name
- type : The Data type of the column
- primaryKey : If this column is primary key
- autoIncrement: If this column increment automatically
- allowNull : If this column allow null value
|
| getData | () | method |
public static function getData(db:SQLConnection, sql:String):ArrayGet the Data & Column Defs of the table
Parametersdb:SQLConnection — The SQLConnection of the specified DataBase
|
|
sql:String — The SQL string
|
Array — result The Array which contains column defs and data
The following are the description
- result[0]: The Array of the columns name
- result[1]: The SQLResult of the sql which executed
|
| getIndexList | () | method |
public static function getIndexList(db:SQLConnection, table:String):ArrayCollectionGet the index list of the specified table
Parametersdb:SQLConnection — The SQLConnection of the specified DataBase
|
|
table:String — The table to get the list of index
|
ArrayCollection — The ArrayCollection of the index
and it contains the following params
- name : Index name
- columns: The column list
|
| getRowCount | () | method |
public static function getRowCount(db:SQLConnection, table:String):uintGet the row count of the table
Parametersdb:SQLConnection — The SQLConnection of the specified DataBase
|
|
table:String — The table name which you want to get the row count
|
uint — The row count of the table
|
| getTableList | () | method |
public static function getTableList(db:SQLConnection):ArrayGet the table list of the specified DataBase
Parametersdb:SQLConnection — The SQLConnection of the specified DataBase
|
Array — The Array of the table name
|
| insertRow | () | method |
public static function insertRow(db:SQLConnection, table:String, rows:ArrayCollection):BooleanInsert row to the specified table
Parametersdb:SQLConnection — The SQLConnection of the specified DataBase
|
|
table:String — The table to insert the data
|
|
rows:ArrayCollection — The ArrayCollection of the data to insert
and it contains the following params
- column: Column name
- value : Column value
- type : Data type of the column
|
Boolean — true/false If it succeed to insert the row data
|
| trancateTable | () | method |
public static function trancateTable(db:SQLConnection, table:String, keyColumn:String):BooleanRemove the whole data of the specified table
Parametersdb:SQLConnection — The SQLConnection of the specified DataBase
|
|
table:String — The table to remove the whole data
|
|
keyColumn:String |
Boolean — true/false If it succed to trancate the table
|
| updateRow | () | method |
public static function updateRow(db:SQLConnection, table:String, keyColumn:String, keyValue:int, updateColumn:String, updateValue:String, updateType:String):BooleanUpdate row of the specified table
Parametersdb:SQLConnection — The SQLConnection of the specified DataBase
|
|
table:String — The table to update the data
|
|
keyColumn:String — The column name to specify the row
|
|
keyValue:int — The column value to specify the row
|
|
updateColumn:String — The column name to update
|
|
updateValue:String — The column value to update
|
|
updateType:String — The data type of the column to update
|
Boolean — true/false If it succeed to update the row data
|