Add comment Notify me of follow-up comments. Comments 1 2 3. NOTE: As long as we put the ojdbc Why they don't supply ojdbc Refresh comments list. Thin Driver. When a node failure occurs, connection attempts can fail over to other nodes in the cluster, which assume the work of the failed node. When connection failover occurs and a service connection is redirected to another node, users can continue to access the service, unaware that it is now provided from a different node.
This document explains how you can take advantage of Oracle RAC features such as load balancing and connection failover using the DataDirect Connect for JDBC Oracle driver to connect your data critical applications to data. Connecting to an Oracle RAC system is similar to connecting to a single instance of an Oracle database. For example, the following URL establishes a connection to the database instance Accting In a RAC environment, multiple Oracle instances share the same physical data.
The specific instance that is connected to is determined by a number of factors, including which instances are available and the load on those instances. Typically, the application does not need to know which instance to which it is connected. DataDirect Connect ; for JDBC Oracle driver also supports retrieving specific connection information, including connection failover and client load balancing instructions, from a tnsnames.
In a tnsnames. The following example shows connection information in a tnsnames. Alternatively, DataDirect Connect for JDBC provides a way to enable connection failover and client load balancing through driver properties specified in a connection URL or data source. For example, the following connection URL enables both of these features:. Both connection failover and TAF provide a connection retry feature that allows a connection to be retried automatically until a connection with another RAC node is successfully re-established.
The primary difference between connection failover and TAF is that the former method provides protection for connections at connect time and the latter method provides protection for connections that have already been established. Also, because the state of the transaction must be stored at all times, TAF requires more processing overhead than connection failover.
Enabling connection failover allows a driver to attempt to connect on another node if the connection attempt on one node fails. When an application requests a connection to an Oracle database server via the driver, the driver does not connect to the database server directly.
Instead, the driver sends a connection request to a listener process, which forwards the request to the appropriate Oracle database instance. If the service name in the connection request specifies the RAC system database name, the requested listener selects one of the registered instances to forward the connection request to, based on the load each of the instances is experiencing. For example, if Instance A and B are operating under a heavy load, a connection request to Listener A results in the connection being forwarded to Instance C.
The type of the object returned is java. The following signature takes a URL, together with a properties object that specifies user name and password perhaps among other things :. For example:. Properties ; info. Use any of the below format to establish connection to the Oracle Database. In the above format, the parts that are enclosed in square brackets are optional. Specifying the protocol is optional and the default value is TCP.
The URL must contain at least one database host name. Multiple host names are separated by a comma. The host name is followed by an optional port number. If multiple hosts share the same port number then the port number can be specified at the end of the host names list.
The default port value is Host and port information is followed by the database service name which is in turn followed by the optional server mode and the database instance name. The supported server modes are dedicated shared pooled. The list of supported name value pairs are as follows. Other connection properties specified in oracle. OracleConnection can also be configured through EZConnect format. Please use the value of the connection property constant name declared in oracle.
OracleConnection for configuring the property. This is a descriptive format. OracleDriver oracle. To access a database from a Java application, you must first provide the code to register your installed driver with your program. You do this with the static registerDriver method of the java. DriverManager class. This class provides a basic service for managing a set of JDBC drivers.
The registerDriver method takes as input a "driver" class, that is, a class that implements the java. Driver interface, as is the case with OracleDriver. Note: Alternatively, you can use the forName method of the java.
0コメント