PhoneGap的同步与SQL Server [英] phonegap sync with sql server

查看:161
本文介绍了PhoneGap的同步与SQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发PhoneGap的Andr​​oid应用程序。在我的应用程序的用户将进入数据和数据将被存储在内部SQLite数据库。
现在我的问题
1.如何从SQLite数据库从PhoneGap的应用程序或发送的所有数据,以SQLSERVER
2.反正有存储数据从PhoneGap的直接SQL Server数据库。

I am developing Phonegap android application. In my Application user will enter the data and that data will be stored in sqlite database internally. Now my Question 1. how can send all the data from sqlite database to sqlserver from phonegap application Or 2. Is there anyway to store data from phonegap to directly sql server database.

推荐答案

问题1的答案
只有这样,才能使用AJAX调用从您的PhoneGap到服务器发送数据。如何让你的AJAX调用取决于哪个框架您正在使用。如果它是JQuery的,它可以是一个简单的$就呼叫。如果你使用的是AngularJS或任何Knockout.js可能会改变。
如果数据要传送量大时,更好的方法是使用一个同步的插件是这样的:的https:// github.com/orbitaloop/WebSqlSync 或实现自己的同步功能。

Answer to question 1 The only way to send data from your phonegap to the server is using AJAX calls. How you make the ajax call depends on which framework you are using. If it is JQuery, it can be a simple $.ajax call. That might change if you are using AngularJS or any Knockout.js. If the amount of data to be transferred is large, a better approach is to use a sync plugin like this : https://github.com/orbitaloop/WebSqlSync or implement your own sync functionality.

回答问题2
您可以直接从PhoneGap的到SQL Server数据库中存储数据的唯一方法是尽快使Ajax调用的数据准备好保存。
这可能会在数据很小的情况下工作,但可能会导致性能问题时,数据是很大的。

Answer to question 2 The only way you can store data directly from phonegap to SQL Server database is by making ajax calls as soon as the data is ready to be saved. That could work in cases where the data is small, but could cause performance problems when the data is large.

这篇关于PhoneGap的同步与SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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