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.
The <table>
tag supports several attributes that let you configure table ownership:
metaDataSchemaPattern
Specifies the name of the database account used to create the tables that underlie the repository.
metaDataCatalogName
Specifies a catalog name. If the user does not own the table to be used by the repository, this attribute can be used once during repository initialization in a call to determine the column types.
tablePrefix
If the user does not own the table used by the repository, the tablePrefix
lets you 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"/> ...
metaDataSynonymTableName
If a database schema uses a synonym to reference a table in another schema, and the synonym and table names are different, the <table>
tag must set the metaDataSynonymTableName
attribute to the source table’s name. On startup, a repository uses this attribute to identify the source table so it can obtain the database metadata and validate the table definition.