Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
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.
Posted
Updated 27-Apr-14 21:55pm
v2
Comments
DamithSL 29-Apr-14 3:05am    
how your android device connect to database?( using internet or intranet) if it is internet, do you have database server which accessible from internet?
Sujeet KC 29-Apr-14 3:14am    
It's using internet and yes i do have a database server. But that's where the problem lies. I came to know i need middle layer of web service to have that functionality. Can you point me some articles where in they provide detailed knowledge on how to create webservice, deploy it in server, access the web service method from android code....please

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
 
Share this answer
 
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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900