flex_assql连接mysql

是google的例子 http://code.google.com/p/assql/wiki/Examples#Inserting_Binary_Data_Example

google 类库 http://code.google.com/p/assql/

<!--l version="1.0" encoding="utf-8-->

 

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        xmlns:assql="com.maclema.mysql.mxml.*" 
        layout="absolute">
        
        <mx:Script>
        <![CDATA[
                        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);
                }
        ]]>
        </mx:Script>
        
        <assql:MySqlService id="service"
                hostname="localhost" 
                username="root"
                password="password"
                database="rpg"
                autoConnect="true"
                port="3306"
                connect="handleConnected(event)" 
                sqlError="handleError(event)" />
                
        <mx:DataGrid id="grid" left="10" right="10" top="10" bottom="10"
                dataProvider="{service.lastResult}"
                columns="{ResultsUtil.getDataGridColumns(service.lastResultSet)}" />

</mx:Application>

 

你可能感兴趣的:(xml,mysql,Flex,Google,Adobe)