Android Question JdbcSQL - Directly connect to remote databases

Richard Phipps

Member
Licensed User
Hi

I have read the tutorial and downloaded the example code Mysql and I can read the database held at

B4X:
job.PostString("https://www.b4x.com/android/countries.php", Query)

What I do not understand is this PHP script code and "putting it on the web server". I use '1and1' and 'fasthost' to simply host a simple MySQL database. I have username and password and can read the data from a desktop Ms Visual studio app created in visual basic or my log in into the website and looking at the data behind using PHP admin.

So, my question is how do put the PHP script on their web server?
Have i understood i need to do this?
How is it possible or what questions do I need to ask fasthost?

please help

Thanks

Richard
 

DonManfred

Expert
Licensed User
Longtime User
JdbcSQL and PHP are related to exact 0%
You EITHER use jdbcsql OR php.
With jdbcsql you need to use your database credentials in B4A and you also query/update/insert the data using SQL Commands in B4A.

With jdbcsql you NEVER use any PHP-Script.
 
Upvote 0

Richard Phipps

Member
Licensed User
JdbcSQL and PHP are related to exact 0%
You EITHER use jdbcsql OR php.
With jdbcsql you need to use your database credentials in B4A and you also query/update/insert the data using SQL Commands in B4A.

With jdbcsql you NEVER use any PHP-Script.

Oh I see!

Basically I want secure access to read and write data. So which do I need ? Hopefully the one without the PHP?

Please advise

Richard
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I want secure access to read and write data
Then you should NOT use jdbcsql (especially not when you upload the app to the playstore!). Note that the DB-Credentials are inside your app and they can be easily revealed using a bit of reverse engineering.
So which do I need ?
The best solution is, i already wrote this, to use jRDC2 but for this you need a VPS/Server.

If you want to secure your connection and you do not own a VPS then you need to use PHP and add some security to your php-calls.
This requires, for sure, knowledge about PHP.
 
Upvote 0

Richard Phipps

Member
Licensed User
JdbcSQL and PHP are related to exact 0%
You EITHER use jdbcsql OR php.
With jdbcsql you need to use your database credentials in B4A and you also query/update/insert the data using SQL Commands in B4A.

With jdbcsql you NEVER use any PHP-Script.

Sorry I meant to add this...

Erel says

"The recommended method to connect to remote databases is jRDC2: https://www.b4x.com/android/forum/threads/61801/#content

Connecting to the database directly has several disadvantages:

- Insecure - it will be quite simple for a hacker to get the username and password and directly access the database.
- Hard to maintain - changes to the database design will require updating the app.
- Server and client performance issues - The Jdbc drivers are not optimized for mobile usage.
- Reliability issues due to unstable connectivity.

"
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Erel says

"The recommended method to connect to remote databases is jRDC2: https://www.b4x.com/android/forum/threads/61801/#content
Cnnecting to the database directly has several disadvantages:

- Insecure - it will be quite simple for a hacker to get the username and password and directly access the database.
- Hard to maintain - changes to the database design will require updating the app.
- Server and client performance issues - The Jdbc drivers are not optimized for mobile usage.
- Reliability issues due to unstable connectivity.
1. I know!
2. I already told you.
 
Upvote 0
Top