问题
I.m working on a project. It's an android app that connects to our server database. Our server uses Firebird. I want to read data from it and display the results in an android app. I've tried looking for tutorials about android and firebird but I can't find any. Does anybody know how? Or any site you could recommend for me to start coding android and firebird? It would be better to have a sample code for connecting to the database and queries. Just simple Select queries is all I need. Thanks ahead!
回答1:
As others have mentioned, don't access Firebird directly from your mobile phone, but put a REST or other type of webservice in between.
The disadvantages of using Firebird (or any other database) directly are:
- Chatty wire protocol, so the performance is not good, especially on high latency connections
- Users will have direct access to your database server, and every user will have the credentials of your database
- You will expose the full surface of a Firebird database instead of the smaller, application specific API of a webservice, increasing the risk of abuse etc
If - given these objections - you still want to access your Firebird database from an adroid phone, you can use the Android port of Jaybird, available on the Android Jaybird project website.
回答2:
I would also recommend the same,Let your android device connect to an appserver or some middle ware and let the appserver perform the dbconnections rather.Even if your android device is connecting to local server, then connect locally to your midleware local server and your middleware will respond with your Firbird query results to your android devise via standard data transfer methods(JSON,SOAP or any method that you fancy).
来源:https://stackoverflow.com/questions/16878100/how-do-you-connect-firebird-database-to-android