How to Write a JDBC Data Resource Configuration Document
To write a data resource configuration document to expose a JDBC-enabled data resource:
- Copy the following XML document:
<?xml version="1.0" encoding="UTF-8"?>
<dataResourceConfig
xmlns="https://ogsadai.org.uk/namespaces/2005/10/config">
<documentation>
MY-COMMENTS
</documentation>
<metaData>
<productInfo>
<productName>PRODUCT</productName>
<productVersion>VERSION</productVersion>
<vendorName>VENDOR</vendorName>
</productInfo>
CUSTOM-METADATA
</metaData>
<roleMap name="Name"
implementation="uk.org.ogsadai.common.rolemap.SimpleFileRoleMapper"
configuration="ROLE-MAP-FILE"/>
<dataResource>
<driver implementation="DATABASE-DRIVER">
<uri>DATABASE-URI</uri>
</driver>
</dataResource>
</dataResourceConfig>
- Optionally, replace MY-COMMENTS with some suitable text describing your data resource, or just remove it.
- Replace PRODUCT with the name of your data resource e.g. MySQL.
- Replace VERSION with the version of your data resource e.g. 4.
- Replace VENDOR with the vendor of your data resource e.g. MySQL.
- Optionally, replace CUSTOM-METADATA with some suitable XML describing your data resource, or just remove it. Any custom metadata element that is a direct child of the <metadata> element will be published as a data resource property by the service and can be accessed by clients. The data resource property can be accessed by the name of the element. For example,
<databaseName>
My database name
</databaseName>
will be published as data resource property under the name {https://ogsadai.org.uk/namespaces/2005/10/properties}databaseName and the value My database name.
- Replace ROLE-MAP-FILE with the relative or absolute location of a role map file consistent with the OGSA-DAI role map document format (which is described later in this guide). Relative pathnames will be resolved against the home directory of the web application of a Web services hosting container, for example CONTAINER/webapps/axis or CONTAINER/webapps/wsrf.
- Replace DATABASE-DRIVER with a Java database driver class names. We have already given an overview of recommended relational database drivers.
- Replace DATABASE-URI with the driver-specific URI of your data resource. For example:
- For MySQL jdbc:mysql://localhost:3306/ogsadai
- For DB2 jdbc:db2://localhost:50000/ogsadai
- For SQL Server jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=ogsadai
- For PostgreSQL jdbc:postgresql://localhost:5342/ogsadai
- For Oracle jdbc:oracle:thin:@localhost:1521:ogsadai