Configuring GDAS with a JDBC
Connection
Below is an example of a <dataset_config>
element configured to use the JDBC software.
<dataset_config DatasetName="BC_forest_cover"
DatasetDomain="nfis.org">
<parameter name="table_name" value="FIP_LAYER"/>
<parameter name="connParams" value="username=myUserName,
password=secretPassword,
conn_url=jdbc:oracle:thin:@db.nfis.org:1521:myDatabase,
jdbc_driver=oracle.jdbc.driver.OracleDriver"/>
<geo_linkage_field_type value="string"/>
<data_retriever_class data_retriever_class_name=
"org.nfis.gdas.v091.JDBCDataRetriever"/>
</dataset_config>
How to complete the JDBC <dataset_config>
<parameter elements>
There are two <parameter> elements that are
part of the JDBC configuration.
-
Table Name <parameter>
One parameter element's attribute 'name' must
have the value "table_name". The elements 'value'
attribute has the name of the table that is to be
queried or the name of the *.dbf file. Example:
<parameter name="table_name"
value="FIP_LAYER"/>
-
Connection <parameter>
This parameter element defines what type of a connection is being
used, single connection or connection pool. The 'name' attribute
must have the value "connParams" when using a single connection or
"connectionPoolParams" when connection pooling is used. This element has
as its 'value' a comma delimited string which defines the connection parameters.
- connParams
If the parameter elements 'name' attribute's
value is "connParams" this means you will be
making a direct connection to the database.
The comma delimited string of the 'value'
attribute must contain the following
key=value pairs:
-
username=loginName (Not required for .dbf files),
-
password=myPassword (Not required for .dbf files),
-
jdbc_url=connect string for the JDBC data
source,
*.dbf example: conn_url=jdbc:DBF:////data
Oracle example: conn_url=jdbc:oracle:thin:@db.nfis.org:1521:myDatabase,
-
conn_driver=JDBC driver used to connect
to data source
Different data sources are accessed using
specific JDBC drivers. The Oracle driver
we use is:
oracle.jdbc.driver.OracleDriver.
Drivers included in this installation
are:
If you need another driver, it must be
put in the classpath for the application
(for tomcat this is the
TOMCAT_HOME/common/lib or the projects WEB-INF/lib
directory) and its
Java class name used as the value for the
conn_driver key.
- connectionPoolParams
If the parameter element's 'name' attribute's
value is 'connectionPoolParams' this means
GDAS will look for a connection pool
configured in the web container. The comma
delimited string of the 'value' attribute
must contain the following key=value pairs:
-
pool_name=name of the connection pool as configured in the
J2EE web server (Tomcat),
-
naming_context=the context to look into for the pool_name connection pool
as configured in the J2EE web server (Tomcat)
Values for the <geo_linkage_field_type> element
This field describes the datatype of the returned attribute and
must be one of three values:
- string
- number
- float
Values for the <data_retriever_class> element
For all JDBC connections the value for this element's
data_retriever_class_name attribute is:
org.nfis.gdas.v091.JDBCDataRetriever
|