Android : Is JDBC supported in Android devices?

前端 未结 5 1112
名媛妹妹
名媛妹妹 2020-12-06 05:48

I am doing an Android application using JDBC to send data to database without using any web services. I did an experiment using Android 2.2 emulator and I am able to send da

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-06 06:21

    Yes, you can connect to a database using JDBC in android. Just add this line to your gradle dependency:

     compile group: 'mysql', name: 'mysql-connector-java', version: '5.1.44'
    

    And don't forget to change the version according to your need.

    After adding this, gradle sync will be taking care of everything, you just have to connect to DB in the same way as you do in simple java jdbc program.

提交回复
热议问题