Database Reference
In-Depth Information
Listing 12-25. Update User and Mobile Numbers
if (existingEmpComboBox.getSelectedIndex() > 0 &&
(!osUserIDTextField.getText().equals(""))) {
stmt = (OracleCallableStatement)conn.prepareCall(
"CALL hr.hr_pub_pkg.p_update_emp_mobile_nos(?,?,?,?,?,?,?)");
...
If we are creating a new employee without having selected an existing employee previously, then we
would not have exchanged encryption keys yet. If that's the case, then the sessionSecretDESPassPhrase
member (among others) will be null. We test sessionSecretDESPassPhrase for null, and if it is we call an
additional Oracle stored procedure, p_get_shared_passphrase , from Chapter 7, to exchange keys before
calling the data update procedures.
WHEN DOES THE ORACLE USER GET CREATED?
As of yet, we have not created the Oracle user corresponding to user ID we entered on the Add/Modify
User functional screen. For each employee in the HR.EMPLOYEES table, we can create a record in
hr.v_emp_mobile_nos that contains a user ID. The user ID is the same as the name of a Windows
(operating system) account. We will create an Oracle user with that same name, and we will use the fact of
having identical names to do single sign-on. The Oracle user will be granted access because the person
has already logged in as an identical operating system user.
You may now wonder why we never ran a procedure to create the Oracle user from our Add/Modify User
functional screen. It wasn't an oversight, but merely a delay until the last minute. We have no reason to
create an Oracle user if he does not have access to any applications, so we will only create the user when
we first grant him access to an application. That will happen in either the Admin Users or Assign
Application functional screens, described next.
User Administration Screen
In the security administration interface application, each of our functional screens has many similarities
to one another. We discussed many of those features already in looking at the Add/Modify User
functional screen, and we won't repeat those details. However, there are plenty of new ideas introduced
in each screen that will give us food for thought. The Admin Users functional screen is our current topic
of discussion.
In the Admin Users screen shown in Figure 12-4, we have a drop-down combo box where we will
find a list of all the users, userComboBox . This is not a list of all employees, but rather a list of all those
employees with records in the hr.v_emp_mobile_nos view. For each user, we get the user ID from
hr.v_emp_mobile_nos and the first and last name from hr.v_employees_public . We accomplish this in the
dataInit() method of the AdminUsers class, and the process is identical to what we did in the dataInit()
method of AddUser , as described previously.
 
 
Search WWH ::




Custom Search