Sqlite database location via javascript in the context of Chrome browser
[PRE-NOTE: I am targeting only chrome/android default browser]
Hi,
I am currently using js statement var db = openDatabase ('db_name', '', 'db_desc', 2*1024*1024);
to open sqlite database and run my transactions.
I find the sqlite file located at C:\Documents and Settings\Administrator\Local Settings\Application Data\Google\Chrome\User Data\Default\databases\file__0\5
.
Can I somehow indicate the location to my sqlite database file explicitly (absolute path or something as mentioned here)?
I see this can be done for XUL applications e.g. var con开发者_如何学JAVA = new SQLite("test.sqlite",{location:'Desk'});
.
No, you can't specify a SQLite database manually.
The web sql database support in Chrome sandboxes the database to a specific origin (schema, host, port combination), and handles the database's creation and permissions transparently. It's quite different than the SQLite API in XUL, but has the advantage of being useful inside everyday web applications that don't require permissions to access arbitrary bits of the local computer's filesystem.
精彩评论