I\'ve got a MySQL server running on a local Linux machine. I haven\'t been faced to any problems communicating with it and executing SQL statements through a simple Java pro
Generally, the recommended approach is to post to a web service, and allow the web service to perform the required actions on the database. However, there is an open source library on GitHub which allows you to connect directly to the database server without the need of a web service.
The library is fairly new and has been tested against MySQL 5.1 -> 5.7 which should also be compatible with the equivalent MySQL version to MariaDB.
Disclaimer: I wrote it.