NonStop Servlets for JavaServer Pages (NSJSP) 6.1 System Administrator's Guide
Security Considerations
NonStop Servlets for JavaServer Pages (NSJSP) 6.1 System Administrator’s Guide—596210-006
8-25
Realms
Example 8-4 shows how to define a JNDI datasource to connect to SQL/MX using the
JDBC Type 2 driver. The JNDI resource can either be configured in server.xml or in
the application-specific context.xml file. For more information on configuring JNDI
resources, see http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html.
For a complete set of attributes that can be used to configure a data source, see
http://commons.apache.org/dbcp/configuration.html.
Example 8-5 shows a sample DataSourceRealm configuration that uses a global
DataSource.
CombinedRealm
The CombinedRealm is an implementation of the Tomcat 6 Realm interface that
authenticates users through one or more sub-Realms.
Example 8-4. Defining a Global JNDI Datasource
<GlobalNamingResources>
<Resource name="jdbc/authority"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.tandem.sqlmx.SQLMXDriver"
url="jdbc:sqlmx: "
maxActive="20"
maxIdle="10"
maxWait="-1"/>
</GlobalNamingResources>
Example 8-5. Sample DataSourceRealm Configuration
<Realm className="org.apache.catalina.realm.DataSourceRealm"
dataSourceName="jdbc/authority"
userTable="mycatalog.myschema.users"
userNameCol="user_name"
userCredCol="user_pass"
userRoleTable="mycatalog.myschema.userrole"
roleNameCol="role_name"/>
Note. Because the localDataSource attribute is not used in Example 8-5, the Realm
searches the datasource using the jdbc/authority name defined in
GlobalNamingResources.










