Open GoogleCodeExporter opened 9 years ago
var Connection = window.runtime.com.maclema.mysql.Connection;
var Statement = window.runtime.com.maclema.mysql.Statement;
var ResultSet = window.runtime.com.maclema.mysql.ResultSet;
var ResultsUtil = window.runtime.com.maclema.util.ResultsUtil;
var MySqlToken = window.runtime.com.maclema.mysql.MySqlToken;
var MySqlEvent = window.runtime.com.maclema.mysql.events.MySqlEvent;
var con;
function onCreationComplete()
{
con = new Connection("localhost", 3306, "root", "", "database");
con.addEventListener(air.Event.CONNECT, handleConnected, false);
con.connect();
}
function handleConnected()
{
var st = con.createStatement();
var token = st.executeQuery("SELECT * FROM table");
token.addResponder(
new window.runtime.mx.rpc.AsyncResponder(
function(data, token)
{
var rs = ResultSet(data);
var rows = rs.getRows();
alert("Total " + rs.size());
var resultHtml = '';
for(i = 0; i < rs.size(); i++)
resultHtml += rows[i]['column_1'] + ' - ' + rows[i]['column_2'];
alert(resulHtml);
},
function(info, token)
{
alert("Error: " + info);
},
token
));
}
Original comment by marcelo....@gmail.com
on 14 Jan 2010 at 1:57
add in html project:
<script type="application/x-shockwave-flash"
src="lib/air/swf/framework/framework/library.swf"></script>
<script type="application/x-shockwave-flash"
src="lib/air/swf/framework/rpc/library.swf"></script>
Librarys framework.swc and rpc.swc.
Original comment by marcelo....@gmail.com
on 14 Jan 2010 at 5:08
Verty Tahnks ,'m trying now
Original comment by cihanozt...@gmail.com
on 2 Mar 2010 at 8:15
Original issue reported on code.google.com by
cihanozt...@gmail.com
on 15 Dec 2009 at 10:42