B4J Question Error connect B4J via 2nd jRDC on Linux



I have 1 jRDC.jar running on linux as server. Work ok with B4A test app.
I did not understand the description for using 1 server for 2 database. I looked for similar other questions in forum.
Then I use same jRDC for 2nd DB but changed this line in Main sub appstart to:
srvr.AddHandler("/das", "RDCHandler", False)
Is it allowed to change /rdc for /das ?

I changed config file port nr 17178 to 17179, db name is different, password is same.
#Java server port

filename is now jRDCdas.jar uploaded to Linux server, same place as other jRDC.jar

Both servers are running, I checked with: ps -ef | grep java

This 2nd DB I want to use with B4J testapp. I changed the String
Sub Process_Globals
    Private fx As JFX
    Private MainForm As Form
    Type DBResult (Tag As Object, Columns As Map, Rows As List)
    Type DBCommand (Name As String, Parameters() As Object)
    Dim const rdcLink As String = ""
End Sub

Rest of code is same as in B4A. But in B4J I choose jOkHttpUtils2 and jRandomAccessFile library.

I get error:
ResponseError. Reason: java.net.ConnectException: Failed to connect to /, Response: 
ERROR: java.net.ConnectException: Failed to connect to /

Any idea what I have missed?

Thank you.


B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

José J. Aguilar

Licensed User
I did not understand the description for using 1 server for 2 database.

It's quite easy. You just have to write your db name before the table:
Select * from dbname.MyTable

instead of

Select * from MyTable

Remember the user you're using in the config.properties to access your databases, has to have permissions to access both databases.

More info in this post
Upvote 0


Thank you both. I was out for work a few days.
I will try it today and come back with my results.
What Jose mentiones, I did also try but I did not get the results from the correct db
I'm sending an row id from which I need the information so I use the Select * from table where id = ?
Upvote 0


@ Jose
Yes indeed I did as you write "Select * from DB_NAME.table where id = ?" when I was using 1 jRDC server. It did not work.

Now I have 2 running each with own configuration file and sql commands.
1st is still running ok, 2nd runs ok according the JAVA process. I have opened the test url as Erel said. give good result give not good result. Erel was right, for this I forgot to open the port. After this the test URL work ok. Thanks for the heads-up.

Sorry for waisting your time.
Now I can work further and try to solve another issue.

Thank you for your help.
Upvote 0