(HOST=CLOUD-SCANVIP.example.com)(PORT=5221))
(CONNECT_DATA=(SERVICE_NAME=ac-service)
(SERVER=POOLED)))";
PoolDataSource pds = PoolDataSourceFactory.getPoolDataSource();
pds.setConnectionFactoryClassName("oracle.jdbc.pool.OracleDataSource
");
// Set DataSource Property
pds.setUser("HR");
pds.setPassword("hr");
System.out.println ("Connecting to " + url);
pds.setURL(url);
pds.setConnectionPoolName("HR-Pool1");
pds.setMinPoolSize(2);
pds.setMaxPoolSize(3);
pds.setInitialPoolSize(2);
Properties prop = new Properties();
prop.put("oracle.jdbc.DRCPConnectionClass", "HR-Pool1");
pds.setConnectionProperties(prop);
...
Zero Downtime Java Checklist
• Use the Replay Datasource (oracle.jdbc.replay.OracleDataSourceImpl) of the Oracle
JDBC driver (see TAC section above); we are looking into removing such requirement in future
releases.
• Get the latest Oracle JDBC drivers and apply the recommended patches to support TAC/AC
3
.
• Use the recommended Java connect string with the appropriate values for CONNECT_TIMEOUT,
RETRY_COUNT, RETRY_DELAY and TRANSPORT_CONNECT_TIMEOUT to avoid that Java
applications time out when the database service is temporarily unavailable (for tens of seconds or
few minutes).
• Enable JDBC Statement Caching and disable the one in Java containers; this allows the driver to
identify statements that are closed at the end of the “request” and free up the memory
• Enable Fast Application Notification (FAN) by ensuring that simplefan.jar and ons.jar
are in the classpath
• Follow the steps for sustaining planned maintenance or unplanned outages, described hereafter.
Sustaining Planned Database Downtime
Planned outages of the database server are sometime required for OS or RDBMS patching, or
hardware upgrade. The Cloud or database administrators manage the schedule and the notification for
these outages. To shield Java applications from these outages, and ensure continuity, the Java
frameworks (driver, connection pools, containers) and the user Java code have to take a couple of
steps outlined hereafter.
CLOUD OR DATABASE ADMINISTRATORS STEPS
1. If the the database service is available only on a single system then, relocate it from the system to
be maintained to another one. The exact command is not the concern of Java developers.
• This action sends a “Planned Maintenance FAN event” notification to the JDBC driver
3
**DB19c JDBC bug fixes for TAC/AC: 29150338, 29195279, 29313347. **DB 18c JDBC bug fixes for TAC./AC: 27748210, 29313347, 28381686, 28504351.
**DB19c UCP bug fixes for TAC/AC: 27423500, 29128935. **DB 18c UCP bug fixes for TAC/AC: 27103398, 27290134, 27423500, 27479395, 29325356.
**Weblogic bug fixes for TAC/AC: 24919627, 26336757