dojox.sql._SQLCrypto._execEncryptSQL
dojo.require("dojox._sql.common");
defined in dojox/_sql/common.js
Usage
function (sql, password, args, callback) (view source)
var strippedSQL = this._stripCryptoSQL(sql); // determine what arguments need encryption var encryptColumns = this._flagEncryptedArgs(sql, args); // asynchronously encrypt each argument that needs it var self = this; this._encrypt(strippedSQL, password, args, encryptColumns, function(finalArgs){ // execute the SQL var error = false; var resultSet = []; var exp = null; try{ resultSet = dojox.sql.db.execute(strippedSQL, finalArgs); }catch(execError){ error = true; exp = execError.message||execError; } // was there an error during SQL execution? if(exp != null){ if(dojox.sql._autoClose){ try{ dojox.sql.close(); }catch(e){} } callback(null, true, exp.toString()); return; } // normalize SQL results into a JavaScript object // we can work with resultSet = dojox.sql._normalizeResults(resultSet); if(dojox.sql._autoClose){ dojox.sql.close(); } // are any decryptions necessary on the result set? if(dojox.sql._needsDecrypt(sql)){ // determine which of the result set columns needs decryption var needsDecrypt = self._determineDecryptedColumns(sql); // now decrypt columns asynchronously // decrypt columns that need it self._decrypt(resultSet, needsDecrypt, password, function(finalResultSet){ callback(finalResultSet, false, null); }); }else{ callback(resultSet, false, null); } });
parameter | type | description |
---|---|---|
sql | ||
password | ||
args | ||
callback |