JDBC vs Web Service for Android

前端 未结 4 1661
广开言路
广开言路 2020-11-22 01:27

Can someone answer on my dilemma which method to use for connecting Android device to mySQL or Postgresql?

I can do it in both ways without any erro

4条回答
  •  一整个雨季
    2020-11-22 01:53

    I can think of a few reasons

    1. JDBC android driver support for your database.
    2. Connection pooling across various Android devices make it difficult to monitor and cap them.
    3. Result sets sent from the DB to android will consume a lot of bandwidth and battery power.
    4. Proxies usuall allow HTTP access to your device.
    5. Exposing your database directly to the client has security implications.

    Web services can provide additional features on top of the JDBC connection like authentication / quality of service / authorization / conditional GET requests / error handling etc. JDBC cannot do any of these.

提交回复
热议问题