Connecting to data sources : Using a connection configuration file
 
Using a connection configuration file
A connection configuration file is an XML file, such as the one shown in Listing 14‑1, in UTF‑8 or ASCII encoding. The file specifies the data source connection properties to use when iHub runs a design. Having the data source connection information for a design in an external file makes it convenient to modify. You change the connection information without altering the design. You specify the location of the file using Configuration Console.
You can use an external connection configuration file to define a data source for the Actuate Caching service and for a data connection definition (.dcd) file, which contains information object connection properties for a data source. You can also use an external connection configuration file for connecting data sources to designs.
You can create an external connection profile to a data source used by a design. Changes to the profile are automatically picked up by the design. The settings in a connection configuration file override any connection configuration properties in the connection profile. The sample connection configuration file in Listing 14‑1 externalizes the file path to the connection profile, C:\SqlServer.profile.
Listing 14‑1 BIRT connection configuration file example
<oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="JDBC Data Source - SQL Server" id="783">
<property name="odaDriverClass">com.actuate.jdbc.sqlserver. SQLServerDriver
</property>
<property name="odaURL">jdbc:actuate:sqlserver://DBSRV1-W2K
</property>
</oda-data-source>
<ConnectOptions Type=".eclipse.birt.report.data.oda.jdbc_ JDBC Data Source - SQL Server ">
<Property PropName="OdaConnProfileStorePath">C:\Mypath
</Property>
</ConnectOptions>
In a BIRT design, the configuration key used to specify a data source is the unique ID of the ODA data source extension and data source name defined in the BIRT design or library. You must concatenate the string as follows:
extensionID + "_" + data source name
For example, the key is org.eclipse.birt.report.data.oda.jdbc_SQL Server.