Database Reference
In-Depth Information
try {
if( null != stmt ) stmt.close();
} catch( Exception y ) {}
}
return mConn;
}
Note that the call to
p_check_role_access
is identical to what we had been asking our developers to
do for themselves. The
applicationID
we use in that call is what we set our static member to when we
called
setAppContext()
.
Test Application Authentication, Phase 2
If you haven't already, execute the script to create the stub inner class for
TestOracleJavaSecure
in
Oracle database.
Note
Execute the script in
TestOracleJavaSecure.sql
on the Oracle database.
You can query Oracle database to see the Java structures that you have just created. There will be
one Java structure for the
TestOracleJavaSecure
outer class, and one for the inner class, resembling this
list. Here's the query to execute:
SELECT * FROM SYS.ALL_OBJECTS WHERE OBJECT_TYPE = 'JAVA CLASS' AND OWNER = 'APPSEC';
testojs/TestOracleJavaSecure
/545c0b44_TestOracleJavaSecure
Next, edit and compile the
TestOracleJavaSecure
class on the client. Modify the call to
putAppConnString()
with the password, server name, instance name and port number for your Oracle
instance.
Note
Edit the code found in the file named
Chapter10/testojs/TestOracleJavaSecure.java.
The tests here will be relatively simple, but everything we have described so far in this topic will have
taken place by the time we display a line of encrypted data from the database. This can also serve as an
example of what an application developer will have to do to use our security structures.
First you will note that this application implements an inner application class in Listing 10-57.
Listing 10-57.
Second Test Application Inner Class
package testojs;
public class TestOracleJavaSecure {
public static
class AnyNameWeWant
implements Serializable, RevLvlClassIntfc