简体   繁体   中英

How to connect AWS MYSQL instance to android application (Java)

From researching this problem I understand a direct connection to the MYSQL database using JDBC is not possible/viable. All the solutions point to using an (REST) API to interact with the database. Although, most online solutions use PHP which I would prefer not to use.

My question is: are there any other options for establishing a connection to the database, eg does AWS have a solution.

Many thanks for your help.

Use a webservice. Do not directly connect to a db in a mobile application. Why? Because to connect directly you need a password. That password would be in your app on their device. Meaning anyone with a non-trivial amount of knowledge can get your password, bypass all your security, and wreak havoc on your data. There is no safe way to go directly to the DB without a layer in between. Using a webservice the password never goes beyond your server, so it can't be taken from your app.

Now that layer can be written in anything you want. PHP, Python, Perl, Ruby, Java, I've even done them in C back in the day. But you need a webservice to do it safely.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM