Skip to main content
Version: 6.3

XML Configuration

A sample XML-format configuration. Copy this content to a new file named jdbc.config.xml.

jdbc.config.xml

<?xml version="1.0" encoding="UTF-8"?>
<cfg:configuration xmlns:cfg="http://www.axiomatics.com/jdbc.config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.axiomatics.com/jdbc.config jdbc.config.xsd ">
<cfg:connnection>
<cfg:url>jdbc:postgresql://localhost/usda?user=usda&amp;password=password</cfg:url>
<cfg:driver>org.postgresql.Driver</cfg:driver>
</cfg:connnection>
<!-- mapping for allergy test -->
<cfg:mapping>
<cfg:xacmlAttribute AttributeId="food-group-name" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" DataType="http://www.w3.org/2001/XMLSchema#string" Issuer=""/>
<cfg:nativeAttribute>
<cfg:sqlType>2004</cfg:sqlType>
<cfg:query>SELECT fddrp_desc FROM fd_group WHERE fdgrp_cd=?</cfg:query>
<cfg:key allowMultiple="false" sqlType="12">
<cfg:xacmlAttribute AttributeId="food-id" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" DataType="http://www.w3.org/2001/XMLSchema#string" Issuer=""/>
</cfg:key>
</cfg:nativeAttribute>
<cfg:uId>1</cfg:uId>
</cfg:mapping>
<!-- mapping for journal reading -->
<cfg:mapping>
<cfg:xacmlAttribute AttributeId="issue-year" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" DataType="http://www.w3.org/2001/XMLSchema#integer" Issuer=""/>
<cfg:nativeAttribute>
<cfg:sqlType>4</cfg:sqlType>
<cfg:query>SELECT year FROM data_src WHERE datasrc_id=?</cfg:query>
<cfg:key allowMultiple="false" sqlType="12">
<cfg:xacmlAttribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" DataType="http://www.w3.org/2001/XMLSchema#string" Issuer=""/>
</cfg:key>
</cfg:nativeAttribute>
<cfg:uId>2</cfg:uId>
</cfg:mapping>
<cfg:mapping>
<cfg:xacmlAttribute AttributeId="journal-name" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" DataType="http://www.w3.org/2001/XMLSchema#string" Issuer=""/>
<cfg:nativeAttribute>
<cfg:sqlType>2004</cfg:sqlType>
<cfg:query>SELECT journal FROM data_src WHERE datasrc_id=? GROUP BY journal</cfg:query>
<cfg:key allowMultiple="false" sqlType="12">
<cfg:xacmlAttribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" DataType="http://www.w3.org/2001/XMLSchema#string" Issuer=""/>
</cfg:key>
</cfg:nativeAttribute>
<cfg:uId>3</cfg:uId>
</cfg:mapping>
<cfg:mapping>
<cfg:xacmlAttribute AttributeId="subscribed-journal" Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" DataType="http://www.w3.org/2001/XMLSchema#string" Issuer=""/>
<cfg:nativeAttribute>
<cfg:sqlType>2004</cfg:sqlType>
<cfg:query>SELECT journal FROM data_src WHERE journal LIKE 'Journal of%'</cfg:query>
</cfg:nativeAttribute>
<cfg:uId>4</cfg:uId>
</cfg:mapping>
<!-- mapping for null bit test -->
<cfg:mapping>
<cfg:xacmlAttribute AttributeId="food_bit" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" DataType="http://www.w3.org/2001/XMLSchema#string" Issuer=""/>
<cfg:nativeAttribute>
<cfg:sqlType>-7</cfg:sqlType>
<cfg:query>SELECT food_bit FROM fd_group WHERE fdgrp_cd=?</cfg:query>
<cfg:key allowMultiple="false" sqlType="12">
<cfg:xacmlAttribute AttributeId="food-id" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" DataType="http://www.w3.org/2001/XMLSchema#string" Issuer=""/>
</cfg:key>
</cfg:nativeAttribute>
<cfg:uId>5</cfg:uId>
</cfg:mapping>
</cfg:configuration>