This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Android and the fly likes how can i use remote database sqlserver from my andriod application? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Mobile » Android
Bookmark "how can i use remote database sqlserver from my andriod application?" Watch "how can i use remote database sqlserver from my andriod application?" New topic
Author

how can i use remote database sqlserver from my andriod application?

Suzzane Pinto
Ranch Hand

Joined: Feb 10, 2012
Posts: 213
hi,
can some tell me how to enter data into remote database i.e sql server in my case through my application?
if not possible please suggest alternatives

thanks
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1477
    
    6

Android itself can't interact with a remote database. What you need is bridge between these two. That can be a webservice or may be a servlet.

Request
-----------
Android---->Servlet----->Database

Response
----------
Database----->Servlet----->Android


Swastik
Suzzane Pinto
Ranch Hand

Joined: Feb 10, 2012
Posts: 213
how do i communicate to the servlet from my andriod app?please provide some links to refer if possible
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1477
    
    6

Suzzane Pinto
Ranch Hand

Joined: Feb 10, 2012
Posts: 213
thanks swastik!

can you give some examples which i can refer as i am new to the technology and this is my first app
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1477
    
    6

http://w3mentor.com/learn/java/android-development/android-http-services/example-of-http-get-request-using-httpclient-in-android/

http://www.anddev.org/networking-database-problems-f29/tutorial-of-calling-jsp-servlet-from-android-t1947.html

In the second case they are using URLConnection class instead of using HttpClient class. However as far as I have seen when you are on android it's better to use HttpClient class.
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1477
    
    6

Following is another good example, here post method is used.

http://developerlife.com/tutorials/?p=288
Suzzane Pinto
Ranch Hand

Joined: Feb 10, 2012
Posts: 213
thankyou
Suzzane Pinto
Ranch Hand

Joined: Feb 10, 2012
Posts: 213
[ UD: Removed duplicate post. That discussion is already going on at http://www.coderanch.com/t/570569/Android/Mobile/enter-binary-data-sql-server. Please stop asking the same question over and over again -instead of following up in existing threads- NOW. ]
Nicolas de Pomereu
Greenhorn

Joined: May 22, 2012
Posts: 4
I suggest you to use Awake SQL, a virtual JDBC Driver that is supported on Android with a dedicated packaging. Awake SQL has a

dual license (Open Source -LGPL v2.1 & commercial)

Disclaimer: I'm the author of Awake SQL.

Awake SQL allows you to code JDBC calls in Android. The JDBC calls are routed through HTTP and executed on the remote server.

The result is sent back using JSON.
The database is not accessed directly: the JDBC calls are filtered by a (configurable) Servlet on the remote server.

Awake SQL supports all major Open Source and commercial databases.

More info at: http://www.awake-sql.org
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how can i use remote database sqlserver from my andriod application?