2

How can I connect an Android application to a DB2 database stored in BlueMix?

I know that some Java libraries are missing in Android, so I can't use JDBC to connect to the database.

Any Idea?

EagleOne
  • 541
  • 1
  • 10
  • 28

1 Answers1

4

You can not talk directly to the SQL DB on Bluemix from your android app. You will need to create an intermediary application on bluemix that talks to the db and your android app can talk to that application. You can implement this backend as a RESTful API (Java JAX-RS, Node.js w/ Express etc). The Boilerplates on Bluemix are a good place to start.

There is also the Mobile Data framework on Bluemix that simplifies this by setting up all the mobile backend for you.

Ram Vennam
  • 3,536
  • 1
  • 12
  • 19
  • Could you please be more detailed about Mobile Data framework integration with a DB2 database? – EagleOne May 04 '15 at 11:18
  • 1
    [Mobile Data](https://www.ng.bluemix.net/docs/#services/data/index.html#data) is a complete backend solution which provides SDK's for devices to natively deal with data and the backend service. The Mobile Data service uses Cloudant as its database. You can not integrate Mobile Data with a SQL DB service. If you already have your data the SQL DB, you could write a simple application on Bluemix which talks to the database, and exposes an API for your Android application. The Java DB Boilerplate should be a good place to start as it already does this. – Ram Vennam May 04 '15 at 14:22
  • Is this service free? – EagleOne May 04 '15 at 15:57
  • In the Blueimx Catalog, click on "Mobile Cloud" for more information about pricing and docs – Ram Vennam May 04 '15 at 16:02
  • Do you mean Java DB Starter? – EagleOne May 04 '15 at 16:04
  • Both Java DB Web Starter and Mobile Cloud are available in the Catalog. – Ram Vennam May 04 '15 at 16:06