Database Reference
In-Depth Information
Listing 10-37. Find Existing Application Registry Entry
PROCEDURE p_count_class_conns(
m_class_name v_app_conn_registry.class_name%TYPE,
m_class_version v_app_conn_registry.class_version%TYPE,
m_count OUT NUMBER )
IS BEGIN
SELECT COUNT(*)
INTO m_count
FROM v_app_conn_registry
WHERE class_name = m_class_name
AND class_version = m_class_version;
END p_count_class_conns;
In hindsight, this was a good candidate for an Oracle stored function. It returns a single value. As a
procedure, we return a value through an OUT parameter.
Get the List of Connection Strings for a Registered Application
p_get_class_conns gets the application ID class and associated connsHash from v_app_conn_registry for
a specific class name and version number. This is shown in Listing 10-38. Not obviously, but again by
way of referring to m_connections as type v_app_conn_registry.connections% TYPE , we are handling this
column as its native type, a BLOB .
Listing 10-38. Get List of Connection Strings from Registry
PROCEDURE p_get_class_conns(
m_class_name v_app_conn_registry.class_name%TYPE,
m_class_version v_app_conn_registry.class_version%TYPE,
m_class_instance OUT v_app_conn_registry.class_instance%TYPE,
m_connections OUT v_app_conn_registry.connections%TYPE )
IS BEGIN
SELECT class_instance, connections
INTO m_class_instance, m_connections
FROM v_app_conn_registry
WHERE class_name = m_class_name
AND class_version = m_class_version;
END p_get_class_conns;
Get an Application Connection String: The Java Client Side
There are so many administrative tasks to address with this code that the practical application can be
too easily forgotten. We turn now to that practical application. A client application wants to do work
using Oracle database. The app uses our code to accomplish security—SSO, two-factor authentication
and encryption, along with good Oracle and Java secure programming practices.
To make this easy on the developer for that application, we give the developer just a bit of template
to follow to make all this happen. We have him do the following four things:
 
Search WWH ::




Custom Search