問題描述
如何將 Android 應(yīng)用程序連接到存儲(chǔ)在 BlueMix 中的 DB2 數(shù)據(jù)庫?
How can I connect an Android application to a DB2 database stored in BlueMix?
我知道Android中缺少一些Java庫,所以無法使用JDBC連接數(shù)據(jù)庫.
I know that some Java libraries are missing in Android, so I can't use JDBC to connect to the database.
有什么想法嗎?
推薦答案
您無法從 Android 應(yīng)用程序直接與 Bluemix 上的 SQL DB 對(duì)話.您將需要在 bluemix 上創(chuàng)建一個(gè)與 db 對(duì)話的中間應(yīng)用程序,并且您的 android 應(yīng)用程序可以與該應(yīng)用程序?qū)υ?您可以將此后端實(shí)現(xiàn)為 RESTful API(Java JAX-RS、Node.js w/Express 等).Bluemix 上的 Boilerplates 是一個(gè)很好的起點(diǎn).
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.
Bluemix 上還有 Mobile Data 框架,通過設(shè)置為您準(zhǔn)備好所有的移動(dòng)后端.
There is also the Mobile Data framework on Bluemix that simplifies this by setting up all the mobile backend for you.
這篇關(guān)于將 Android 應(yīng)用程序連接到 BlueMix 存儲(chǔ)的 DB2 數(shù)據(jù)庫的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!