在 HTML 5 中从 SQL 数据库提取数据
我正在尝试开发一个 BlackBerry 应用程序,该应用程序将显示来自服务器 SQL 数据库的数据。我正在研究黑莓 (WebWorks) 的新 HTML 5 选项,并注意到它本身显然无法连接到任何服务器数据。一些链接指出我需要 JavaScript 编码才能获取它。我研究了 PhoneGap 的选项(链接在这里:http://phonegap.com/)并决定我尝试使用 HTML 5 来生成应用程序。我以前从未接触过 SQL 数据库,我想知道如何将两者连接起来;意思是如果您使用的是 HTML5,如何从服务器提取数据?
我看过:
等等,但我仍然不确定该怎么做。我希望“查看”来自服务器的数据并将其显示在应用程序上。它会是这样的:
- HomeScreen:您想查看什么数据?:
- 类别下拉列表(来自数据库)
- 在下拉列表中选择条目可获取可用信息(来自数据库)
如有任何帮助,我们将不胜感激,当然,提前致谢。
I am trying to develop a BlackBerry application that will show data from an SQL Database from a server. I was researching the new HTML 5 option for blackberry (WebWorks) and noticed that it apparently cannot connect to any server data by itself. Some links state that I would need javascript coding to obtain it. I looked into the option of PhoneGap (link here: http://phonegap.com/) and decided I'd try using HTML 5 to produce the application. I have never touched SQL databases before and I am wondering how I would connect the two; meaning how do you pull data from the server given that you are working with HTML5?
I have looked at:
Where is data stored when using an HTML 5 Web SQL Database
Process for pulling data from a sql database
among others but I am still unsure as to what to do. I would be looking to "view" the data from the server and display it on the app. It would be something of the sort:
- HomeScreen: What data would you like to view?:
- Dropdown list of categories (from the database)
- Selecting Entry in dropdown leads to available information (from the database)
Any help would be appreciated, and of course thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
HTML5 的新(而且非常棒)功能正在客户端的浏览器中实现。您需要的是服务器端的后端来执行一些魔法。确实,浏览器现在拥有数据库,但这些数据库位于手机、计算机等上,据我了解您的问题,您希望这些数据与服务器上的数据进行通信。要在网络上移动数据,您需要执行 HTTP 请求,这可以通过 javascript 和 ajax 轻松完成。研究一下这些技术,制作一个小的服务器端脚本,从数据库收集数据并将其以结构化格式发送到手机(JSON、XML),然后在客户端用 javascript 制作一个脚本来解析这些数据数据并利用它们。
祝你好运!
the new (and pretty awesome) features of HTML5 is happening in the browser on the client side. What you will need is a back-end on the server side doing some magic. It is true that browsers now have databases but these are located on the phone, computer etc and as I understand your question you want these data to communicate with data on your server. To move data across the web you will need to perform HTTP-requests which can easily be done through javascript and ajax. Look a bit into these technologies and make a little server-side script that gathers data from the database and send it in a structured format to the phone (JSON, XML), then make a script in javascript on the client-side that parse these data and utilise them.
Good luck!