ODBC, OCCI and JDBC overview

Slides:



Advertisements
Similar presentations
Connecting to Databases. relational databases tables and relations accessed using SQL database -specific functionality –transaction processing commit.
Advertisements

Copyright  Oracle Corporation, All rights reserved. 2 Java and Databases: An Overview.
Technical Architectures
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 13 Introduction to SQL Programming Techniques.
Distributed Application Development B. Ramamurthy.
1 C. Shahabi Application Programming for Relational Databases Cyrus Shahabi Computer Science Department University of Southern California
Integration case study Week 8 – Lecture 1. Enrolment request (Workstation) Application server Database server Database New University Student Record System.
JDBC. In This Class We Will Cover: What SQL is What ODBC is What JDBC is JDBC basics Introduction to advanced JDBC topics.
JAVA JDBC JAVA JDBC Java Database Programming Lamiaa Said.
Dale Roberts 8/24/ Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
Advance Computer Programming Java Database Connectivity (JDBC) – In order to connect a Java application to a database, you need to use a JDBC driver. –
Getting connected.  Java application calls the JDBC library.  JDBC loads a driver which talks to the database.  We can change database engines without.
JDBC Vs. Java Blend Presentation by Gopal Manchikanti Shivakumar Balasubramanyam.
CSCI 6962: Server-side Design and Programming
September 6, 2015 Connecting Client Applications to Informix Databases using IBM Informix Connect and ODBC James Edmiston Database Consultant Quest Information.
1 Java Database Connection (JDBC) There are many industrial-strength DBMS's commercially available in the market. Oracle, DB2, and Sybase are just a few.
Oracle8 JDBC Drivers Section 2. Common Features of Oracle JDBC Drivers The server-side and client-side Oracle JDBC drivers provide the same basic functionality.
Helena Pomezná, ciz034 St. skupina: L392 FEI, VŠB-TUO Ak. rok. 2002/2003 Download:
How to Configure Informix Connect and ODBC James Edmiston Informix DBA Consultant/Quest Information Systems, Inc. Informix User Forum 2005 Moving Forward.
Database Programming in Java Corresponds with Chapter 32, 33.
CIS 270—Application Development II Chapter 25—Accessing Databases with JDBC.
DATABASE PROGRAMMING Lecture on 16 – 05 – PREVIOUS LECTURE QUIZ: - Some students were very creative in transforming 2NF to 3NF. Excellent! - Some.
Designing and Developing WS B. Ramamurthy. Plans We will examine the resources available for development of JAX-WS based web services. We need an IDE,
JDBC Java and Databases. RHS – SOC 2 JDBC JDBC – Java DataBase Connectivity An API (i.e. a set of classes and methods), for working with databases in.
Advanced Programming Collage of Information Technology University of Palestine, Gaza Prepared by: Mahmoud Rafeek Alfarra Lecture12: Accessing Databases.
1 1 EPCC 2 Curtin Business School & Edinburgh University Management School Michael J. Jackson 1 Ashley D. Lloyd 2 Terence M. Sloan 1 Enabling Access to.
JDBC – Java DataBase Connectivity. JDBC API Overview JDBC is Java API that allows the Java programmers to access database management system from Java.
Accessing Database using JDBC. JDBC Objectives Gain basic knowledge of Java JDBC Become familiar with the basics of interacting with a database using.
Java Database Connectivity (JDBC). Topics 1. The Vendor Variation Problem 2. SQL and Versions of JDBC 3. Creating an ODBC Data Source 4. Simple Database.
Copyright © 2002 ProsoftTraining. All rights reserved. Building Database Client Applications Using JDBC 2.0.
JDBC Database Programming in Java Prepared by., Mrs.S.Amudha AP/SWE.
JDBC. Java.sql.package The java.sql package contains various interfaces and classes used by the JDBC API. This collection of interfaces and classes enable.
Session 30 Basics of JDBC. Java Simplified / Session 30 / 2 of 33 Review A Swing menu consists of a menubar, menuitems and menus. Trees are used to depict.
12/6/2015B.Ramamurthy1 Java Database Connectivity B.Ramamurthy.
JDBC
Java and Databases. JDBC Architecture Java Application JDBC API Data Base Drivers AccessSQL Server DB2InformixMySQLSybase.
UNIT III - JDBC JDBC Overview – JDBC implementation – Connection class – Statements - Catching Database Results, handling database Queries. Networking–
DATABASE CONNECTIVITY TO MYSQL. Introduction =>A real life application needs to manipulate data stored in a Database. =>A database is a collection of.
CSI 3125, Preliminaries, page 1 JDBC. CSI 3125, Preliminaries, page 2 JDBC JDBC stands for Java Database Connectivity, which is a standard Java API (application.
Access Databases from Java Programs via JDBC Tessema M. Mengistu Department of Computer Science Southern Illinois University Carbondale
Basics of JDBC Session 14.
JDBC Chapter 1 JDBC Introduction
JDBC - Java Database Connectivity. JDBC provides Java applications with access to most database systems via SQL The architecture and API closely resemble.
Ch. NoNameMarks 01AWT24 02Networking18 03JDBC20 04Swing18 05Servlet20 Advance Java Programming.
Introduction to JDBC Instructor: Mohamed Eltabakh 1.
JDBC Java and Databases. SWC – JDBC JDBC – Java DataBase Connectivity An API (i.e. a set of classes and methods), for working with databases in.
2) Database System Concepts and Architecture. Slide 2- 2 Outline Data Models and Their Categories Schemas, Instances, and States Three-Schema Architecture.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe.
JDBC. Database is used to store data permanently. These days almost all Applications needs database to store its data persistently. Below are the most.
ISC321 Database Systems I Chapter 2: Overview of Database Languages and Architectures Fall 2015 Dr. Abdullah Almutairi.
DEPTT. OF COMP. SC & APPLICATIONS
Interacting with Database
Chapter 9: The Client/Server Database Environment
JDBC Database Management Database connectivity
Web Technologies IT230 Dr Mohamed Habib.
Chapter 2 Database System Concepts and Architecture
HW#4 Making Simple BBS Using JDBC
The Client/Server Database Environment
Created by Kamila zhakupova
JDBC – Java DataBase Connectivity
Client Access, Queries, Stored Procedures, JDBC
Mr. Harish Sharma Asst. Professor Dept. of CA & IT SGRRITS Dehradun
Interacting with Database
Introduction to Databases Transparencies
Java Database Connectivity
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
JAVA DATABaSE CONNECTIVITY
ODBC and JDBC.
Database Management Systems
Java Chapter 6 (Estifanos Tilahun Mihret--Tech with Estif)
Presentation transcript:

