Moxi Media Inc.
<sql-connection> Discussion Forum
IMF Developer's Guide » Database Configuration » <sql-connection>  

The <sql-connection> element is used to a define database connections for IMF routines to use for reporting or querying data in SQL databases relating to data in ArcIMS layers. A connection pool is created for each <sql-connection> defined in the connection configuration file.

Frequency Parent Elements (the <sql-connection> element is valid within):
PO+ <sql-connections>
   

Frequency Description (in this context)
P0+ The <sql-connection> element may appear zero or more times in the <sql-connections> element.
   

Attributes Description
connection-string The connection string required to connect to your database using JDBC. Typically this string includes the host, port number, and database name. used. Refer to the JDBC documentation that came with your database system for the appropriate connection string for your installation.
driver The class name for the JDBC driver for the database being used. Refer to the JDBC documentation that came with your database system for the appropriate class name. Note that the JDBC drivers applicable to your database must be available to the IMF application in your servlet engine, installed in the CLASSPATH of your Java installation, servlet engine installation, or within the WEB-INF/lib or WEB-INF/classes directory of the IMF installation.
name A unique name for this <sql-connection> which can be used to retrieve the connection or refer to it using the specified name when defining <sql-report> or <sql-query> elements.
password The password for the account used to connect to the SQL database. For database connections that don't require user names or passwords (e.g. Microsoft Access), use an empty string for this value (i.e. password=""), or omit this attribute altogether. Optional, defaults to null.
user The user name for the account used to connect to the SQL database. For database connections that don't require user names or passwords (e.g. Microsoft Access), use an empty string for this value (i.e. user=""), or omit this attribute altogether. Optional, defaults to null.
   

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>

Valid HTML 4.01!