|
| Database Configuration Reference | Discussion Forum |
| IMF Developer's Guide » Database Configuration |
A database configuration XML file is used to specify one or more database connections for IMF routines to use for reporting or querying data in SQL databases that relate to data in the ArcIMS layers used IMF. The database configuration XML file (named sql-connections.xml, located in the WEB-INF directory of IMF) is read when your servlet engine is first started. For performance reasons, SQL connection pools are created for each connection defined in the file. The servlet engine needs reloading before changes in the database configuration XML file take effect.
The <sql-connections> element is the topmost tag of the sql-connections.xml file. The elements of the sql-connections.xml file must be enclosed by a <sql-connections> element start and end tag:
<?xml version="1.0" encoding="UTF-8"?> <sql-connections> <!-- zero or more sql-connection elements go here --> </sql-connections>
For best results, and to avoid making errors when working with the configuration files, use an XML editing tool like XMLSPY to create, edit, and validate your XML against the schema for this file format. The Home Edition works well, and is free. When using a validation tool, note the the elements must appear in the sequence below.
It is recommended that you validate your file against the schema in your WEB-INF directory (the same directory as the sql-connections.xml file) as follows:
<?xml version="1.0" encoding="UTF-8"?>
<sql-connections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./sql-connections.xsd">
<!-- zero or more sql-connection elements go here -->
</sql-connections>
|
|
Example:
<?xml version="1.0" encoding="UTF-8"?>
<sql-connections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./sql-connections.xsd">
<sql-connection name="oracle_prod"
driver="oracle.jdbc.driver.OracleDriver"
connection-string="jdbc:oracle:thin:@slkux1.env.gov.bc.ca:1521:mstwhse"
user="somebody"
password="secret"/>
<sql-connection name="postgres_test"
driver="org.postgresql.Driver"
connection-string="jdbc:postgresql://localhost:5432/test"
user="somebody"
password="secret"/>
</sql-connections>