Database Reference
In-Depth Information
until the user clicks on the button to acknowledge our message before we hide the Add/Modify User
screen and make the
OJSAdmin
menu visible once again.
Listing 12-13.
Add/Modify User Screen Constructors
public AddUser(JFrame
parent
) {
this()
;
this.parent = parent;
// Post jbInit visual setup
userMessageLabel.setVisible(false);
userMessageLabel1.setVisible(false);
ButtonGroup empGroup = new ButtonGroup();
empGroup.add(existingEmpRadioButton);
empGroup.add(newEmpRadioButton);
existingEmpRadioButton.setSelected(true);
Login.center(this);
parent.setVisible(false)
;
this.setVisible(true)
;
if (null == conn)
{
JOptionPane.
showMessageDialog
(thisComponent,
"Your account is not permitted to use this functional screen!");
parent.setVisible(true);
this.setVisible(false);
}
}
public AddUser() {
try {
jbInit();
conn =
OracleJavaSecure.getAAConnRole("orcl", "appusr")
;
// Possibly reentering - need new keys for new Oracle session
OracleJavaSecure.
resetKeys()
;
locModulus = OracleJavaSecure.getLocRSAPubMod();
locExponent = OracleJavaSecure.getLocRSAPubExp();
sessionSecretDESPassPhrase = null
;
dataInit()
;
} catch (Exception e) {
e.printStackTrace();
}
}
In our second constructor shown in Listing 12-13 we do the following four things:
Call
jbInit()
to initialize the GUI components.
•
•
Call
getAAConnRole()
to get a connection, specific for this function. Because we are
performing tasks related to the employee data in the
HR
schema, we are going to
need the
hrview_role
that we get through the
appusr
user on the
orcl
instance.
•
Reset the encryption keys for this new connection.
Call
dataInit()
to populate the drop-down combo boxes with existing values.
•