• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1160
  • Last Modified:

Connect to a database SQL preferible

Hi there,
I have done some research on how to develop Android apps but there a few gaps that i would like to cover. I have create "Hello World", Textbox integration and all that good stuff. But now i need to some how hook it up to a SQL database and have a login and things like that. I read that a direct connection to SQL is not possible for some reason which at the end make some sort of sense.
My question is how can i connect to a SQL database if web service is the way to go is there a good tutorial that points me to the right direction? What would be the best practices?
  • 3
1 Solution
Dejan PažinCommented:

Where do you want to have the database - on the phone or on the server? And which database?
Dejan PažinCommented:

1. For database on the Android device, there is full sqlite support. See here:

    Or you can use db4o:


2. For connecting to mysql, see this:

COHFLAuthor Commented:
The database is locate on a web server and it is going to be SQL 2005
Dejan PažinCommented:

In that case, go for the solution no. 2 in the first post.

Or, you can try jtds driver and connect with that:


That would of course be simpler, but I've never tried it. Some people claim it works:


Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now