View Full Version : Interfacing with DB

11-16-2006, 09:16 PM
So being a designer rather than a developer I'm quite clueless as to how to get an app to pull and write to a database. I've seen videos that show the code in Flex but what do I need to do to set up a database and such? Or just read and write to an xml file, as well. That seems less complicated and probably more suitable to my developing skills.

If someone could help or point me in the right direction, I would be grateful.

11-16-2006, 09:23 PM
Flex does not directly interface with any database software. It requires a middle connector to handle database transactions.

So, first, you'll need your database software. The software you're looking for MySQL server, MSSQL server, or if you're lucky, Oracle server. MSSQL is pricey. Oracle is even more pricey. MySQL server is free :)

Once you've got your database server of choice running, you need some way for your application to connect to it. This is typically done using another programming langauge (since the DB connections are usually built into those). Examples would be ColdFusion, PHP, ASP, etc.

Once you have both of those up and running, your Flex app can make a call to your ColdFusion, PHP, ASP script to fetch information from the database. ColdFusion is pricey, PHP is free, and I dunno about ASP (never used it).

If you want my personal advice, go with MySQL (free) and ColdFusion as your connector language. ColdFusion is also built by the same company as Flex (Adobe), so it's very easy to integrate with Flex if you've got programming background. I use this setup myself.

11-16-2006, 09:26 PM
Oop -- didn't see your bit about XML.

If you want really easy, XML is the way to go. Flex can directly read and parse XML files from your server, so you don't need any extra connector like you do with a database transaction.

If you're not familiar with databases and don't expect to use them a whole lot, I would say just use XML. It'll save you time in the short run as long as you're not doing anything too intensive.

11-16-2006, 09:35 PM
Awesome. I got a mysql/php book a long time ago and did set up a table and that. I remember pretty much nothing about creating the tables so xml would be preferable.

Again, being a designer; does parse mean write and save it or do I need more information about doing that, as well? Sorry for the noob questions but thank you much for the reply.

11-17-2006, 02:54 AM
Parsing means searching the text (in this case, XML) for the information you want.

In both the database/XML concepts, you're going to have to do a lot of programming. XML is easier, I would say -- but it's no trivial task if you're not familiar with programming languages.

If you're looking to go the XML route, here's Adobe's write-up on how to interact with it: http://livedocs.macromedia.com/flex/2/docs/00001910.html

That should help out a little :)

11-17-2006, 04:34 PM
Cool, thanks. I will look into it.

11-27-2006, 05:49 AM
I found this tutorial helpful. I'm new to this as well.