How to connect to a MySQL Database from an Android App?

前端 未结 3 1885
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-19 22:10

I would like to connect to a MySQL Database hosted on the same server with a Tomcat Server from my Android App without using PHP. Is there any way to do this? I found some s

3条回答
  •  青春惊慌失措
    2020-12-19 22:37

    Because you're running on Tomcat I imagine the best way to access the database would be to write a webservice that handles the communication between the app and the server.

    The webservice will be written in Java to run on TomCat using JSP.

    I'm guessing you're trying to communicate directly with the MySQL database (i.e. run SQL commands on the database directly) but I don't think you can do this (although never tried or looked into it), I have always been under the impression that you need some code on the server to sit inbetween.

提交回复
热议问题