Android Question How jRDC2 can be used to access an online database

saeed10051

Active Member
Licensed User
Longtime User
I have reviewed the jRDC2 tutorial in which Erel has taught about accessing a database situated on a local pc. I have a mysql database on infinity free online database hosting site. How can i access it by implementing client side coding in B4A. Where i need to keep the DbrequestManager.bas file in this case, as my sql queries will inside this file.
 

drgottjr

Expert
Licensed User
Longtime User
from infinityfree.net
You can only interact with your free hosting database through PHP scripts uploaded to your free hosting account, or through our phpMyAdmin installation.
there are tons of examples here on the forum involving connecting to php scripts through b4a and httputils. and there are many simple php examples online for the serverside scripting part.
both aspects very easy. the hardest part will be finding the already-made stuff, and most of it is easily tracked down, here on the forum and out in the wild.
 
Upvote 0

kisoft

Well-Known Member
Licensed User
Longtime User
VPS and MSQL server. I don't know if any website administrator will agree on jrdc2, for them it's a great unknown, they prefer php based solutions.
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
I think it depends on the VPS provider.
I have 4 VPS and 2 Servers with housing

with full access to PHP, LINUX, WINDOOWS SERVER and MYSQL, JAVA etc.
 
Upvote 0

Bladimir Silva Toro

Active Member
Licensed User
Longtime User
La primera relación sería usar jRDC2 pero necesita un alojamiento VPS que siempre se paga


Otra solución sería hacer un servicio web en PHP en su alojamiento gratuito
 
Upvote 0

saeed10051

Active Member
Licensed User
Longtime User
from infinityfree.net

there are tons of examples here on the forum involving connecting to php scripts through b4a and httputils. and there are many simple php examples online for the serverside scripting part.
both aspects very easy. the hardest part will be finding the already-made stuff, and most of it is easily tracked down, here on the forum and out in the wild.
I am currently reviewing following thread
here there is a php script, can you tell me where to place this script to access my database. i just want to query the database to view the records, i dont want to insert or delete records from client side.
 
Upvote 0

saeed10051

Active Member
Licensed User
Longtime User
I think it depends on the VPS provider.
I have 4 VPS and 2 Servers with housing

with full access to PHP, LINUX, WINDOOWS SERVER and MYSQL, JAVA etc.
Boss which hosting service are you using, are they allowing to run php scripts so that it can be queried through android
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
See this is a query through APIS.

https://ridetech.cl/track/api/v1/getZones/C387B1AF2B3039D

1585564857801.png


And it is easier to develop and is what many experts advise

I'm going to do a tutorial

To be used by B4J, B4i and B4A.

It is independent of the MYSQL, MSSQL, ORACLE database type.

regards
 
Upvote 0

kisoft

Well-Known Member
Licensed User
Longtime User
I recommend my own VPS and jRDC2 server. This solution is much more efficient than any PHP scripts. Your customers will be happy.
But it's also nice that colleagues suggest and show other solutions, you'll have a choice.
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
I use apis because the calculations and accesses are performed on several tables from different databases.

I did something with JRDC2 but when we wanted to process the obtained information we had problems.

and we DO NOT want the client application to carry out the process, this process is carried out by the APIS server.

The use of JRDC will depend on the needs of each application that is developed.

It is my humble comment

or instead of selecting, inserting, updating ...

Use trigger, stored procedure for processes,

1585567756462.png
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
I am currently reviewing following thread
here there is a php script, can you tell me where to place this script to access my database. i just want to query the database to view the records, i dont want to insert or delete records from client side.

#1 - forget what you are being told about jrdc2 and other frameworks allowing direct access to your infinity free service. infinity free does not allow it. the only thing infinity allows is php. period. so, either you change your host or you use php. period. the discusssion regarding jrdc2 in the context of infinity is irrelevant. ignore it.

#2 - as to where the php script goes, it depends on your service. in theory, php scripts can run from anywhere. you upload the script to your host. the host must have some instructions on your "dashboard" or "panel" or "file manager". (i had never heard of infinity, but when i saw it was free and that they apparently offer the world for free, i signed up! it never hurts to have something in reserve.) the script you refer to looks pretty typical, and it could run right out of the box. you just fill in the necessary identification. there are some more elementary examples out there.

#3 - after the script is in place, you just need to do an okhttp poststring to the php script on the server. the script talks to the database and sends the records back to you as a json string. you parse the string and display the records. the "poststring" part is the select constraint query (name='smith' or product='beer'). the php script formulates the query. you supply the constraint. the script does 1 thing and expects you to supply the correct constraint(s). if you want to do something different, you need a different script and a different poststring. and you need to know what the return data is supposed to look like. but you already know all this because you have been dealing with sql and your databased already. you'll be making the same sql query and getting the same data back. we're just doing it in a way that infinity will allow you to do it. if you've never used okhttp before, you should start there first and practice downloading a page from your service (just some small html page), so you see how that works. here is the standard starter:
https://www.b4x.com/android/forum/threads/b4x-okhttputils2-with-wait-for.79345/#content
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
if i tell you, will you hurt me?😭
 
Upvote 0

saeed10051

Active Member
Licensed User
Longtime User
#1 - forget what you are being told about jrdc2 and other frameworks allowing direct access to your infinity free service. infinity free does not allow it. the only thing infinity allows is php. period. so, either you change your host or you use php. period. the discusssion regarding jrdc2 in the context of infinity is irrelevant. ignore it.

#2 - as to where the php script goes, it depends on your service. in theory, php scripts can run from anywhere. you upload the script to your host. the host must have some instructions on your "dashboard" or "panel" or "file manager". (i had never heard of infinity, but when i saw it was free and that they apparently offer the world for free, i signed up! it never hurts to have something in reserve.) the script you refer to looks pretty typical, and it could run right out of the box. you just fill in the necessary identification. there are some more elementary examples out there.

#3 - after the script is in place, you just need to do an okhttp poststring to the php script on the server. the script talks to the database and sends the records back to you as a json string. you parse the string and display the records. the "poststring" part is the select constraint query (name='smith' or product='beer'). the php script formulates the query. you supply the constraint. the script does 1 thing and expects you to supply the correct constraint(s). if you want to do something different, you need a different script and a different poststring. and you need to know what the return data is supposed to look like. but you already know all this because you have been dealing with sql and your databased already. you'll be making the same sql query and getting the same data back. we're just doing it in a way that infinity will allow you to do it. if you've never used okhttp before, you should start there first and practice downloading a page from your service (just some small html page), so you see how that works. here is the standard starter:
https://www.b4x.com/android/forum/threads/b4x-okhttputils2-with-wait-for.79345/#content
Thanks Boss, i have checked okhttp and its pretty simple to use. I am reading the documentation in infinity to find out where to place the php script, so far no luck on that.
 
Upvote 0
Top