Solved

Connect to a database SQL preferible

Posted on 2011-02-18
4
1,151 Views
Last Modified: 2012-05-11
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?
Thanks,
COHFL
0
Comment
Question by:COHFL
  • 3
4 Comments
 
LVL 17

Expert Comment

by:Dejan Pažin
ID: 34932528

Where do you want to have the database - on the phone or on the server? And which database?
0
 
LVL 17

Expert Comment

by:Dejan Pažin
ID: 34937005

1. For database on the Android device, there is full sqlite support. See here:
 
    http://developer.android.com/guide/topics/data/data-storage.html#db

    Or you can use db4o:

    http://www.db4o.com/android/

2. For connecting to mysql, see this:

http://downloadandroid.info/2010/05/how-to-connect-to-mysql-database/
0
 

Author Comment

by:COHFL
ID: 34951502
The database is locate on a web server and it is going to be SQL 2005
0
 
LVL 17

Accepted Solution

by:
Dejan Pažin earned 500 total points
ID: 34951872

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


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

http://jtds.sourceforge.net/

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

http://stackoverflow.com/questions/2379237/android-with-sql-server-2008
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
computer science syllabus 3 88
nini micro sd card issues 9 156
Pictures cut off when texting 13 128
saving voicemail from mobile phone to pc.. 4 96
I tend toward trying the newest hardware and software.  Thiss sometimes works out to my benefit, and sometimes not.  Because I downloaded and installed Android 5.x (http://www.experts-exchange.com/articles/18084/Upgrading-to-Android-5-0-Lollipop.htm…
In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
This video is in connection to the article "The case of a missing mobile phone (https://www.experts-exchange.com/articles/28474/The-Case-of-a-Missing-Mobile-Phone.html)". It will help one to understand clearly the steps to track a lost android phone.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question