Android Question JRDC2 multi-database

Bernaert Dominique

Licensed User

we have a Saas ERP-platform and would like to create a mobile application for this using B4A and B4I.
Now the structure of the platform is the following:

We have a central database where all account databases are defined with the location and the name of the database.
When a user connects, first a connection is made to the central database to check the account and to fetch the name and location of the database.
Starting from then, all requests of the user are made to the accoounts database.
We took this approach to have a separate database for each account for scalability.

Seen the structure, is it possible to have 1 JRDC2 server running that will connect to the correct database by passing a parameter in the requests?

Setting up a JRDC2 server for each database would give a lot of work and take away the dynamic.
Now everything is dynamic, somebody creates an account, a template database is restored and the account is registered in the central database.



Well-Known Member
Licensed User
Longtime User

I see, but this sample is limited to 2 databases.
So each time a database is added, the code needs to be changed?

Well, reading your post this is what I understand:
1) First, users connect to a central Database (always the same) to check account and fecth the name and 'location?' of the database --> 1 database
2) In step 1, you're getting the database name, and this is what you pass as a parameter to the jRDC handler to know which accounts database is the correct --> multiple database but you're passing de database name obtained in step 1 as a parameter to the JRDC handler in Step2. So, as you are passing the database name as a parameter the code doesn't have to be changed
Upvote 0