Database Reference
In-Depth Information
stmt = conn.createStatement();
rs = stmt.executeQuery(
"SELECT DISTINCT p.proxy, p.client FROM ojsaadm.instance_proxy_users p " +
"WHERE p.instance <> 'APVER' " +
"AND p.proxy NOT IN ('APPVER','AVADMIN','APPSEC','OJSAADM') " +
"ORDER BY p.proxy");
Vector
dataVector = userProxiesTM.getDataVector()
;
Vector itemVector;
String proxyID;
while (rs.next()) {
if (rs.getString(2).equals(userID))
{
proxyID = rs.getString(1);
itemVector = new Vector();
itemVector.add(proxyID)
;
if (dataVector.contains(itemVector))
{
//System.out.println("retaining proxy to: " + proxyID);
dataVector.remove(itemVector)
;
} else {
//System.out.println("removing proxy to: " + proxyID);
stmt2 = (OracleCallableStatement)conn.prepareCall(
"CALL sys.usr_role_adm_pkg.
p_drop_proxy_through
(?,?)");
stmt2.setString(1, userID);
stmt2.setString(2, proxyID);
stmt2.executeUpdate();
if (stmt2 != null) stmt2.close();
}
}
}
if (rs != null)
rs.close();
for (Object element : dataVector)
{
itemVector = (Vector)element;
proxyID = (String)itemVector.get(0);
//System.out.println("adding proxy to: " + proxyID);
stmt2 = (OracleCallableStatement)conn.prepareCall(
"CALL sys.usr_role_adm_pkg.
p_set_proxy_through
(?,?)");
stmt2.setString(1, userID);
stmt2.setString(2, proxyID);
stmt2.executeUpdate();
if (stmt2 != null) stmt2.close();
}
...
Application Registration Screen
Next on our Security Administration agenda, and the target of the next button on the
OJSAdmin
menu, is
the Register New Application functional screen. We have a couple applications registered so far:
HRVIEW
and this application,
OJSADMIN
, if you have run some of the SQL in this chapter. You can see the list of
fields required for registering a new application on Figure 12-6.