You can use the MySQL JDBC drivers. Specify access details into the app and use normal code to query the database.
The other option is to use web services to access, autheticate and excute control. You can write the webservice in PHP where it takes query from POST data and submits it to the database with the result written in JSON. The scirpt that you write will send the query where upon reply the JSON will be parsed and displayed.