If the user does not own the database tables used by the SQL repository, you must configure the repository so when the repository is initialized, it can determine the column types in the tables. If you have not configured the table ownership correctly, you may get an “unknown JDBC types for property” error.

You use three attributes within a <table> tag in a repository definition file to configure table ownership parameters for an SQL repository:

metaDataSchemaPattern
metaDataCatalogName
tablePrefix

The metaDataSchemaPattern attribute should be set to the name of the database account that was used to create the tables that underlie the repository.

The metaDataCatalogName attribute represents a catalog name. If the user does not own the table to be used by the repository, this attribute can be used once during initialization of the repository in a call to determine the column types.

If the user does not own the table used by the repository, you can use the tablePrefix attribute to construct a qualified table name. This attribute is not used during the initial metadata query, but if present is prepended to the table name when inserts or updates are made. For example:

<attribute name="tablePrefix" value="myPrefix."/>

For instance, the following snippet sets dps_user to use testing2 as the schema name for the metadata call. The string testing2. prepended to the table name for all other queries.

<gsa-template>
 ...
  <table name="dps_user" type="primary" id-column-name="id">
    <attribute name="tablePrefix" value="testing2."/>
    <attribute name="metaDataSchemaPattern" value="testing2"/>
 ...

In using these attributes, be sure use the same case (upper, lower, mixed) that your database uses to store object identifiers. For example, Oracle stores its identifiers in uppercase. So, you set metaDataSchemaPattern to DYNAMO instead of Dynamo. See the Javadoc for java.sql.DatabaseMetaData.getColumns() for more information. See also Database Loggers in the Logging and Data Collection chapter of the ATG Programming Guide for more information about these attributes.

Also, you can set the metaDataSchemaPattern and metaDataCatalogName as properties in the SQL repository component. If they are set as a property, that setting is used as a default for every table in the repository that does not have the corresponding attribute explicitly set in the repository definition file. The attribute in the table tag takes precedence, in other words.

 
loading table of contents...