DataSources

Saturday, September 7, 2019

3:45 PM

The Java Database Connectivity (JDBC) API is standard for database-independent connectivity between the Java programming language and a wide range of databases.

 

The 12c version of the Oracle Thin driver is installed with Oracle WebLogic Server.

    ojdbc7.jar, ojdbc7_g.jar, and ojdbc7dms.jar for JDK7       and      ojdbc6.jar, ojdbc6_g.jar, and ojdbc6dms.jar for JDK 6

  • These drivers are installed in subdirectories of $ORACLE_HOME/oracle_common/modules.
  • The manifest in the weblogic.jar file directly or indirectly includes these files so they load automatically when the server starts.
  • Therefore, you do not need to add these JDBC drivers to your CLASSPATH.
  • For the Oracle driver, the default is to include ojdbc7.jar

 

TestConnectionsOnReserve="true" - If the connection fails the test, the multi DS uses a connection from the next DS listed in the multi DS

  • No Fail-Over for In-Use Connections
  • FailoverRequestIfBusy="true"  - routed to the next available data source

 

Generic DS:

  Generic data sources and their connection pools         #provide connection management processes that help keep your system running efficiently.

  You can set options in the data source to suit your applications and your environment.

 

GridLink DS:                           -- Oracle Notification Services , Fast Application Notification, Oracle Real Application Cluster

  Oracle RAC FAN feature provides a simplified API for accessing FAN events through a callback mechanism.

  This mechanism enables application code to receive a callback when a FAN event occurs.

 

    WebLogic JDBC data sources must use the Oracle JDBC Thin driver 11g to create database connections

    RAC: Scalability/ Availability/ Load balancing/ Failover

    For using Oracle RAC FAN:    simplefan.jar file must be present in the classpath, and either ons.jar file must be present in the classpath or

                                                                                                                                                                   ONS must be installed and running in the client system.

 

Multi DS:

  An abstraction around a            #group of generic data sources that provides load balancing or failover processing.

 

JDBC driver types:

 1.  JDBC-ODBC bridge driver - Odbc (open database connectivity) and jdbc (java databbase connectivity)

 2.  Native-API driver (partially java driver)

 3.  Network Protocol driver (middleware driver)

 4.  Thin driver (fully java driver)

 

#getConnection() and connection.close()

 

jdbc - init, min and max (how to handle overload state), netstat -anp | grep port(15221)

 

************************************

MySQL         URL format:         jdbc:mysql://<HOST>:<PORT>/<DATABASE_NAME>

Oracle (thin), 9i, and 10g                    URL format:       jdbc:oracle:thin@<HOST>:<PORT>:<DATABASE_NAME>

   Driver name:            oracle.jdbc.driver.OracleDriver

 

************************************

Setting the Environment for a Third-Party JDBC Driver:

1   -> Download the JDBC Driver.

            - Unpack the zip or tarball with the JDBC driver jar file and copy the specified file to the WebLogic installation directory, under the ${WL_HOME}/server/lib folder.

2   -> Now, modify the ${WL_HOME}/common/bin/commEnv.sh script and prepend your JAR file to the WEBLOGIC_CLASSPATH env variable.

            - This script sets common environment variables for WebLogic and set the WebLogic classpath with some base libraries from the WebLogic installation directory.

3   -> Edit the setDomainEnv.cmd/sh script in that domain's bin directory, and prepend the JAR file to the PRE_CLASSPATH env variable.

            - Your JAR must be located before any client JAR files.

4   -> To update this list modify the ${WL_HOME}/server/lib/jdbcdrivers.xml file accordingly, the description of the file is very explanatory.

 

************************************

         XA transactions  involves a coordinating transaction manager, with one or more databases (or other resources, like JMS) all involved in a single global tx

Non-XA transactions  have no transaction coordinator, and a single resource is doing all its transaction work itself (this is sometimes called local transactions)

 

         XA datasource   is a data source that can participate in an XA global transaction.

Non-XA datasource   can't participate in a global transaction

                                       (sort of - some people implement what's called a "last participant" optimization that can let you do this for exactly one non-XA item) 

 

Created with Microsoft OneNote 2016.