xmlns:assql="com.maclema.mysql.mxml.*"
layout="absolute">
import mx.controls.Alert;
import com.maclema.mysql.events.MySqlErrorEvent;
import com.maclema.util.ResultsUtil;
private function handleConnected(e:Event):void {
Alert.show("连接成功")
service.send("SELECT * FROM user");
}
private function handleError(e:MySqlErrorEvent):void {
Alert.show(e.text);
}
]]>
hostname="localhost"
username="root"
password="password"
database="rpg"
autoConnect="true"
port="3306"
connect="handleConnected(event)"
sqlError="handleError(event)" />
dataProvider="{service.lastResult}"
columns="{ResultsUtil.getDataGridColumns(service.lastResultSet)}" />