This topic describes how to modify the generated JClient login dialog to work with a JDBC connection instead of OracleAS JAAS Provider.
To modify the generated JClient login dialog for JDBC connections:
Double-click the file JCLoginDialog.java in your
JClient project. The file opens in the Code Editor.
/*
String securityEnforceStr = ((String)((Hashtable)connEnvironment).get(PropertyMetadata.ENV_SECURITY_ENFORCE .pName));
if (securityEnforceStr == null || (securityEnforceStr != null && PropertyConstants.SECURITY_ENFORCE_NONE.equals(securityEnforceStr)))
{
return null;
}
*/
Press Ctrl+F to display the Find dialog in the Code Editor and perform this search and replace operation:
Change JboContext.SECURITY_PRINCIPAL to
Configuration.DB_USERNAME_PROPERTY.
Display the Find dialog again and perform another search and replace operation:
Change JboContext.SECURITY_CREDENTIALS to
Configuration.DB_PASSWORD_PROPERTY.
Note: These changes appear twice within the file: once where reading from the hash table and once when setting user name and password from the fields in the login dialog.
Save the changes to JCLoginDialog.java in your JClient
project.
If you deployed the password when you created your Business
Components project (the default), you need to change these settings.
Locate the bc4j.xcfg file in your Business Components
project and open it in the XML Editor.
With the bc4j.xcfg file open, remove these entries and
save the file:
<ENTRY name="DeployPassword" value="true"/>
and
<ENTRY name="password" value="mypassword"/>
You are now ready to run your JClient application. If you have a JDBC
connection that the bc4j.xcfg file names, the application
will invoke the dialog automatically.
Note, if your bc4j.xcfg file contains the user password,
the dialog will display more than one time. To avoid this, be sure to
remove the lines as describe in the above procedure.
About the JClient Login Dialog
Generating a JClient Login Dialog for JAAS
Copyright © 1997, 2004, Oracle. All rights reserved.