B4J Library [B4X] jRDC2 - B4J implementation of RDC (Remote Database Connector)

Not open for further replies.


Well-Known Member
Licensed User
Hi to all
I'm running same test with JRDC2 and i have same problems with mysql driver, with sqlite all ok.
How I create a empty mysql db?
And where i put the empty db created?


Active Member
Licensed User
Hello to all
I'm successfully using RCD V0.9
connected to the server PC and smartphone wifi
I am not clear if I switch to jRDC2?

'Non-UI application (console / server application)
#Region  Project Attributes
    #MergeLibraries: True
#End Region

'change based on the jdbc jar file
'#AdditionalJar: mysql-connector-java-5.1.27-bin
#AdditionalJar: sqlite-jdbc-3.7.2.jar
'#AdditionalJar: postgresql-9.4.1207

Sub Process_Globals
    Public srvr As Server
    Public rdcConnector1 As RDCConnector
    Public const VERSION As Float = 2.1
    Type DBCommand (Name As String, Parameters() As Object)
    Type DBResult (Tag As Object, Columns As Map, Rows As List)
End Sub

Sub AppStart (Args() As String)
    srvr.Port = rdcConnector1.serverPort
    srvr.AddHandler("/test", "TestHandler", False)
    srvr.AddHandler("/rdc", "RDCHandler", False)
    Log($"jRDC is running (version = $1.2{VERSION})"$)
End Sub

Waiting for debugger to connect...
Program started.
2016-03-18 14:05:33.528:INFO::main: Logging initialized @2479ms
mar 18, 2016 2:05:33 PM com.mchange.v2.log.MLog <clinit>
INFORMAZIONI: MLog clients using java 1.4+ standard logging.
mar 18, 2016 2:05:33 PM com.mchange.v2.c3p0.C3P0Registry banner
INFORMAZIONI: Initializing c3p0- [built 20-March-2013 11:16:28 +0000; debug? true; trace: 10]
2016-03-18 14:05:33.706:INFO:oejs.Server:main: jetty-9.3.z-SNAPSHOT
2016-03-18 14:05:33.729:INFO:oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@27efef64{/,file:///G:/Developer/Android/Samples/RDC%20V2/jRDC2/jRDC/Objects/www,AVAILABLE}
2016-03-18 14:05:33.731:INFO:oejs.AbstractNCSARequestLog:main: Opened G:\Developer\Android\Samples\RDC V2\jRDC2\jRDC\Objects\logs\b4j-2016_03_18.request.log
2016-03-18 14:05:33.765:INFO:oejs.ServerConnector:main: Started ServerConnector@56235b8e{HTTP/1.1,[http/1.1]}{}
2016-03-18 14:05:33.766:INFO:oejs.Server:main: Started @2717ms
Emulated network latency: 100ms
jRDC is running (version = 2.1)

Haris Hafeez

Active Member
Licensed User
jRDC v2.1 is released (first post). It fixes an issue with numeric types breaking the response.
I am still getting errors when the sql includes numeric columns. I am however using mysql so the fix might have fixed it for other DBs (this link explains similar issue but with oracle and postgresql).

For now the workaround is to use the mysql cast function to cast any numeric values to char. Haven't tested other data types yet.


Active Member
Licensed User
JRDC2 Async works with a class?
I have problems in this case:(
No Async is ok:)
Thank you


Well-Known Member
Licensed User
Just to clarify, RDC is made of a server and clients components. DBRequestManager module is the client implementation and it is supported by B4A, B4i and B4J.
The version download from this post attachment contains type bitmap (sub Public Sub ImageToBytes(Image As Bitmap) As Byte())
which are not supported by B4J = images instead.

Question: Is there a B4J version available using Image?


Staff member
Licensed User
Replace the subs with these subs:
'Converts an image to a bytes array (for BLOB fields).
Public Sub ImageToBytes(Image As Image) As Byte()
   Dim out As OutputStream
   Return out.ToBytesArray
End Sub
'Converts a bytes array to an image (for BLOB fields).
Public Sub BytesToImage(bytes() As Byte) As Image
   Dim In As InputStream
   In.InitializeFromBytesArray(bytes, 0, bytes.Length)
   Dim bmp As Image
   Return bmp
End Sub


New Member
Licensed User
I'm new here, and trying to find B4XSerializator lib.
Any suggestion is appreciated.



Active Member
Licensed User
I still didnt get it. :( Dont know where I am going wrong. I copied the sql connector jar in www folder of my server. I set the url to shared ip address of my server still not able to connect to Mysql db on server by running jar in local computer. tried both the ports in the URL but it didnt work. any suggestion is appreciated.
I have the same problem, I don't get it either. This tutorial is not detailed enough, mainly in the server installation side. I didn't get the answer in the threat suggested for Erel.

I'm using RDC without problem, should I switch to jRDC2 ?


Active Member
Licensed User
I have the same problem, I don't get it either. This tutorial is not detailed enough, mainly in the server installation side. I didn't get the answer in the threat suggested for Erel.

I'm using RDC without problem, should I switch to jRDC2 ?
I am running multiple B4J webservers now. If you want I can create a detailed tutorial. are you running B4J server in a VPS?

Not open for further replies.