Database Reference
In-Depth Information
Figure 12-3.
Add/Modify User functional screen
Instantiate the AddUser Screen
The Add/Modify User code is found in the file
Chapter12/orajavsec/AddUser.java
. We will begin
exploring this functional screen by examining the constructors. Both constructors are shown in Listing
12-13. The first constructor is the one we call from the
OJSAdmin
menu. We pass a reference to
OJSAdmin
,
so that we can hide it by calling the
parent.setVisible()
method. At about the same time, we set the
Add/Modify User screen visible. Note that the first line in any constructor may be a call to a super-class
constructor or another constructor in the same class. Here we call
this()
, which is a call to the default
constructor (with no arguments); that is, the second constructor shown in Listing 12-13.
The last thing I'd like to point out about the first constructor shown in Listing 12-13 is that we end it
by testing for the database connection being null. The connection would be null for at least a couple
possible reasons, but the most important are that the operating system user account does not have
access to the database. Specifically, the OS user may not have the right to proxy through the Oracle
application user account that needs to be used for this function. When that occurs, we do not proceed;
rather, we throw up a
Dialog
screen to notify the user. In this GUI single-threaded world, we will wait