ODBC, OCCI and JDBC overview Connection to Oracle ODBC, OCCI and JDBC overview

Outline: Oracle Call Interface (OCI) OCI Inhancement Oracle C++ Call Interface (OCCI) Open Database Connectivity (ODBC) Java Database Connectivity (JDBC) Accessibility. Consistency of access across database servers. Thin & OCI Drivers Example: Connecting to Oracle Sample Database Application: front-end back-end example

Oracle Call Interface (OCI) The primary means of accessing Oracle9i and Oracle 10g for that matter is via the Oracle Call Interface The Oracle Call Interface (OCI) is a C call interface to Oracle9i that gives developers the greatest degree of control over program execution and SQL processing Most other access methods, for example, ODBC and JDBC OCI driver, are all built on top of OCI.

OCI In Oracle9i, there have been a number of enhancements made to OCI, and higher level access methods, that increase developer productivity and application performance OCCI, an interface for C++ applications, now makes it easier for C++ developers to access the database and manipulate objects. JDBC enhancements improve efficiency and extend functionality for Java developers ODBC is developed by Microsoft

OCI Enhancements A number of enhancements to OCI improve performance and ease development of applications These enhancements include Cursors (scrollable) : used in Oracle to manage result sets from SQL operations Connection Pooling: applications can use connection pooling to make more efficient use of connections to the database

Oracle C++ Call Interface (OCCI) OCCI is a high-performance and scalable API for C++ built on top of OCI The OCCI API is modeled after JDBC, and uses simple JDBC-like constructs. OCCI takes full advantage of advances in the latest C++ language standard OCCI has an extensive collection of easy-to-use C++ classes and templates,

