NonStop Servlets for JavaServer Pages (NSJSP) 6.0 System Administrator's Guide
Configuring NSJSP
NonStop Servlets for JavaServer Pages (NSJSP) 6.0 System Administrator’s Guide—544548-004
3-27
JDBCRealm
JDBCRealm Element Attributes
To configure JDBCRealm, create a <Realm> element and nest it in the
NSJSP_HOME/conf/server.xml file or in the <Context> element in the context
configuration file. The following attributes are supported for JDBCRealm:
Example 3-11. SQL Commands to add Users and User Roles
create catalog mycatalog;
set catalog mycatalog;
create schema myschema;
set schema myschema;
create table users (
user_name varchar(15) not null,
user_pass varchar(15) not null,
primary key (user_name));
create table roles (
role_name varchar(15) not null,
primary key (role_name));
create table userrole (
user_name varchar(15) not null,
role_name varchar(15) not null,
primary key(user_name, role_name));
insert into users values (‘tomcat’, ‘tomcat’);
insert into users values (‘user1’, ‘role1’);
insert into users values (‘user2’, ‘role2’);
insert into roles values (‘tomcat’);
insert into roles values (‘other’);
insert into userrole values (‘user1’, ‘tomcat’);
insert into userrole values (‘user2’, ‘other’);
insert into userrole values (‘tomcat’, ‘other’);
insert into userrole values (‘tomcat’, ‘tomcat’);
Note. Example 3-11 on page 3-27 uses a varchar(15) field for the user_name column in
the users table. If you configure a web application by using the client-certificate based
authentication method, this column size (variable length characters with a maximum size of 15
characters) is not large enough because the value stored in the user_name column is the
subject (subject distinguished name field) from the client-certificate. If the subject exceeds the
NonStop SQL maximum allowable primary key limit of 256 characters, alter the user_name
field to the appropriate size and define a new primary key that conforms to the NonStop SQL
limits.










