Friday, August 24th, 2007p>Justin Palmer has an interesting post about the dealing with the asynchronous nature of Adobe AIRâ€™s SQLConnection class and the challenges it poses when dealing with the DBMS’ response. Justin shows some creative ways of working around this through the use of Responder objects and event listeners:
var connection = new air.SQLConnection();
var statement = new air.SQLStatement();
statement.sqlConnection = connection;
statement.text = "SELECT * FROM contacts";
The code above, albeit a little long winded, is the bare necessities for executing a query. While it looks fairly straightforward on the surface, weâ€™ve already run into our first problem. If the execute operation is asynchronous, how do we know when we can begin to retrieve and manipulate the data returned? We can do it one of two ways, register an event listener or pass a Responder object to the execute method.
From the looks of this thread it appears this is on the minds of several other folks and Adobe’s working on developing a method for synchronous SQL calls is in the works.
Posted by Rey Bango at 6:00 am