Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 

 

 

JDBC Connectivity

Oracle RAC Cluster Tips by Burleson Consulting

This is an excerpt from the bestselling book Oracle Grid & Real Application Clusters.  To get immediate access to the code depot of working RAC scripts, buy it directly from the publisher and save more than 30%.


JDBC is a database access protocol that enables the DBA to connect to a database and prepare and execute SQL statements against the database. Core Java class libraries provide only one JDBC API. JDBC is designed, however, to allow vendors to supply drivers that offer the necessary specialization for a particular database.

Oracle delivers the three distinct JDBC drivers: JDBC Thin Driver; JDBC OCI Driver; and JDBC Server-side Internal Driver (KPRB driver).

JDBC Thin Driver

The Oracle JDBC Thin driver is classified as a 100% pure Java, Type IV driver. This means that it is used primarily for Oracle JDBC applets, but it can, of course, be used for other applications as well. Since the driver is written entirely in Java, it is platform independent. No additional Oracle software is required on the client side. Thin driver communication with the server via TTC, a special protocol developed by Oracle Corporation to access the Oracle Database.

The JDBC Thin driver gives the user process a direct connection to Oracle by implementing a form of TCP/IP imitating Oracle Net and TTC on top of Java sockets. These protocols are both lightweight versions of their server counterparts. A limitation is that the Oracle Net protocol runs only over a TCP/IP type connection.

tnsnames entries are not used to identify services since the JDBC Thin driver can only be used in applets that do not depend on an Oracle client installation, therefore one of the following must be done:

* Explicitly define the host name, TCP/IP port, and Oracle SID of the database to which the connection is desired.

* Use a keyword-value pair list.

For example, the following string should be used if the database is to connect on the host aultlinux2, which utilizes a TCP/IP listener on port 1521, for the database system identifier (SID) ault1. Using the user appowner with the password of f514:

Connection conn = DriverManager.getConnection
("jdbc:oracle:thin:@aultlinux2:1521:ault1", "appowner", "f514");

As stated above, the database can alternatively be specified with an Oracle Net keyword-value pair. This may be less readable than the explicit definition, but it has the strength of also working with other JDBC drivers.

Connection conn = DriverManager.getConnection
("jdbc:oracle:thin:@(description=(address=(host=aullinux2)
(protocol=tcp)(port=1521))(connect_data=(INSTANCE_NAME=ault1)))", "appowner", "f514");

If it is not possible to use a tnsnames entry, then it is not possible to take advantage of the transparent application failover (TAF) facility to provide virtually uninterrupted access the Oracle RAC database. The good news is that the JDBC OCI driver will allow the full utilization of the functionality of TAF.

JDBC Oracle Call Interface Driver

There is also the Type II JDBC OCI driver for use with Oracle-based client-server Java applications. The disadvantage to this driver is that it requires an Oracle client installation, so it is not suitable for applets.

The advantage to this Type II JDBC OCI driver is that it accesses Oracle-specific, non-Java, native code libraries on either the client or middle tier, thus providing a more complete set of functions, and better performance.

Another advantage in the use of the JDBC OCI driver is that it allows the tnsnames entries to be utilized. Therefore, it can be used with the full capabilities of the Oracle TAF configuration including automatic failover, connection failover and load balancing.

When the JDBC OCI driver is used, the database is specified using an Oracle Net keyword-value pair, this keyword pair replaces the tnsnames entry. The following is the example from before, but in the JDBC OCI keyword-value format:

Connection conn = DriverManager.getConnection
(jdbc:oracle:oci:@ault1","appowner","f514");

JDBC Server-Side Internal Driver

On the server side, the Oracle JDBC internal driver will support any Java code that can run inside an Oracle database. Examples include Java stored procedures or Enterprise JavaBeans. The Java Virtual Machine (JVM) can communicate directly with the SQL engine using this driver.

The middleware software layers now handle connectivity to the backend Oracle database. The following section will show how some of the popular application servers handle database connectivity and utilize the RAC database.

 


This is an excerpt from the bestselling book Oracle Grid & Real Application Clusters, Rampant TechPress, by Mike Ault and Madhu Tumma.

You can buy it direct from the publisher for 30%-off and get instant access to the code depot of Oracle tuning scripts.

http://www.rampant-books.com/book_2004_1_10g_grid.htm


 

 
��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2017

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

Remote Emergency Support provided by Conversational