Database Reference
In-Depth Information
}
...
The code for Login is something we can give to other application programmers for inclusion in their
applications. It is a template and a reusable piece of code—they just need to include it in their package.
Then they don't need to worry about any of the setup details. After login is completed, they can just get
their connection strings from OracleJavaSecure by calling the getAAConString() method.
In order to use the Login$InnerRevLvlClass in the Oracle database, we need to have a representative
class to instantiate in the database. We need to execute the script shown in Listing 12-2 to create that
Java structure in the database. We will be creating a similar Java structure in the database for each
application. The only difference between classes for different applications will be the package name.
You may execute this script as the sys user on the apver instance, but you do not need to. When we
get to the end of this chapter, we are going to use this security administration interface to register itself
through a bootstrap process. That process will include creating the representative inner class in the
Oracle Database and generating the connection strings that will be used by this application.
Listing 12-2. Script to Build Login Inner Class
CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED APPSEC."orajavsec/Login" AS
package orajavsec ;
import java.io.Serializable;
import orajavsec.RevLvlClassIntfc;
// Drop the "extends JDialog" from class definition
// It is unneeded and will be invalid on Oracle server
public class Login {
public static class InnerRevLvlClass implements Serializable,
RevLvlClassIntfc {
private static final long serialVersionUID = 2011010100L;
private String innerClassRevLvl = "20110101a";
public String getRevLvl() {
return innerClassRevLvl;
}
}
}
/
Note This script can be found in the file Chapter12/Login.sql .
Center Method
We need to have the Login screen centered on the user's monitor, or else it may appear but be unnoticed
in the top left corner of the monitor. Centering GUI interfaces is standard practice, and is something we
 
Search WWH ::




Custom Search