B4J Question jRDC multiple dbases question

Mostez

Well-Known Member
Licensed User
Longtime User
Reference to this thread reply by Erel, I want to know how to modify Sub AppStart in Main, and Sub Handle in TestHandler, to test the connection for each dbase, and set the port number.

TIA
 

Mostez

Well-Known Member
Licensed User
Longtime User
sorry but I'm a bit confused,
I use jRDC with MS SQL server 2012, should I modify Sub LoadConfigMap like this to use single config file for each dbase, server login credentials should be the same in each file or hard coded in jRDC server?
what is the best method to reference dbname in 'sql.' commands?

B4X:
Private Sub LoadConfigMap As Map
    Return File.ReadMap(File.DirAssets, mDBName & "_config.properties") 'include dbname to config file
End Sub

dbase config file for dbase1:
#DATABASE CONFIGURATION for SQL server
DriverClass=net.sourceforge.jtds.jdbc.Driver
JdbcUrl=jdbc:jtds:sqlserver://127.0.0.1/dbase1
User=sa
Password=pw
#Java server port
ServerPort=17178

dbase config file for dbase2:
#DATABASE CONFIGURATION for SQL server
DriverClass=net.sourceforge.jtds.jdbc.Driver
JdbcUrl=jdbc:jtds:sqlserver://127.0.0.1/dbase2
User=sa
Password=pw
#Java server port
ServerPort=17178
 
Upvote 0

josejad

Expert
Licensed User
Longtime User
Note that if all the databases are in the same server, and you have an user that can access all of them, it's so easy as explained here:

 
Upvote 1

aeric

Expert
Licensed User
Longtime User
You may also want to check:
 
Upvote 1
Cookies are required to use this site. You must accept them to continue using the site. Learn more…