Database Reference
In-Depth Information
}
return setConnection( c ) ;
}
Note If you were going to implement a connection pool inside the OracleJavaSecure class, this is where you
would do it. You would want to assure that the URL string had not changed with each subsequent call.
Close the Proxy Connection
Have the developers call a method on OracleJavaSecure to close the configured proxy connection, in
order to assure the call is appropriate (Listing 8-26). We must assure that we close the proxy session,
which may be an additional session on a single connection.
Listing 8-26. Close the Internal Connection, closeConnection ()
public static final void closeConnection() {
try {
conn.close( OracleConnection. PROXY_SESSION );
} catch( Exception x ) {}
}
A Code Template to Give Developers
The lines shown in Listing 8-27 are all the Java that application developers will need in order to do
Oracle SSO, by using the OracleJavaSecure class.
Listing 8-27. Method Calls for Application Developers
OracleConnection conn = OracleJavaSecure.setConnection( connectionString );
// Do Oracle queries here
OracleJavaSecure.closeConnection();
Refer to the instructions at the end of Chapter 7 in order to create a jar file containing
OracleJavaSecure to give the application developers.
Note that there will also need to be a secure application role, protected by a procedure like the
p_check_hrview_access in order to complete the SSO protection of our data.
In the case where we are doing proxy connections, there will need to be an Oracle user for each OS
user identity that we want to have accessing our applications. And those Oracle individual person users
will need to be granted “proxy through” on our application user.
Chapter Review
In this chapter, we discussed how to identify the Windows or UNIX user using the JAAS classes, NTSystem ,
and UnixSystem . Because those classes are not provided cross-platform, we delved into using reflection
to both instantiate and call methods in those classes.
 
Search WWH ::




Custom Search