skip to main content
About the Driver : Using the driver : Using the Database Configuration File
  

Try DataDirect Drivers Now

Using the Database Configuration File

You can configure an embedded database and data mapping using a database configuration file in XML format (see Mapping Objects to Tables for an explanation of embedded databases). Some values can be set either in the database configuration file or using the ConfigOptions connection property (see ConfigOptions). Some values can be set using only a database configuration file.
The name of the database configuration file has the format:
databasename.config
where:
databasename
is the name of the database to be configured.
For example, assuming your database is named mydb or you have a database configuration file named mydb.config, when the driver establishes a connection, it performs the following steps:
1. Checks to see if an embedded database named mydb exists (or a database using the default databasename if one is not specified). If mydb exists, the driver connects to the remote data source using the mydb database.
2. If mydb does not exist and the driver is configured to create a database, the driver looks for a database configuration file named mydb.config. If the database configuration file exists, the driver creates the database and mapping using the properties specified in the database configuration file.
3. If mydb.config does not exist, the driver generates a database configuration file with default settings and uses those settings to create the database and its mapping.
Example: Database Configuration File
<?xml version='1.0' encoding='UTF-8'?>
<Database xmlns="http//datadirect.com/cloud/config" version="1">
  <User name="CONNECT2" defaultSchema="RIGHTNOW">
    <UseSchema name="RIGHTNOW"/>
    <UseSchema name="PUBLIC"/>
  </User>
  <Schema name="RIGHTNOW" type="RightNow">
    <ConfigOptions>uppercaseidentifiers=true;auditcolumns=none;
     mapsystemcolumnnames=1;</ConfigOptions>
<SessionOptions>loginHost=mysite.custhelp.com;
User=test;Password=secret</SessionOptions>
  </Schema>
  <Schema name="PUBLIC" type="local">
  </Schema>
</Database>
The following sections describe the elements in the database configuration file.
* <Database>
* <User>
* <UseSchema>
* <Schema>
* <ConfigOptions>
* <SessionOptions>