B4J Question How to connect to multiple database ?

amarnath

Member
Licensed User
Longtime User
From the B4A client I call:

Wait For (jRDC.GetRecord("get_next_city_slid", Null)) Complete (Ans As Map)
The request is sent to:

Server log shows:
DB=streetlight
The command exists in config_streetlight.properties:

sql.get_next_city_slid

grep -n "get_next_city_slid" config_streetlight.properties

and the command is present.

The server code currently loads commands with:

Private Sub LoadConfigMap As Map
Return File.ReadMap(File.DirAssets, "config.properties")
End Sub



and:

Private Sub LoadSQLCommands(config As Map)
Dim newCommands As Map
newCommands.Initialize
For Each k As String In config.Keys
If k.StartsWith("sql.") Then
newCommands.Put(k, config.Get(k))
End If
Next
commands = newCommands
End Sub


Questions:

  1. In a multi-database jRDC implementation, should SQL commands be loaded from:
    • config.properties only?
    • or from config_streetlight.properties according to the selected database?
  2. Why does the server recognize:
    • DB=streetlight
      but still return:
    • Command not found: get_next_city_slid
  3. Is there a recommended way to support multiple databases with separate SQL command sets in jRDC2?

4.
  1. Would you recommend:
    • one jRDC instance per database (different ports),
      or
    • a single multi-database jRDC instance?

File 'config_bolmitra.properties' is not used. (warning #15)
File 'config_chairman.properties' is not used. (warning #15)
File 'config_streetlight.properties' is not used. (warning #15)


Thank you.
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…