incendio Well-Known Member Licensed User Longtime User Nov 2, 2015 #1 Hi guys, I need a help, how to configure jRDC to connect to multiple database. Thanks in advance.
Erel B4X founder Staff member Licensed User Longtime User Nov 2, 2015 #2 You will need to understand how the code is built and change it a bit. It is quite simple. Replace rdcConnector1 with rdcConnectorA and rdcConnectorB. Each one of them will point to a different database (you will need to take care of loading the correct configuration file). Now in RDCHandler add this to Class_Globals Code: Copy private connector as RDCConnector private connectors As Map = CreateMap("a": Main.rdcConnectorA, "b": Main.rdcConnectorB) You will need to add an additional parameter to the query (together with the method parameter). Lets call it database. Code: Copy Dim method As String = req.GetParameter("method") connector = connectors.Get(req.GetParameter("database")) The last step is to change the references to Main.rdcConnector1 with connector. Upvote 0
You will need to understand how the code is built and change it a bit. It is quite simple. Replace rdcConnector1 with rdcConnectorA and rdcConnectorB. Each one of them will point to a different database (you will need to take care of loading the correct configuration file). Now in RDCHandler add this to Class_Globals Code: Copy private connector as RDCConnector private connectors As Map = CreateMap("a": Main.rdcConnectorA, "b": Main.rdcConnectorB) You will need to add an additional parameter to the query (together with the method parameter). Lets call it database. Code: Copy Dim method As String = req.GetParameter("method") connector = connectors.Get(req.GetParameter("database")) The last step is to change the references to Main.rdcConnector1 with connector.
Rudi Purwanto Member Aug 10, 2016 #3 i follow this instruction but, how about configuration file ? should i create 2 config file ? if yes, how i call these config file ? also about main, should i create srvr1 and srvr2 to define server port ? and about testhandler should i create connector again like in testhandler ? thx alot Last edited: Aug 10, 2016 Upvote 0
i follow this instruction but, how about configuration file ? should i create 2 config file ? if yes, how i call these config file ? also about main, should i create srvr1 and srvr2 to define server port ? and about testhandler should i create connector again like in testhandler ? thx alot
Erel B4X founder Staff member Licensed User Longtime User Aug 10, 2016 #4 Yes, you need to create two configuration files. Modify RDCConnector and add a field that allows you to set the configuration file that will be used. Upvote 0
Yes, you need to create two configuration files. Modify RDCConnector and add a field that allows you to set the configuration file that will be used.