Local SQLite DB in FLex Mobile app -


I'm doing an app coding for Android and iOS devices using Flex. I have already created a SQLite DB and I want to access my data. I've seen some code looking with Google but I'm not able to run anything. I would be happy if you tell me where I have placed file.db in my project and if you share some simple code that allow me to connect to file.db and select some rows, my bad english and Thanks in advance for the thanks.

The code will return an object from the data bellow to the database.

  package bd {public class SQLPadConnection extension Extended SQLStatement {protected var _DBFilePatch: String = "DB.sqlite"; Protected var _conn: SQLConnection = new SQLConnection (); Public function SQLPadConnection () {var folder: file = File.userDirectory.resolvePath ('com.app.directoryName'); If (! Folder.exists) {folder.createDirectory (); } _conn.open (folder .resolvePath (_DBFilePatch)); This sqlConnection = _conn; Super(); } Public function getSQLData (SQL: string = ""): object {if (StringUtil.trim (= SQL)! = "") {This.begin (); This.text = SQL; This.execute (); This.commit (); Turn it back. GetResult (); } And return tap; }}}  

To use it, just do it honestly:

  var res: object = new object (); Var SQL: SQLPadConnection = New SQLPadConnection (); Res = SQL.getSQLData ("Select from * Tab"); Res = SQL.getSQLData ("INSERT IN / UPDATE / DELETE ...");  

Hope anyone help this.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -