Skip to content Skip to sidebar Skip to footer

How To Connect Android And Mysql Server?

I want to get the details from online mysql databse in android. I have wrote a php script to get the details form mysql database and convert the result as json string and extract t

Solution 1:

You can use plain JDBC API with JDBC connector, only one I know is working is mysql-connector-java-3.0.17-ga-bin.jar. Bear in mind that exposing a database directly in the cloud is a serious security risk, as passwords and connection details travel without encryption. Best solution would be to implement a REST or SOAP web service with proper scheme.

Check this answer with an example of JDBC API connection

Solution 2:

An other approach is to use a Virtual JDBC Driver that uses a three-tier architecture: your JDBC code is sent through HTTP to a remote Servlet that filters the JDBC code (configuration & security) before passing it to the MySql JDBC Driver. The result is sent you back through HTTP. There are some free software that use this technique. This is secure because the database is never exposed directly and you may use SSL. Just Google "Android JDBC Driver over HTTP".

Post a Comment for "How To Connect Android And Mysql Server?"