The database configuration file (MFDBFH.cfg) is used by the native database file handler (MFDBFH), and for enterprise server region management.
It contains a list of database server instances and the databases available within them. The types of database server currently supported are Microsoft SQL Server and Azure database, PostgreSQL, and Db2. You may have one or more instances of each type configured within the same configuration file.
Within each server instance element, you configure a <dsn> element for each database available. Databases are either of type database, datastore, region.cas, or crossregion.cas; see Types of Database for more information. In order for MFDBFH or Enterprise Server to interact with a database, each database element must have a corresponding ODBC data source configured on your machine, or specify the direct connection syntax applicable to the database (see Database Connection Strings).
Additional configuration, such as database instance user credentials, and feature enablement for region/cross-region databases is also available within the configuration file; see the Update the Configuration File for <db-type> topic in the relevant section for full details.
The following example shows three server instances: one of type sqlserver (called svr-mysqldb), one of type postgresql (stored locally on port 5432), and one of type Db2 (whose location is determined by the variable TESTMFDBFH_DBINST_DB2). The first two use the ODBC data source names configured, but the last one (Db2) specifies direct connection details via the connect option.
<datastores> <server name="svr-mysqldb" type="sqlserver" access="odbc"> <dsn name="SS.MYMASTER" type="database" dbname="master"/> <dsn name="SS.VSAM" type="datastore" dsname="VSAM"/> <dsn name="SS.CAS.ESDEMO" type="region.cas" region="ESDEMO" feature="all"/> <dsn name="SS.CROSSREGION" type="crossregion.cas"/> </server> <server name="${VAR2AZDB}" type="azuresqldb" access="odbc"> <dsn name="AZ.MYMASTER" type="database" dbname="master" userid="azusr" password="azpwd123"/> <dsn name="AZ.VSAM" type="datastore" dsname="VSAM" userid="azusr" password="azpwd123"/> <dsn name="AZ.SEQ" type="datastore" dsname="SEQ" optio="+ooseq" userid="azusr" password="azpwd123"/> <dsn name="AZ.CAS.ESDEMO" type="region.cas" region="ESDEMO" feature="all" userid="azusr" password="azpwd123"/> <dsn name="AZ.CROSSREGION" type="crossregion.cas" userid="azusr" password="azpwd123"/> </server> <server name="localhost:5432" type="postgresql" access="odbc"> <dsn name="PG.POSTGRES" type="database" dbname="postgres"/> <dsn name="PG.VSAM" type="datastore" dsname="PGVSAM" userid="clerk" password="clerk321"/> <dsn name="PG.CAS.PGDEMO" type="region.cas" region="PGDEMO" feature="all" userid="clerk" password="clerk321"/> <dsn name="PG.CROSSREGION" type="crossregion.cas" userid="clerk" password="clerk321"/> </server> <server name="${TESTMFDBFH_DBINST_DB2}" type="db2" access="odbc"> <dsn name="DB2.COPYTEST" type="datastore" dsname="COPYTEST" optio="all -ooseq" connect="db=COPYTEST;uid=db2admin;pwd=db2adminpw"/> <dsn name="DB2.VSAM" type="datastore" dsname="VSAM" optio="all -ooseq" connect="db=VSAM;uid=uid=db2admin;pwd=db2adminpw"/> <dsn name="DB2.CAS.CROSSREGION" type="crossregion.cas" optio="none" connect="db=$XREGN$;uid=db2admin;pwd=db2adminpw"/> <dsn name="DB2.CAS.TESTDB" type="region.cas" region="TESTDB" connect="db=TESTDB;uid=db2admin;pwd=db2adminpw"/> </server> </datastores>
Each instance has a number of datastore, region, and cross-region databases. The sqlserver, azuresqldb, and postgresql server instances also have an entry for type=database; this is mandatory in order for MFDBFH or Enterprise Server to be able to interact with those instances.
Use the MFDBFH_CONFIG environment variable to locate this configuration file, both when running applications through Enterprise Server and when using the dbfhdeploy command line utility. If the variable is not set, the configuration file is assumed to be located in the current directory, or in the enterprise server region's system directory.