connect to sql server from android

后端 未结 3 1840
你的背包
你的背包 2020-11-28 13:32

I\'m currently developing a Field-Service application that stores data in the local sqlite database on an android device. At some point, usually after completing the data co

相关标签:
3条回答
  • 2020-11-28 14:07

    You would have to keep a middle tier online server.Which may communicate to and fro between your application and MSSQL db.May be servlet or a request handler which synchronises between the SQLite and SQL Server db.

    0 讨论(0)
  • 2020-11-28 14:18

    Another and much easier approach is to use a Virtual JDBC Driver that relys on a secured three-tier architecture: your JDBC code is sent through HTTP to a remote Servlet that filters the JDBC code (configuration & security) before passing it to the MySql JDBC Driver. The result is sent you back through HTTP.

    There are some free software that use this technique. Just Google "Android JDBC Driver over HTTP".

    0 讨论(0)
  • 2020-11-28 14:24

    I think that the best is using a intermediary like web services or your own TCP based logic layer for your application which would connect to SQL server and execute requests of your applicatation. Don't try to connect to your SQL server directly from Android. You can write some backend code on your server (or webservice) and then call those code methods from your android device using Http.

    And also there are many themes in stackoverflow like your:

    • How to connect Android to a database server
    • Connecting android with MS SQL SERVER 2008

    About how to write web services. It's a big question, and you must choose technology, there are very many libraries, frameworks and platforms that help you to simply write a web service. You must choose communicating protocol, it may be SOAP, WSDL or maybe remove calling procedure, it may be rest application. If you use java stack, there are some popular frameworks at the moment:

    • Apache CXF
    • Spring Web Services
    • Axis2

    You can start from reading what a web service is:

    • http://en.wikipedia.org/wiki/Web_service

    Also some links which provide example of accessing web services from android:

    • Step by step to access web service from android
    • Android and soap web services
    • Accessing restfull web service with android
    0 讨论(0)
提交回复
热议问题