I need to write app to get data from Ms sql 2008 r2 database.I think write web service to get data and via web service i get data to my app.Is this good way or is there any other way to do this? I think use java to write web service.
First You need to create a REST or SOAP Service with MS SQL Server as Backend. Then connect to this service from your application to request or upload data.
Most of the time these services accept and return XML data.