Alternate Style Database Table


This is an example of a named table definition for an Oracle database table with alternate style column. This uses the DBDataSourceMetadata element to specify the geometry column and the alternate style column defined in the database table.

Note: Alternate style columns can be defined in any supported database type by changing the connection definition.

In this example, the database connection definition to the Oracle table is defined using the following tokens:

  • @owner@ the owner name of the Oracle table
  • @host@ the host name used to connect to the Oracle database
  • @port@ the port number used to connect to the Oracle database
  • @SID@ the SID for the Oracle instance
  • @username@ the user credentials for accessing the database
  • @password@ the password credentials for accessing the database

In addition, it defines a DBDataSourceMetadata element indicating the name of the geometry column and style columns to use for the alternate styling of the table.

  • @srsname@ the name of the coordinate system for the spatial geometries in @geometrycolumn@
  • @geometrycolumn@ the name of a feature attribute containing a spatial geometry object
  • @styletype@ the type of the style attribute @stylecolumn@
  • @stylecolumn@ the attribute that contains the per feature style
<?xml version="1.0" encoding="UTF-8"?>
<NamedDataSourceDefinition version="MXP_WorkSpace_1_5">
	<DBConnection dbType="oracle">
                <Property name="user" value="scott"></Property>
                <Property name="password" value="tiger"></Property>
		<DBDataSourceDefinition id="ora1" volatile="true">>
			<DBTable owner="@owner@" useQuotes="true">table2</DBTable>
				<FeatureGeometryAttribute srsName="@srsname@">@geometrycolumn@</FeatureGeometryAttribute>
				<FeatureStyleAttribute type="@styletype@">@stylecolumn@</FeatureStyleAttribute>
	<DataSourceRef ref="ora1"/>