我有一个内部 SQLite DB"Assets"我在其中存储了 100 个用户名和相应密码的文件夹,我如何通过phoneGap 访问它?
我读过了
http://docs.phonegap.com/en/1.6.1/cordova_storage_storage.md.html#Storage http://docs.phonegap.com/en/1.6.1/cordova_storage_storage.md.html#Storage
从android的phonegap html文件连接到sqlite数据库 https://stackoverflow.com/questions/9171662/connecting-to-sqlite-database-from-phonegap-html-file-for-android
-
http://wiki.phonegap.com/w/page/16494756/Adding-SQL-Database-support-to-your-iPhone-App http://wiki.phonegap.com/w/page/16494756/Adding-SQL-Database-support-to-your-iPhone-App
Am still not able to figure out How to connect to my internal DB which is already Created,
dbname = userauth
Tablename = reg
parameters = usrnm , psw
Any Answer is Highly Encouraged
Am using this here.
/**
* Creates / Opens a connection to DB
*/
DB.openDB = function() {
try {
if (!window.openDatabase) {
//alert('Cannot open database!');
} else {
var shortName = 'db_name';
var version = '1.0';
var displayName = 'DBNAME';
var maxSize = (DEVICE_TYPE == DEVICE_ANDROID || DEVICE_TYPE == DEVICE_ANDROID_TAB) ? 5242880 : 1000000; ////819200; //65536; // in bytes // increased to support Android//163840; //
this.vocabDB = window.openDatabase(shortName, version, displayName, maxSize, this.DBCreated);
this.DBSupported = true;
}
} catch(e) {
//console.log("DB Error handling code goes here.");
//console.log(e);
return;
}
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)