|Connect to an online SQL database||Mast3rpyr0||10/1/08 1:21 PM|
is this possible? i need to send data from my phone to a sql server on
my website instead of in an onboard SQLlite DB.
|Re: Connect to an online SQL database||Billsen||10/1/08 2:40 PM|
I think you may try to access database in your phone directly. If that
is the case, it is hard to do since there are no database drivers for
Oracle, MySql, MS SQL server in android. If you really want to push
data from your phone to database, you can develop application in your
web server to access database and send data from the phone to your
|Re: Connect to an online SQL database||Mast3rpyr0||10/1/08 2:42 PM|
hmm that kinda sucks, maybe a PHP script run from the phoen on the
webserver to get the appropriate data. but how could i do that behind
|Re: [android-developers] Re: Connect to an online SQL database||Ludwig||10/2/08 4:01 AM|
IMHO, the conceptually correct way to do this is with a ContentProvider, which exposes a database-like interface and can behind the scenes access any datasource you wish (yes, it can go across the net). 'Just' marshal your requests into a web request and parse the response into something like a MatrixCursor that you return (for queries).
(I am for my own stuff are accessing a REST interface to a MySQL DB, which gives me an XML file back, which I parse with SAX and fill into a MatrixCursor. Works fine - as long as the server is reasonably responsive and the result sets are not too large).
I would think that this is also a future-proof way of doing it as companies such as Oracle or Sun (MySQL) will almost certainly provide ContentProviders that can be configured to access their DBs sometime in the future.
2008/10/1 Mast3rpyr0 <Mast3...@gmail.com>
|Re: [android-developers] Connect to an online SQL database||Raymond C. Rodgers||10/2/08 8:08 AM|
Although I haven't done this on Android, and it's been a long time since
I did it in Java, Java will allow you to download JAR files from a web
site, and use them from within your application as if they were right
there all along. I used this a long time ago because I wasn't sure if I
was going to be using MySQL or PostgreSQL as an applet's backend, so I
wrote the applet's database support generically, and dynamically
downloaded the corresponding JDBC driver package which in turn let me
connect directly to the database I wanted to use.
Unfortunately, I don't have access to the code any more, it was lost in