~~Title: DataSourceHandler and DBCredentials~~
Simple integration of multiple databases is an easy task with JVx. Configuration is usually completed via the application's config.xml file. This allows for easy access in the life cycle objects:
com.sibvisions.rad.server.security.DBSecurityManager
jdbc:oracle:thin:@localhost:1521:mydb
user
password
jdbc:derby://localhost:1527/masterdb
master
master
To access:
IConfiguration config = SessionContext.getCurrentSessionConfig();
dba = DBAccess.getDBAccess(DBSecurityManager.getCredentials(config));
dba.open();
using the data source of the SecurityManager. To access data sources independently from the security Manager we use DataSourceHandler:
IConfiguration config = SessionContext.getCurrentSessionConfig();
DBCredentials cred = DataSourceHandler.createDBCredentials(config, "masterdb");
dba = DBAccess.getDBAccess(cred);
dba.open();
\\
**Note**
The [[jvx:server:security:dbsecman|DB Security Manager]] allows the use of a standard data source without any additional configuration effort:
com.sibvisions.rad.server.security.DBSecurityManager
jdbc:oracle:thin:@localhost:1521:mydb
user
password
The security manager uses the data source named "default" as the standard connection.