简体   繁体   English

将SQL数据从android导出到MS SQL Server 2008

[英]Export SQL data from android to MS SQL server 2008

I'm fairly still new to android and I was wondering, what is the best way to get data from an android device to MS SQL server 2008? 我对Android还是很陌生,我想知道,从Android设备向MS SQL Server 2008获取数据的最佳方法是什么? I've seen a number of people who have commented on several ways to do this but I'm looking for a means of somehow exporting the data as an XML based file and trying to send it via internet (maybe web service) to be inserted into MS SQL server. 我见过很多人对执行此操作的几种方法发表了评论,但我正在寻找一种方法,以某种方式将数据导出为基于XML的文件,并尝试通过Internet(也许是Web服务)进行发送进入MS SQL服务器。 Problem is that I'm not sure how to take the XML file from an android device and get it to insert into MS SQL server. 问题是我不确定如何从Android设备中获取XML文件并将其插入到MS SQL Server中。 I am missing the steps in this process and I haven't seen anything that has clearly stated how to do this. 我错过了此过程中的步骤,而且还没有看到任何明确说明如何执行此操作的内容。 For instance once you have the XML what do you do next, and so on? 例如,一旦有了XML,下一步该怎么做,依此类推? I just need some light to be shed on this subject anything would be much appreciated, thanks! 我只需要阐明这个问题,任何事情都会受到赞赏,谢谢!

As much i understood your question that you want to send xml file's(that is in your phone) to mysql server, right? 据我所知,您想将xml文件(在您的手机中)发送到mysql服务器,对吗?

if data is small and whole data can be send in one request,may be following steps usefull for you- 如果数据很小并且可以在一个请求中发送整个数据,则可以执行以下对您有用的步骤-

  1. read data from xml file you can use any technique like xml pull parser or dom. 从xml文件读取数据,您可以使用xml pull解析器或dom之类的任何技术。
  2. make a method for http request. 提出http请求的方法。
  3. make a service that will receive this http request and transfer it to server. 提供将接收此http请求并将其传输到服务器的服务。

these are the very basic and common steps to perform this task... hope this will help... 这些是执行此任务的最基本且通用的步骤。希望对您有所帮助。

How is the data stored on the device? 数据如何存储在设备上? Do you need to send it over the internet or are you exporting it via the usb cable? 您是否需要通过Internet发送或通过USB电缆将其导出?

If you sending data over the internet to a web server that will then insert this data into your MS SQL database, Android comes with some useful JSON APIs that make serializing the data pretty straight forward. 如果您通过互联网将数据发送到Web服务器,然后将这些数据插入到MS SQL数据库中,则Android随附了一些有用的JSON API,这些API使序列化数据变得非常简单。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM