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

Status
Not open for further replies.

Anser

Well-Known Member
Licensed User
Longtime User
Run it in debug mode to see which line raises the error.
Line 83 in DbRequestManager.bas

Line 83 is
res.Tag = m.Get("tag")
in Sub ser_BytesToObject

I tried updating the driver to the latest stable mysql-connector-java-5.1.38 unfortunately the result is same. Earlier it was 5.1.37

In my Activity, there are two QUERIES, surprisingly the first query is working and only the second query is failing.

I wonder why it is failing at the TAG
 

shashkiranr

Active Member
Licensed User
Longtime User
Hi All,

I am getting the below message in the log when I connect my phone to retrieve information from mysql db. I am getting the data which i want but need to know if this error is not a problem. I am running my server in release mode.

B4X:
Class not found: anywheresoftware.b4a.samples.push.main$_dbcommand, trying: b4j.example.main$_dbcommand

Best,
SK
 

billzhan

Active Member
Licensed User
Longtime User
I can use this in B4A?

No. It (The jRDC server) is based on full version of jetty(jServer lib) and JDBC(jSQL lib) , which are not available on android.

It is designed as middle ware between clients(Android, iOS,B4J apps) and databases. This middle ware can make your databases safer and easier to access.
 
Last edited:

shashkiranr

Active Member
Licensed User
Longtime User
Hi All,

I am trying to connect the jrdc to the server mysql db. The URL I am using to access is
B4X:
jdbc:mysql://http://serverip/dbname
Also I have given access in th cpanel of the sever to allow my ip address to access the db But It fails to create connection. Everytime I get this error.
B4X:
java.sql.SQLException: No suitable driver
    at java.sql.DriverManager.getDriver(DriverManager.java:315)
    at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:240)
    at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:146)
    at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:195)
    at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:184)
    at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:200)
    at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1086)
    at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1073)
    at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:44)
    at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1810)

Is it possible to access server db by running the jar in local computer. Has anyone tried it? Kindly let me know.

Best,
Shashi Kiran
 

Anser

Well-Known Member
Licensed User
Longtime User

This is how the config.properties entry looks like when I connect to a local MySQL DB
B4X:
JdbcUrl=jdbc:mysql://192.168.0.170/YourDbName?characterEncoding=utf8

If you want to connect to a remote MySQL DB then substitute the Local IP with your Public server's IP.

Is it possible to access server db by running the jar in local computer. Has anyone tried it? Kindly let me know.

The jar file can be run locally on your PC too.

Regards
Anser
 

shashkiranr

Active Member
Licensed User
Longtime User
I am using
B4X:
#AdditionalJar: mysql-connector-java-5.1.38-bin
. Its working with mysql db in local host, But not with a mysqldb in server.
 

Anser

Well-Known Member
Licensed User
Longtime User
I am using
B4X:
#AdditionalJar: mysql-connector-java-5.1.38-bin
. Its working with mysql db in local host, But not with a mysqldb in server.
Hope you are using a VPS server. If it is working fine from your local host, then please check the firewall port on your VPS Server
 

shashkiranr

Active Member
Licensed User
Longtime 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.
 

Anser

Well-Known Member
Licensed User
Longtime User
I copied the sql connector jar in www folder of my server.
Did you mean jRDC.jar ? You don't have to copy any other jar or connectors to the server. You just need the jRDC.jar file. The connector jar etc are included in the jRDC.jar itself

Actually I am confused and don't know what you are trying to achieve.

You are successful to use jRDC on local PC to connect to a MySQL server on your local PC. Right ?

I assume that you are trying to run the jRDC on your local PC to connect to the MySQL server residing on a Remote Server. You fail at this point. Right ?
OR
Are you trying to run the jRDC.jar on the remote server itself ?
 

shashkiranr

Active Member
Licensed User
Longtime User
I assume that you are trying to run the jRDC on your local PC to connect to the MySQL server residing on a Remote Server. You fail at this point. Right ?

Yes, It fail at this point.

If i use the same jRDC and Mysql in local computer it works But jRDC in local and Mysql in server it does not.
 

Anser

Well-Known Member
Licensed User
Longtime User
If i use the same jRDC and Mysql in local computer it works But jRDC in local and Mysql in server it does not.
Try temporarily disabling the firewall on your PC and then test

Are you using a VPS Server ?
Is MySQL running on the default port (3306) on your Remote Server ?
Are you connecting as root ?

Regards
Anser
 

shashkiranr

Active Member
Licensed User
Longtime User
Yes it is running on port 3306 and it is a VPS server. I have already given access to the port in my firewall settings in my local machine. I have created a user for mysql db and I am using it.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…