Database Reference
In-Depth Information
Wouldn't you know it, these are the two methods we are calling to enable and configure our connection
pool (cache)!?! Why are they deprecated? Even with those warnings, the code will still compile correctly
and will run just fine. It is rare, in my experience, that a deprecated method actually disappears—
sometimes they are actually revived. Fear not!
These methods are only recently deprecated, and I suspect the reason is that Oracle has developed a new
package to do thin-client connection pooling, universal connection pool (UCP). We will implement UCP later
in this chapter.
We can keep these deprecation warnings from bothering us when we compile by placing a
@SuppressWarnings annotation on the method with our deprecated calls as shown below. Notice that
there is no semicolon at the end of the annotation; it applies to the following method, doTest4() .
@SuppressWarnings("deprecation")
void doTest4() {
Annotations are not part of the Java syntax, but they are included in the Java code and the byte code (after
compilation) in order to instruct the Java utilities and tools (like java.exe and javac.exe ). The variety of uses
of annotations are quite numerous, and you can extend them by defining your own annotation types and by
writing Java code for use by the Java tools in responding to annotations.
Many annotations like this are not acceptable to the Oracle JVM, so we will comment them in our code
before creating the Java structures in Oracle Database.
Summary of the Thin Client Connection Pool
Thin client connection pooling is quick and convenient. It supports our approach to SSO by proxy and
by client identifier.
It is a little disturbing to see the key methods used for connection pooling being labeled as
“deprecated.” But that is not a roadblock.
Universal Connection Pool
UCP is the newest kid on the block for connection pooling. Because it is so new, it would behoove you to
watch for and implement any updates to UCP.
Note Find the test code for UCP in the file named Chapter8/OraSSOTests2.java.
Compile/Run with UCP
As yet, the UCP package has not been incorporated into the Oracle drivers jar (ojdbc6.jar). You will need
to download a separate ucp.jar file from Oracle at www.oracle.com/technetwork/indexes/downloads .
Scroll down and find the file in the [Drivers] section.
 
 
Search WWH ::




Custom Search