Ted Patrick > { Events & Community } > Adobe Systems


ASR Remoting - SQL RecordSet on the Server-Side

Instead of roundtriping back to the Flash Client, you can get values from records on the server-side via ASR Remoting. This is very helpful when you want to execute n SQL statements in a row where data from one result is input for another.

//ASR SERVER-SIDE FUNCTION

function getsession(){

sql = "Select id FROM session WHERE username='"+username+"'"
rd = CF.query("db001",sql)

//move cursor to first record
rd.first()

//retrieve string
var nid = rd.getInt('id')

return nid
}

The trick is realizing that the returned recordset is an instance of java.sql.resultSet. Just use the java methods on it and it will give you all the data you need.

Also make sure to brush up on your database cursors!!!! That threw me for a loop.

I am really starting to love Rhino, it is the best of both Javascript and Java.

Cheers,

ted ;)


0 Responses to “ ASR Remoting - SQL RecordSet on the Server-Side ”

Post a Comment



Jobs


Flex Jobs
city, state, zip


© 2008 Ted On Flash