Other How to use RDC to connect to mysql database in B4A and B4i

Adilson Jacinto

Active Member
Licensed User
Longtime User
Hi There,

I urgently to help setting up RDC on my dedicated server and also need help in connecting to the datase through RDC from B4A and B4i. I need to be talked through step by step because all the stuff I found on here are not good to me :(

Thanks
 

Adilson Jacinto

Active Member
Licensed User
Longtime User
Here is the tutorial: https://www.b4x.com/android/forum/threads/31540/#content

It is also worth seeing other related discussions:
https://www.b4x.com/search?query=RDC


Erel, I have tried to follow that but with no success, I downloaded the server.zip file then I din't know where to go after that because this server.zip file is it meant to be run in my dedicated server? then you also meantioned I needed a VPS server to run RDC, but I already have a dedicated server which is located in cpnel and is a linux. So don't really know what to do, if you do please help me.

P.S I already thinking of giving up on this B4x because I can't connect to mysql database :(
 
Upvote 0

Adilson Jacinto

Active Member
Licensed User
Longtime User
If you are not familiar with Linux then start with a local installation. Install Wamp on your Windows machine and run RDC on the same computer. Later you can move it to the linux computer.

http://www.wampserver.com/en/

Another option is to use the PHP script instead of RDC.

I'm not familiar with Linux, but I can contact the support for my dedicated server and get them to install for me, but you need to give me the information I need to give to them please?
 
Upvote 0

Adilson Jacinto

Active Member
Licensed User
Longtime User
1. You need to install Java 7 or 8 on the server.
2. Copy RDC files with the libraries, jdbc driver and config file.
3. Run RDC jar file.

You might need top open a port in the firewall.

As I said I recommend you to start with WAMP + RDC installed on the local computer.

Ok, if I start on local machine, how easy is it to move to linux computer?
 
Upvote 0

Adilson Jacinto

Active Member
Licensed User
Longtime User
Not sure which answer you expect. For someone with basic knowledge in Linux it is easy.

Erel I am getting the following error...

C:\Users\ADY\Desktop\RDC Files\RemoteDatabaseConnector>"C:\Program Files (x86)\Java\jdk1.7.0\bin\java" -Xmx256m -cp .;libs\*;jdbc_driver\* anywheresoftware.b4a.remotedatabase.RemoteServer
The system cannot find the path specified.


Sorry now I have fixed it, I forgot to change the path...


C:\Users\ADY\Desktop\RDC Files\RemoteDatabaseConnector>"C:\Program Files\Java\jdk1.8.0_60\bin\java" -Xmx256m -cp .;libs\*;jdbc_driver\* anywheresoftware.b4a.remotedatabase.RemoteServer
B4A Remote Database Connecter (version 0.9)
loading: C:\Users\ADY\Desktop\RDC Files\RemoteDatabaseConnector\config.properties
2015-09-10 11:46:37.234:INFO::jetty-7.4.2.v20110526
2015-09-10 11:46:37.327:INFO::started o.e.j.s.ServletContextHandler{/,null}
Sep 10, 2015 11:46:37 AM com.mchange.v2.log.MLog <clinit>
INFO: MLog clients using java 1.4+ standard logging.
Sep 10, 2015 11:46:39 AM com.mchange.v2.c3p0.C3P0Registry banner
INFO: Initializing c3p0-0.9.2.1 [built 20-March-2013 11:16:28 +0000; debug? true; trace: 10]
2015-09-10 11:46:40.204:INFO::Started [email protected]:17178 STARTING
 
Last edited:
Upvote 0

Adilson Jacinto

Active Member
Licensed User
Longtime User
@Erel I have now set it up and RDC is running on my windows machine so what is next?

RemoteServer is running (Thu Sep 10 12:02:15 BST 2015)
Connection successful.

I tried to run on the app and I am getting the following error:

[errormessage=org.apache.http.conn.HttpHostConnectException: Connection to [url]http://localhost:17178[/url] refused, httputils2service=null, jobname=DBRequest
, password=, req=anywheresoftware.b4a.http.HttpClientWrapper$HttpUriRequestWrapper@40e03600, username=
, tag=null, target=class b4a.example.main, taskid=2
, success=false]

I overcome that issue but now the following error messages shows

Error: org.apache.http.conn.ConnectTimeoutException: Connect to /192.168.0.1:17178 timed out
 
Last edited:
Upvote 0

Adilson Jacinto

Active Member
Licensed User
Longtime User
It means that the firewall is blocking the connection.

Hi @Erel, it was not there firewall but for some reason I had to change the IP address from default gateway to IPv4 and it worked.

I have another question and still the same subject, how can I talk to multiple databases with RDC, I know it has to be done in config.properties but how can I structure it?

Can you give me an example of two different databases, I know it has to ha different ports too, but how to write them in the config.properties?

Thanks
 
Upvote 0
Top