X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775:/docs/source/AirConnection.html diff --git a/docs/source/AirConnection.html b/docs/source/AirConnection.html deleted file mode 100644 index 58bf9324..00000000 --- a/docs/source/AirConnection.html +++ /dev/null @@ -1,87 +0,0 @@ - -
-Ext.sql.AirConnection = Ext.extend(Ext.sql.Connection, { - // abstract methods - open : function(db){ - this.conn = new air.SQLConnection(); - var file = air.File.applicationDirectory.resolvePath(db); - this.conn.open(file); - this.openState = true; - this.fireEvent('open', this); - }, - - close : function(){ - this.conn.close(); - this.fireEvent('close', this); - }, - - createStatement : function(type){ - var stmt = new air.SQLStatement(); - stmt.sqlConnection = this.conn; - return stmt; - }, - - exec : function(sql){ - var stmt = this.createStatement('exec'); - stmt.text = sql; - stmt.execute(); - }, - - execBy : function(sql, args){ - var stmt = this.createStatement('exec'); - stmt.text = sql; - this.addParams(stmt, args); - stmt.execute(); - }, - - query : function(sql){ - var stmt = this.createStatement('query'); - stmt.text = sql; - stmt.execute(this.maxResults); - return this.readResults(stmt.getResult()); - }, - - queryBy : function(sql, args){ - var stmt = this.createStatement('query'); - stmt.text = sql; - this.addParams(stmt, args); - stmt.execute(this.maxResults); - return this.readResults(stmt.getResult()); - }, - - addParams : function(stmt, args){ - if(!args){ return; } - for(var key in args){ - if(args.hasOwnProperty(key)){ - if(!isNaN(key)){ - var v = args[key]; - if(Ext.isDate(v)){ - v = v.format(Ext.sql.Proxy.DATE_FORMAT); - } - stmt.parameters[parseInt(key)] = v; - }else{ - stmt.parameters[':' + key] = args[key]; - } - } - } - return stmt; - }, - - readResults : function(rs){ - var r = []; - if(rs && rs.data){ - var len = rs.data.length; - for(var i = 0; i < len; i++) { - r[r.length] = rs.data[i]; - } - } - return r; - } -});- - \ No newline at end of file