Database Reference
In-Depth Information
2011-06-05 21:00:23
Run Main to Copy Connection Strings to New Version
We will edit OracleJavaSecure.java one more time in order to test our ability to copy a list of connection
strings from an older version of an application to the new version. Open the file and edit the inner class
InnerRevLvlClass (near the top), incrementing the version number, for example from 20110101a to
20110101b . See Listing 11-56.
Listing 11-56. Change Version/Revision of Application Inner Class
private static class InnerRevLvlClass
implements Serializable, RevLvlClassIntfc
{
private static final long serialVersionUID = 2011010100L;
private String innerClassRevLvl = " 20110101b ";
public String getRevLvl() {
return innerClassRevLvl;
}
}
Note We do not have to CREATE a new version of this java code on the Oracle Database, because the
serialVersionUID has not changed.
In the main() method, find the commented call to copyAppConnections() and uncomment that call.
Assure that the old version number String in that call, Listing 11-57, matches the innerClassRevLvl you
changed from previously.
Listing 11-57. Copy List of Connection Strings from Previous Version
copyAppConnections( " 20110101a " );
Compile OracleJavaSecure and run it. Use the same two-factor authorization code if it has been less
than ten minutes, else request and use a new one. This will exit after copying the list of connection
strings from the old version to the new one.
Chapter11>javac orajavsec/OracleJavaSecure.java
Chapter11>java orajavsec.OracleJavaSecure
Chapter11>java orajavsec.OracleJavaSecure 1234-5678-9012
Main encodes a new APPVER password if given.
After encoding, paste encoded string
in setAppVerConnection method.
Domain: ORGDOMAIN, Name: OSADMIN
As SYS user on apver , you can see that there is a new version of the application class file and
associated list of connection strings by querying the appsec.v_app_conn_registry view.
"CLASS_NAME" "CLASS_VERSION" "CLASS_INSTANCE" "UPDATE_DT"
 
Search WWH ::




Custom Search