The database configuration file (by default, named MFDBFH.cfg) is used by the Micro Focus Database File Handler (MFDBFH).
It contains a list of database server instances, the databases available within them, and connection details. The types of database server currently supported are Microsoft SQL Server and Azure database, PostgreSQL, Db2, and Oracle. 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.
To create or edit the configuration file, Micro Focus recommends that you use the dbfhconfig command line utility, and also that you enable the configuration file to use a secrets vault, so that the database connection credentials can be stored securely, behind an encryption process; see Configure a Secrets Vault for the Micro Focus Database File Handler.
MFDBFH or Enterprise Server establishes connection with a database using either a corresponding ODBC data source configured on your machine, or through a direct connection string (see Database Connection Strings).
See the Update the Configuration File for <db-type> topic in the relevant Configuring Datastores sections for full details.
The following example shows server entries for each of the supported database providers: one of type sqlserver (called svr-mysqldb), one of type azuresqldb (whose location is determined by an environment variable), one of type postgresql (which stores its datastores in a single physical database - MFDevDB), one of type Db2 (which again, uses a variable), and the final server entry is type oracle. The first three use the ODBC data source names configured, but the last two (Db2 and Oracle) specify direct connection details via the connect option.
<datastores usevault="true"> <server name="svr-mysqldb" type="sqlserver" access="odbc"> <dsn name="SS.MYMASTER" type="database" dbname="master"/> <dsn name="SS.VSAM" type="datastore" dsname="VSAM" dbname="VSAM"/> </server> <server name="${VAR2AZDB}" type="azuresqldb" access="odbc"> <dsn name="AZ.MYMASTER" type="database" dbname="master" userid="azusr" password="$$vault$$"/> <dsn name="AZ.VSAM" type="datastore" dsname="VSAM" dbname="VSAM" userid="azusr" password="$$vault$$"/> <dsn name="AZ.SEQ" type="datastore" dsname="SEQ" dbname="SEQ" optio="+ooseq" userid="azusr" password="$$vault$$"/> </server> <server name="MFDevDB" type="postgresql" access="odbc"> <dsn name="PG.POSTGRES" type="database" dbname="postgres"/> <dsn name="PG.VSAM1" type="datastore" dsname="PGVSAM1" dbname="MFDevDB" userid="clerk" password="$$vault$$"/> <dsn name="PG.VSAM2" type="datastore" dsname="PGVSAM2" dbname="MFDevDB" userid="clerk" password="$$vault$$"/> </server> <server name="${TESTMFDBFH_DBINST_DB2}" type="db2" access="odbc"> <dsn name="DB2.COPYTEST" type="datastore" dsname="COPYTEST" optio="all -ooseq" connect="$$vault$$"/> <dsn name="DB2.VSAM" type="datastore" dsname="VSAM" optio="all -ooseq" connect="$$vault$$"/> </server> <server name="MY_ORA_DB" type="oracle" access="oci"> <dsn name="ORA.VSAM" type="datastore" dsname="VSAM" optio="none" dbname="DBFHTEST" userid="mfdbfh" password="temppwd"/> <dsn name="ORA.JES" type="datastore" dsname="JES" optio="none" dbname="DBFHTEST" userid="mfdbfh" password="temppwd"/> </server> </datastores>
The sqlserver, azuresqldb, and postgresql server instances include 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 dbfh* command line utilities. 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; alternatively, these utilities can specify a configuration file (-configfile option), which will override the variable setting.