corp.setParent(rs.getString("parent"));
corp.setFlag(rs.getString("flag"));
list.add(corp);
}
} catch (Exception e) {
e.printStackTrace();
}finally{
this.closeResultSet(rs);
this.closeStatement(stmt);
this.closeConn(con);
}
return list;
}
}
[html]
< xml version="1.0" encoding="UTF-8" >
< xml version="1.0" encoding="UTF-8" >
5、创建Flex项目(这个很关键,详细配置方法 并编写mxml应用程序:
[java]
< xml version="1.0" encoding="utf-8" >
xmlns:mx="library://ns.adobe.com/flex/mx"
initialize="init()"
minWidth="955" minHeight="600">
import mx.collections.ArrayCollection;
import mx.events.FlexEvent;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
[Bindable]
private function init():void {
// TODO Auto-generated method stub
// 这里拿到的是一个 List
cdi.getAllCorp("","","","","","");
//remotingtest.showVal();
}
[Bindable]
var corpList:ArrayCollection = new ArrayCollection();
protected function cdi_resultHandler(event:ResultEvent):void {
// TODO Auto-generated method stub
corpList = event.result as ArrayCollection;
}
[Bindable]
protected function cdi_faultHandler(event:FaultEvent):void {
}
]]>
< xml version="1.0" encoding="utf-8" >
xmlns:mx="library://ns.adobe.com/flex/mx"
initialize="init()"
minWidth="955" minHeight="600">
import mx.collections.ArrayCollection;
import mx.events.FlexEvent;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
[Bindable]
private function init():void {
// TODO Auto-generated method stub
// 这里拿到的是一个 List
cdi.getAllCorp("","","","","","");
//remotingtest.showVal();
}
[Bindable]
var corpList:ArrayCollection = new ArrayCollection();
protected function cdi_resultHandler(event:ResultEvent):void {
// TODO Auto-generated method stub
corpList = event.result as ArrayCollection;
}
[Bindable]
protected function cdi_faultHandler(event:FaultEvent):void {
}
]]>
6、现在可以直接运行mxml文件查看数据,当然这里写的是我的数据库查询,你将你的程序稍稍改动即可。