2 Replies Latest reply on Sep 7, 2009 1:03 AM by davidtyler

    Oracle with Air




      I want to interface with an Oracle database from Air - the database will be stored on the same machine as the Air Application.  I don't want to use a webservice as this would mean having to configure an app/web server on the same machine to act as a proxy which seems a bit OTT.


      I've been reading various posts about how to do this and I'm a bit confused.  I read about the ExternalInterface class which seems to allow interaction between Javascript and ActionScript but I'm not sure this will really help as Javascript can't connect to Oracle directly and ExternalInterface class isn't supported in Air.


      Does anyone have any suggestions as to how I could do this without the webserver?  I did read a post from someone saying that you could have a java app running as a service and interface with that from Air, but I'm not sure how that would be achieved i.e. how would air and the java app communicate?


      Thank you



        • 1. Re: Oracle with Air
          JeffryHouser Level 4

          In theory, you could write your own SQL drivers using socket connection to connect directly to the Oracle database.  I doubt this is a trivial undertaking, but it is in theory doable.  Here is some code for connecting to MySQL which may provide you with a jump start:




          Realisticaly, this is not something I'd recommend.  Using a "middleman" such as .NET, ColdFusion, Java, or whatever will save you plenty of headaches in the future.  Creating a Java app to run as a service is no different [in my opinion] than using a middle ware; except that you'd be writing the middleware yourself.


          Since you have Oracle on the same machine as the AIR app, I suspect it is safe to assume that this will not be rolled out to too many machines?  Just install the middleware.

          • 2. Re: Oracle with Air
            davidtyler Level 1

            Hi Jeffry


            Thank you for your response. The thing I'm trying to do is have an app that can run on a local machine, or the user can go to our website and access their data via a browser.  To achive this I want the data to be stored on the local machine, and optionally replicated onto our servers.


            I was planning to use the Oracle Mobile suite which is a cut down embedded version of the Oracle database for installation on mobile clients.  It has some pretty sophisticated replication technology built in which gives me exactly what I need, but the problem is interfacing with Air.


            Maybe I need to reassess how I approach this.  I've written database replication software before and I'm aware of the problems associated with replication so maybe it's going to be simplest (in terms of client install) to just use SQLite and write my own backup/replication engine.  I've had a look at Cold Fusion 9 beta with the replication of SQLite database but I'm not sure it's really going to give me what I need.


            I did ask a question similar to this before to which you provided some advice and answers.  Since then it seems I've managed to talk myself round in a complete circle.


            Thanks again for your time