Packagecom.maclema.mysql
Classpublic class MySqlService
InheritanceMySqlService Inheritance flash.events.EventDispatcher

Use the <assql:MySqlService> tag to represent a MySqlService object in an MXML file. When you call the MySqlService object's send method, it makes a query to the currently connection MySql database.

See also

com.maclema.mysql.mxml.MySqlService


Public Properties
 PropertyDefined By
  charSet : String = utf8
The character set to use for the connection
MySqlService
  connected : Boolean
[read-only] Returns true or false indicating is the MySqlService is currently connected.
MySqlService
  database : String
The database to switch to once connected
MySqlService
  hostname : String
The hostname to connect to
MySqlService
  lastAffectedRows : int
[read-only] Returns the number of affected rows returned after a data manipulation query by calling send()
MySqlService
  lastInsertID : int
[read-only] Returns the last insert id returned after a data manipulation query by calling send()
MySqlService
  lastResult : ArrayCollection
[read-only] Returns the ArrayCollection of rows generated by ResultSet.getRows of the last ResultSet generated by calling send()
MySqlService
  lastResultSet : ResultSet
[read-only] Returns the last ResultSet object generated by calling send()
MySqlService
  password : String
The password to authenticate with
MySqlService
  port : int = 3306
The port to connect to
MySqlService
  responder : IResponder
The responder to use for the mysql service
MySqlService
  username : String
The username to authenticate with
MySqlService
Public Methods
 MethodDefined By
  
Constructs a new MySqlService object.
MySqlService
  
connect():void
Open the MySql connection
MySqlService
  
disconnect():void
Closes the connection
MySqlService
  
send(queryObject:*):MySqlToken
Executes a query, you may pass in either an sql string or a Statement object.
MySqlService
Events
 Event Summary Defined By
  Dispatched when the connection to MySql is terminatedMySqlService
  Dispatch when successfully connected to MySqlMySqlService
  Dispatched when a data manipulation query successfully executesMySqlService
  Dispatch when a query successfully executesMySqlService
  Dispatched when an SQL error occurs.MySqlService
Property Detail
charSetproperty
public var charSet:String = utf8

The character set to use for the connection

connectedproperty 
connected:Boolean  [read-only]

Returns true or false indicating is the MySqlService is currently connected.

This property can be used as the source for data binding.


Implementation
    public function get connected():Boolean
databaseproperty 
public var database:String

The database to switch to once connected

hostnameproperty 
public var hostname:String

The hostname to connect to

lastAffectedRowsproperty 
lastAffectedRows:int  [read-only]

Returns the number of affected rows returned after a data manipulation query by calling send()

This property can be used as the source for data binding.


Implementation
    public function get lastAffectedRows():int
lastInsertIDproperty 
lastInsertID:int  [read-only]

Returns the last insert id returned after a data manipulation query by calling send()

This property can be used as the source for data binding.


Implementation
    public function get lastInsertID():int
lastResultproperty 
lastResult:ArrayCollection  [read-only]

Returns the ArrayCollection of rows generated by ResultSet.getRows of the last ResultSet generated by calling send()

This property can be used as the source for data binding.


Implementation
    public function get lastResult():ArrayCollection
lastResultSetproperty 
lastResultSet:ResultSet  [read-only]

Returns the last ResultSet object generated by calling send()

This property can be used as the source for data binding.


Implementation
    public function get lastResultSet():ResultSet
passwordproperty 
public var password:String

The password to authenticate with

portproperty 
public var port:int = 3306

The port to connect to

responderproperty 
public var responder:IResponder

The responder to use for the mysql service

usernameproperty 
public var username:String

The username to authenticate with

Constructor Detail
MySqlService()Constructor
public function MySqlService()

Constructs a new MySqlService object.

Method Detail
connect()method
public function connect():void

Open the MySql connection

disconnect()method 
public function disconnect():void

Closes the connection

send()method 
public function send(queryObject:*):MySqlToken

Executes a query, you may pass in either an sql string or a Statement object.

Parameters

queryObject:*

Returns
MySqlToken
Event Detail
close Event
Event Object Type: flash.events.Event

Dispatched when the connection to MySql is terminated

connect Event  
Event Object Type: flash.events.Event

Dispatch when successfully connected to MySql

response Event  
Event Object Type: com.maclema.mysql.events.MySqlEvent

Dispatched when a data manipulation query successfully executes

result Event  
Event Object Type: com.maclema.mysql.events.MySqlEvent

Dispatch when a query successfully executes

sqlError Event  
Event Object Type: com.maclema.mysql.events.MySqlErrorEvent

Dispatched when an SQL error occurs.