| Package | org.libspark.utils |
|---|---|
| Class | public class SqlUtil |
SqlUtil()
buildInsert(table:String, rows:ArrayCollection) :String
buildSelectAll(db:SQLConnection, table:String) :String
buildTableDefs(db:SQLConnection, table:String) :Array
createIndex(db:SQLConnection, table:String, indexDefs:ArrayCollection) :Boolean
createTable(db:SQLConnection, table:String, tableDefs:ArrayCollection) :Boolean
deleteRow(db:SQLConnection, table:String, keyColumn:String, keyValue:int) :Boolean
dropIndex(db:SQLConnection, index:String) :Boolean
dropTable(db:SQLConnection, table:String) :Boolean
executeSQLStatement(db:SQLConnection, sql:String) :Object
existsIndex(db:SQLConnection, table:String, index:String) :Boolean
existsTable(db:SQLConnection, table:String) :Boolean
getColumnDef(db:SQLConnection, table:String) :ArrayCollection
getData(db:SQLConnection, sql:String) :Array
getIndexList(db:SQLConnection, table:String) :ArrayCollection
getRowCount(db:SQLConnection, table:String) :uint
getTableList(db:SQLConnection) :Array
insertRow(db:SQLConnection, table:String, rows:ArrayCollection) :Boolean
trancateTable(db:SQLConnection, table:String, keyColumn:String) :Boolean
updateRow(db:SQLConnection, table:String, keyColumn:String, keyValue:int, updateColumn:String, updateValue:String, updateType:String) :Boolean
public function SqlUtil()
Constructor
public static function buildInsert(table:String, rows:ArrayCollection):StringBuild Insert SQL Statement
table:String
rows:ArrayCollection
String
public static function buildSelectAll(db:SQLConnection, table:String):StringBuild Select All SQL Statement
db:SQLConnection
table:String
String
public static function buildTableDefs(db:SQLConnection, table:String):ArrayBuild Create Table SQL Statement
db:SQLConnection
table:String
Array
public static function createIndex(db:SQLConnection, table:String, indexDefs:ArrayCollection):BooleanCreate index of the specified table
db:SQLConnection
table:String
indexDefs:ArrayCollection
Boolean
public static function createTable(db:SQLConnection, table:String, tableDefs:ArrayCollection):BooleanCreate table to the specified database
db:SQLConnection
table:String
tableDefs:ArrayCollection
Boolean
public static function deleteRow(db:SQLConnection, table:String, keyColumn:String, keyValue:int):BooleanDelete row from the specified table
db:SQLConnection
table:String
keyColumn:String
keyValue:int
Boolean
public static function dropIndex(db:SQLConnection, index:String):BooleanDrop the specified index from the DataBase
db:SQLConnection
index:String
Boolean
public static function dropTable(db:SQLConnection, table:String):BooleanDrop the specified table from the DataBase
db:SQLConnection
table:String
Boolean
public static function executeSQLStatement(db:SQLConnection, sql:String):Objectprivate method
db:SQLConnection
sql:String
Object
public static function existsIndex(db:SQLConnection, table:String, index:String):BooleanCheck if the index exists in the specified table
db:SQLConnection
table:String
index:String
Boolean
public static function existsTable(db:SQLConnection, table:String):BooleanCheck if the table exists in the database
db:SQLConnection
table:String
Boolean
public static function getColumnDef(db:SQLConnection, table:String):ArrayCollectionGet the columns definition of the specified table
db:SQLConnection
table:String
ArrayCollection
public static function getData(db:SQLConnection, sql:String):ArrayGet the Data & Column Defs of the table
db:SQLConnection
sql:String
Array
public static function getIndexList(db:SQLConnection, table:String):ArrayCollectionGet the index list of the specified table
db:SQLConnection
table:String
ArrayCollection
public static function getRowCount(db:SQLConnection, table:String):uintGet the row count of the table
db:SQLConnection
table:String
uint
public static function getTableList(db:SQLConnection):ArrayGet the table list of the specified DataBase
db:SQLConnection
Array
public static function insertRow(db:SQLConnection, table:String, rows:ArrayCollection):BooleanInsert row to the specified table
db:SQLConnection
table:String
rows:ArrayCollection
Boolean
public static function trancateTable(db:SQLConnection, table:String, keyColumn:String):BooleanRemove the whole data of the specified table
db:SQLConnection
table:String
keyColumn:String
Boolean
public static function updateRow(db:SQLConnection, table:String, keyColumn:String, keyValue:int, updateColumn:String, updateValue:String, updateType:String):BooleanUpdate row of the specified table
db:SQLConnection
table:String
keyColumn:String
keyValue:int
updateColumn:String
updateValue:String
updateType:String
Boolean