Android Question B4A ConnectionPool

walterf25

Expert
Licensed User
Longtime User
Hi All, i'm working on a small app for my sister's pet grooming business, and i'm using the jDBCSql library, i am able to connect to my remote SQL database, but from time to time the connection gets broken and i get the following error.
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

I know this has to do because i am not using a ConnectionPool, the problem is that i can't find any reference anywhere in the B4A forum that points me to how to do this, i can find references for B4J but i'm not sure if the same library will work with B4A, or am i using the wrong library to do this?

When I start the app i am able to retrieve records and even insert new records in the Remote Database but if I let the app go to sleep for a minute or so and then if I try to insert a new record or even search a record i get the error above.

Any ideas?

Thanks,
Walter
 
The correct solution is to use jRDC2. This will solve all these problems.

You can try jConnectionPool: https://www.b4x.com/android/forum/t...onpool-extracted-from-jserver.107776/#content
I'm not sure whether it is compatible with Android.
Unfortunately jRDC2 is not an option for me as i'm not using a VPS, B4J can not be run from the host where the database is being hosted.

I gave the jConnectionPool a try but i get the following error:

error: cannot access PropertyVetoException
parent._pool.Initialize(parent._driver,parent._jdbcurl,parent._username,parent._password);
^
class file for java.beans.PropertyVetoException not found

Which jar file am I missing?

Walter
 
Upvote 0
Back
Top