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