Database Reference
In-Depth Information
Listing 8-20. Alternative UCP Connection Pool Specification
cpool.setURL(appusrConnURL);
cpool.setUser(appusrConnUser);
cpool.setPassword(appusrConnPassword);
// Or
cpool.setURL("jdbc:oracle: thin :@localhost:1521:Orcl" );
cpool.setUser(appusrConnUser);
cpool.setPassword(appusrConnPassword);
One reason I very much prefer connection string syntax, including user name and password, is that I
can provide them all the connection details, including password, from a secure external source as a
single string. We will plumb the depths of this topic in Chapter 10 and Chapter 11. Providing connection
strings from a secure external source means that we can do the following:
Avoid embedding passwords in our application code.
Centralize the storage, maintenance, and distribution of our connection strings
(thereby allowing us to change the parameters of a connection string in one place
and have the change applied wherever we use the connection).
Get and Use the UCP Connection
This will look very familiar. We get a connection from the pool, get a proxy session and set the client
identifier exactly as we did for our non-UCP thin connection pool. The results are identical as well.
Summary of Universal Connection Pool
If you don't mind living a bit on the cutting edge, then UCP is the way to go. It will require you to watch
for updates to the UCP package, and eventual inclusion of UCP in the Oracle drivers, ojdbc6.jar . You will
also need to incorporate ucp.jar into your CLASSPATH (refer to Chapter 3). As far as our goal of Oracle SSO
is concerned, UCP works without a hitch.
Application Use of Oracle SSO
The presumptive requirement we are making in this chapter is that the user has authenticated on the
client. The goal we have in our code is to leverage that existing authentication and make it available to
application developers so that they can tap into Oracle SSO without burdening them with the inner
workings.
I'm going to implement only one of the five options for Oracle SSO that we've examined. We will
select a non-pooled connection with proxy sessio n (refer to the doTest2() method in OraSSOTests.java ).
If you want to implement non-proxy connections or pooled connections, you should be able to do that
easily enough based on the OraSSOTests.java code.
 
Search WWH ::




Custom Search