在Chrome浏览器的上下文中通过javascript进行Sqlite数据库定位 [英] Sqlite database location via javascript in the context of Chrome browser

查看:485
本文介绍了在Chrome浏览器的上下文中通过javascript进行Sqlite数据库定位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[预注:我只定位chrome / android默认浏览器]

[PRE-NOTE: I am targeting only chrome/android default browser]

我目前正在使用js语句 var db = openDatabase('db_name','','db_desc',2 * 1024 * 1024); 来打开sqlite数据库并运行我的事务。

I am currently using js statement var db = openDatabase ('db_name', '', 'db_desc', 2*1024*1024); to open sqlite database and run my transactions.

我发现sqlite文件位于 C:\Documents and Settings \Administrator \ Local Settings \ Application Data \ Google \ Chrome \User Data \Default\databases\file__0\5

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.

我可以以某种方式指示我的位置显式的sqlite数据库文件(绝对路径或提到的东西这里)?

Can I somehow indicate the location to my sqlite database file explicitly (absolute path or something as mentioned here)?

我认为这可以用于 XUL应用程序例如 var con = new SQLite(test.sqlite,{location:'Desk'});

I see this can be done for XUL applications e.g. var con = new SQLite("test.sqlite",{location:'Desk'});.

推荐答案

不,您不能手动指定SQLite数据库。

No, you can't specify a SQLite database manually.

Chrome中的Web sql数据库支持将数据库沙箱化为特定的origin(架构,主机,端口组合),并透明地处理数据库的创建和权限。它与XUL中的SQLite API完全不同,但具有在日常Web应用程序中非常有用的优点,这些应用程序不需要访问本地计算机文件系统的任意位的权限。

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.

这篇关于在Chrome浏览器的上下文中通过javascript进行Sqlite数据库定位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