Recently we have been working with Adobe Flex and Live Cycle Data Services, part from some little bugs the products seems great. The only thing that stops me from using more Flex is the fact that you need to have a license to use Adobe Live Cycle Data Services and not all customers are interested to make this investment.
So I was looking for a solution and came across this nice example of Mike Potter. He demonstrates how you can use flex with php in order to update a mySQL Database. This should also be possible in Oracle I thought, using mod pl/Sql. Let’s give it a try:
The first thing I wanted to accomplish was to display data from an Oracle database into my flex application. I will use xml to retrieve and display my data.
I started by making a new flex project with a custom component were I implemented a simple datagrid where I would display my retrieved data.
The next thing to do was to let Oracle display some xml so I could retrieve this back into my flex application. I will do this a simple as possible and just use the htp.p function in order to display some static xml:
I then called my procedure in my browser and checked of the xml is correctly generated:
This seemed correct, now I had to retrieve this data into my flex application. I will use the HTTPService tag in mxml to do this. As url property I gave the same location I typed in my browser to check the xml. Now complete your HTTPService with the right resulthandler, I used an Arraycollection to store my data and specified it as dataprovider in my datagrid. The result was what I hoped for:
This is the most simple example of course, but now I’m launched for some further research.