NonStop Servlets for JSP System Administrator's Guide
Configuring NSJSP
NonStop Servlets for JavaServer Pages (NSJSP) System Administrator’s Guide—525644-001
3-23
JDBCRealm
•
A userRole table must exist, as referenced in Example 3-20, that contains one
row for every valid role that is assigned to a particular user. It is valid for a user to
have zero, one, or more than one role. The userRole table must contain at least
two columns (it can contain more if your existing applications require it):
°
Username, to be recognized by the NSJSP container (same value as is
specified in the users table).
°
Role name of a valid role associated with this user.
Example 3-20 is a sample of SQL commands to add users and user roles.
Two sample files, iTP_JDBCRealm.create.sample and
iTP_JDBCRealm.load.sample, exist in the
iTPWS_INSTALL_DIR/servlet_jsp/conf directory.
After replacing the =T1222DBDIR string with the Guardian location (of the form
$Volume.SubVolume) in these two sample files, you can pass these files as input to
the NonStop SQL Command Interpreter (SQLCI) via the OSS command shown in
Example 3-21:
Example 3-20. SQL Commands to Add Users and User Roles
create catalog ;
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");