...
The relational database connector allows you to pull attributes from data stores that can be access through a Java JDBC driver (which is nearly all relational databases). This connector pools JDBC connections in order to enchance performance. See the advanced configuration section in order to disable this.
Include Page |
---|
| SHIB:DataConnectorBasicsSHIB: |
---|
| DataConnectorBasics |
---|
|
Configuring the Connector
- Create a JDBCDataConnector element, provide it an id, and the follow attributes:
- dbURL - the JDBC url for your database including the userid and password used to connect to the database
- dbDriver - the full qualifed class name of the JDBC driver to use (must be on your classpath)
- useCallableStatement - true if you're using SQL stored procedures (known as callable statments in Java), this attribute is optional
- Create a Query child element whose content is the SQL query used to fetch the attributes. You may use a single question mark in place of a parameter value in order to indicate that the principal's name should be used.
...
Advanced Configurations
The JDBCDataConnector element also supports the following attributes:
...
- In the Query element use question marks to indicate where attributes values are needed
- Create a StatementCreator element, as a child of JDBCDataConnector, with a class attribute of
edu.internet2.middleware.shibboleth.aa.attrresolv.provider.DependencyStatementCreator
- For each value in the query create a Parameter element, as a child of StatementCreator with the following attributes:
- type - The SQL object type of the attribute to be used, acceptable values are: String, Integer, Byte, Double, Float, Long, Short, Boolean, Date, Blob, Clob
- attribtueName - The name of the attribute whose value will be used
- nullMissing - Indicates whether the value null should be used if the attribute value is null, acceptable values are: true, false
- connectorID - The ID of the connector the attribute value may be retrieved from
...
Code Block |
---|
<JDBCDataConnector id="db2"
dbURL="jdbc:postgresql://test.example.edu/test?user=postgres&password=test"
dbDriver="org.postgresql.Driver"
maxActive="10"
maxIdle="5">
<DataConnectorDependency requires="echo"/>
<AttributeDependency requires="urn:mace:dir:attribute-def:eduPersonEntitlement"/>
<Query>select date from foo where principalName = ? and entitlement = ?</Query>
<StatementCreator class="edu.internet2.middleware.shibboleth.aa.attrresolv.provider.DependencyStatementCreator">
<Parameter type="String" attributeName="eduPersonPrincipalName" connectorId="echo" nullMissing="false" />
<Parameter type="String" attributeName="urn:mace:dir:attribute-def:eduPersonEntitlement" nullMissing="false" />
</StatementCreator>
</JDBCDataConnector>
|
Include Page |
---|
| SHIB:DataConnectorDependenciesSHIB: |
---|
| DataConnectorDependencies |
---|
|
Include Page |
---|
| SHIB:DataConnectorErrorAndCacheSHIB: |
---|
| DataConnectorErrorAndCache |
---|
|