从Android应用程序访问SQL Server 2008中的数据 [英] Accessing data in SQL Server 2008 from an Android application

查看:66
本文介绍了从Android应用程序访问SQL Server 2008中的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Android开发的新手,并且遇到了一些困扰我的问题,更糟糕的是我还没有找到答案。



要求:



1.)我正在开发使用eclipse作为基础IDE的Android应用程序。我的数据安全地驻留在SQLserver 2008中。我不想使用SQLite / MySql。



2.)这里的要求是,在按钮上单击应用程序应该与SQLServer 2008数据库交谈,从中获取数据并在视图中列出数据。



这可能吗?如果没有,则此行下方的查询无效。



问题:



我尝试谷歌提供诸如Android和sqlserver连接之类的查询,

从Android中的sqlserver中提取数据并最终得到如下答案,我是

在这里失去了轨道。



1.)有些人使用PHP脚本为我的Sql显示它,但我使用的是java和SQL Server 2008.我不是获取链接。



2.)有些人只是说我们必须使用Web服务来完成它。我尝试了解,但没有一个示例显示实现Web服务并使用它。他们刚刚使用KSoap拨打在线可用的Web服务添加2个号码。



查询:



Web Service是Android中与数据库通信的唯一方式吗?如果是,那我该怎么办呢。任何人都可以指导我



1.)如何在Android应用程序中创建一个Web服务并从java代码中调用它。



2.)如何从Web服务与SQLServer 2008 DB对话并获取数据。



任何帮助都非常感谢,谢谢所有。

I'm new to Android development and have certain issue which is troubling me a lot, and worse is I haven't found the answer to it yet.

Requirement:

1.) I'm developing Android app using eclipse as my base IDE. I have my data safely residing in SQLserver 2008. I don't want to use SQLite/MySql.

2.)Requirement here says, on a button click the application should talk to the SQLServer 2008 database, fetch data from it and list the data in the view.

Is that possible?? If no then queries below this line are invalid.

Problem:

I tried to google it up providing queries like "Android and sqlserver connectivity",
"extracting data from sqlserver in Android" and ended up getting answers like below and I'm
losing track here.

1.) Some show it using a php scripting for My Sql but i'm using java and SQL Server 2008. I'm not getting the link here.

2.) Some just say we have to use a Web Service to do it. I tried understanding that but none of the examples showed implementing a web service and using it. They just made a call to online available Web Service using KSoap to add 2 numbers.

Query:

Is Web Service the only way in Android to communicate with a DB? If yes then how can i approach it. Can anyone guide me as to

1.) How to create a web service in Android application and call it from java code.

2.) How to talk to SQLServer 2008 DB from the webservice and fetch back the data.

Any help is deeply appreciated, Thanks to all.

推荐答案





你需要使用JDBC驱动程序来做你需要的事情,

请参考 how-to-connect-and-access-sql-database-server-from-android-app / [ ^ ]

让我知道它是否有帮助。



谢谢,

Hitesh Varde
Hi,

you need to use JDBC drivers for doing what you need,
Please refer how-to-connect-and-access-sql-database-server-from-android-app/[^]
Let me know if it helps.

Thanks,
Hitesh Varde


Hi Sujeet KC ,我和你一样处于紧急状态!我无法像你一样描述这个问题。如果你找到了正确答案,我可以问你吗?谢谢,大卫。
Hi Sujeet KC, I am in the EXACT situation as you were! I couldn't describe the question as good as you did. May I ask you if you found a correct answer to your question? thanks, David.


这篇关于从Android应用程序访问SQL Server 2008中的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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