Oracle C++ Call Interface (OCCI) With an extensive collection of easy-to-use C++ classes and templates, OCCI enables a C++ program to: connect to a database execute SQL statements insert/update values in database tables retrieve results of a query execute stored procedures in the database and access the metadata of database schema objects

ODBC Open Database Connectivity is developed by Microsoft but used by most vendors. ODBC drivers are software products that form a database-specific link between the application and the database. ODBC drivers typically process the ODBC function calls at a low level They are responsible for moving SQL commands from the application to the database and moving results back from the database to the application.

ODBC The functions of the ODBC driver include Establishing the connection Client-cursor management Translation of commands and data formats to suit a particular database Error-code management

ODBC It is fairly common to use ODBC between Access front-end and Oracle database. The ODBC driver that comes with Visual Basic 6 is in the file MSORCL32.DLL. Note also the disadvantages of ODBC: It is controlled by Microsoft (it is not an open standard), so MS may choose to change it to fit their liking. Worse yet, it adds two communication layers which slow down communication. Finally, some users have experienced that many ODBC implementations add considerable delay (up to 30 seconds) every time the client asks for a new transaction.

Java Database Connectivity(JDBC) The Java DataBase Connectivity API is a set of classes allowing a straightforward and vendor-neutral access to database management systems. We will review the basic features of JDBC and their use with Oracle.

JDBC Overview Accessibility. Consistency of access across database servers. Thin & OCI Drivers Example: Connecting to Oracle Sample Database Application: front-end back-end example

JDBC: Accessibility. JDBC provides a set of high-level classes that enable anyone acquainted with SQL and Java to write database applications. Considerations like networking and database protocols are transparent to the application programmer. These are handled by classes within JDBC drivers.

JDBC: Consistency of access across database servers. To achieve this, JDBC specifications are agreed upon within the Java community--and each database vendor is then left to implement these specification to work with their product.

JDBC: Thin & OCI Drivers Oracle provides two main types of drivers. The OCI driver. The ``thin'' driver.

JDBC: The OCI driver. The OCI (type 2) driver consists of java wrappers to the low-level Oracle Call Interface (OCI) libraries used by utilities like SQL*Plus to access the database server. The OCI driver offers potentially better performance that the thin driver. It however requires the OCI libraries to be installed on the local machine.

JDBC: The ``thin'' driver. Also referred to as type 4 driver, the thin driver is a pure Java implementation of Oracle's networking protocol (Net8). Being self-contained, it may be used on any machine with--or without Oracle installed--or even distributed with application classes in an applet.

Example: Connecting to Oracle We will review below how to access Oracle using both types of driver. First, we use the thin driver to connect to Oracle and execute an update statement. Note that the example below is only intended as an illustration. Try to understand the code.

Example: Connecting to Oracle import java.io.*; import java.sql.*; public class OraThin { public static void main(String[ ] args{ try { Connection con=null; Class.forName("oracle.jdbc.driver.OracleDriver"); con=DriverManager.getConnection( "jdbc:oracle:thin:@machine_name:1521:database_name", "scott", "tiger"); Statement s=con.createStatement(); s.execute(" INSERT INTO BOOKS VALUES ( 'A Tale of Two Cities', 'William Shakespeare', 4567891231, '5-JAN-1962' ) "); s.close(); con.close(); } catch(Exception e){ e.printStackTrace();}

Example: Connecting to Oracle The package java.sql containing the JDBC classes is imported. The class OracleDriver, in the package oracle.jdbc.driver is dynamically loaded into the Java runtime using Class.forName(...). A connection is requested to the database corresponding to the connection URL with the statement DriverManager.getConnection(...). scott/tiger is an Oracle user/password. We use instances of the Connection and Statement classes to perform a database operation. The resources hold by these are released using their close() method.

Example: Connecting to Oracle If we want use the OCI driver, the JDBC connection URL above needs to be altered. The only element now required is the service name of the database: database_name. The remainder is resolved using the local Oracle configuration file. DriverManager.getConnection( "jdbc:oracle:oci8:@database_name", "scott","tiger");