Configuring data source connections in BIRT iHub
A connection configuration file is an XML file that specifies the data source connection properties to use when BIRT 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 in the template settings in acserverconfig.xml.
To specify the location of a data configuration file in acserverconfig.xml, add the ConnConfigFile property containing the configuration file path as shown in the following code:
<Config>
<Templates>
<Template ConnConfigFile="config_file_path">
....
</Template>
</Templates>
</Config>
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 7‑12 externalizes the file path to the connection profile, C:\PostgreSQL.profile.
Listing 7‑12 BIRT connection configuration file example
<oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="JDBC Data Source - PostgreSQL" id="783">
<property name="odaDriverClass">com.actuate.jdbc.postgresql.PostgreSQLDriver
</property>
<property name="odaURL">jdbc:actuate:postgresql://DBSRV1-W2K
</property>
</oda-data-source>
<ConnectOptions Type=".eclipse.birt.report.data.oda.jdbc_ JDBCData Source - PostgreSQL ">
<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_PostgreSQL.