Packagecom.maclema.mysql
Classpublic class Statement
InheritanceStatement Inheritance Object

The Statement class allows you to execute queries for the MySql connection.



Public Properties
 PropertyDefined By
  sql : String
Get the sql string to execute
Statement
  streamingInterval : int = 5000
If streaming is being used, determines the numbers of rows read between MySqlEvent.ROWDATA events.
Statement
  streamResults : Boolean = false
Indicates if streaming should be used when reading results.
Statement
Public Methods
 MethodDefined By
  
Constructs a new Statement object.
Statement
  
executeBinaryQuery(query:BinaryQuery):MySqlToken
Executes a binary query object
Statement
  
executeQuery(sqlString:String = null):MySqlToken
Executes the specified sql statement.
Statement
  
Returns the Connection that created this statement
Statement
  
registerOutputParam(param:String):void
Register an output parameter that will be returned from a stored procedure
Statement
  
setBinary(index:int, value:ByteArray):void
Set's a Binary parameter
Statement
  
setDate(index:int, value:Date):void
Set a Date parameter (YYYY-MM-DD)
Statement
  
setDateTime(index:int, value:Date):void
Set a DateTime parameter (YYYY-MM-DD J:NN:SS)
Statement
  
setNamedParameter(name:String, value:*):void
Sets a named parameter.
Statement
  
setNumber(index:int, value:Number):void
Set a Number parameter
Statement
  
setString(index:int, value:String):void
Set a String parameter
Statement
  
setTime(index:int, value:Date):void
Set a Time parameter (H:MM:SS)
Statement
Property Detail
sqlproperty
sql:String

Get the sql string to execute


Implementation
    public function get sql():String
    public function set sql(value:String):void
streamingIntervalproperty 
public var streamingInterval:int = 5000

If streaming is being used, determines the numbers of rows read between MySqlEvent.ROWDATA events. The default is 5000 and should usually not be set lower as performance will degrade. Usually at 5000, the events will be dispatched every 100-300 ms.

streamResultsproperty 
public var streamResults:Boolean = false

Indicates if streaming should be used when reading results.

Constructor Detail
Statement()Constructor
public function Statement(con:Connection)

Constructs a new Statement object. Should never be called directly, rather, use Connection.createStatement();

Parameters
con:Connection
Method Detail
executeBinaryQuery()method
public function executeBinaryQuery(query:BinaryQuery):MySqlToken

Executes a binary query object

Parameters

query:BinaryQuery

Returns
MySqlToken
executeQuery()method 
public function executeQuery(sqlString:String = null):MySqlToken

Executes the specified sql statement. The statement can be provided using either the sql property or as the first parameter of this method. You may also specify a IResponder object as the second parameter. When result(data:Object) is called on the IResponder the data object will be either a ResultSet, in the case of query statements, and in the case of data manipulation statements, will be an object with two properties, affectedRows, and insertID.

Parameters

sqlString:String (default = null)

Returns
MySqlToken
getConnection()method 
public function getConnection():Connection

Returns the Connection that created this statement

Returns
Connection
registerOutputParam()method 
public function registerOutputParam(param:String):void

Register an output parameter that will be returned from a stored procedure

Parameters

param:String

setBinary()method 
public function setBinary(index:int, value:ByteArray):void

Set's a Binary parameter

Parameters

index:int
 
value:ByteArray

setDate()method 
public function setDate(index:int, value:Date):void

Set a Date parameter (YYYY-MM-DD)

Parameters

index:int
 
value:Date

setDateTime()method 
public function setDateTime(index:int, value:Date):void

Set a DateTime parameter (YYYY-MM-DD J:NN:SS)

Parameters

index:int
 
value:Date

setNamedParameter()method 
public function setNamedParameter(name:String, value:*):void

Sets a named parameter. Named parameters are identified in sql using :paramName. Valid parameter names only contain alpha-numeric characters.

Parameters

name:String
 
value:*

setNumber()method 
public function setNumber(index:int, value:Number):void

Set a Number parameter

Parameters

index:int
 
value:Number

setString()method 
public function setString(index:int, value:String):void

Set a String parameter

Parameters

index:int
 
value:String

setTime()method 
public function setTime(index:int, value:Date):void

Set a Time parameter (H:MM:SS)

Parameters

index:int
 
value:Date