Android Question Connect to remote MySQL Server

This may be a dumb question. But I need your help. I'm new to programming and I'm developing an android app to get data from remote MySQL Server. I know there are several post regarding several methods to connect MySQL databases. Previously I used mysql library to direct connect MySQL Databases for several project but as I know, It is less secure.

For example,

B4X:
Dim mh1 As MysqlHandler
Dim rs1 As ResultSet
mh1.Initialize("remort server ip","db name","username","password")
rs1=mh1.Query("SELECT * FROM db ")

In several posts, most of them recommended Erels, https://www.b4x.com/android/forum/t...-rdc-remote-database-connector.61801/#content method of connecting databases.

As I mentioned above, I'm new to programming. I'm beginner for this. I'm having Wordpress host which support remote mysql connection. In Erels tutorial he used Local host with XAMP and run jRDC2 in local pc. I'm confusing because I want to connect my wordpress host with my mobile app. By using mysql library I can do it. But I want a better, fast and secure way to do it.

Please be kind enough to show me the correct way to do it.

PS ; https://www.b4x.com/android/forum/t...ly-connect-to-remote-databases.84016/#content method works fine :)

Thank you.
 
Last edited:

Bladimir Silva Toro

Active Member
Licensed User
Longtime User
Hi @Kasun Kanchana

There are 3 ways to connect to a database from B4A:

1. jRDC: it is a middleware that runs in JAVA, for this you need your own web server or a VPS web service. Look here: https://www.webhostnepal.com/cloud-vps
Example: https://www.b4x.com/android/forum/t...ation-of-rdc-remote-database-connector.61801/

2. WebService: You can create your own web service either in PHP, ASP, JSP, you must share the information with a JSON. You only need a Web Hosting. Look here: https://www.webhostnepal.com/hosting
Example: https://www.b4x.com/android/forum/threads/b4x-okhttputils2-with-wait-for.79345/

3. Direct JdbcSQL connection: For this you only need a web server and that your database supports remote connections. You only need a Web Hosting. Look here: https://www.webhostnepal.com/hosting
Example : https://www.b4x.com/android/forum/threads/jdbcsql-directly-connect-to-remote-databases.84016/

Choose the way you want, all the information can be found in the forums.
 
Upvote 0
Top