Ramamoorthy
Ramamoorthy

Reputation: 287

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 the details in android using some sort of methods. I am new to android development I think there should be some simple way to do this. if so please let me know.

Upvotes: 0

Views: 1520

Answers (2)

kaw
kaw

Reputation: 75

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".

Upvotes: 0

ruhalde
ruhalde

Reputation: 3551

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

Upvotes: 1

Related Questions