SlideShare a Scribd company logo
JDBC




       http://www.java2all.com
Chapter 1



JDBC Introduction



                    http://www.java2all.com
Introduction to JDBC



                   http://www.java2all.com
JDBC - Java Database Connectivity.
    JDBC provides API or Protocol to interact
with different databases.
    With the help of JDBC driver we can
connect with different types of databases.
    Driver is must needed for connection
establishment with any database.
    A driver works as an interface between the
client and a database server.



                                      http://www.java2all.com
JDBC have so many classes and interfaces
that allow a java application to send request
made by user to any specific DBMS(Data Base
Management System).

     JDBC supports a wide level of portability.
JDBC provides interfaces that are compatible
with java application
                                       http://www.java2all.com
components and specification of JDBC:




                               http://www.java2all.com
Components of JDBC:

      JDBC has four main components as under and
with the help of these components java application can
connect with database.
      The JDBC API - it provides various methods
and interfaces for easy communication with database.
      The JDBC DriverManager - it loads database
specific drivers in an application to establish
connection with database.
      The JDBC test suite - it will be used to test an
operation being performed by JDBC drivers.
      The JDBC-ODBC bridge - it connects database
drivers to the database.                        http://www.java2all.com
JDBC Specification:

      Different version of JDBC has different
specification as under.
      JDBC 1.0 - it provides basic functionality of
JDBC.
      JDBC 2.0 - it provides JDBC API(JDBC 2.0
Core API and JDBC 2.0 Optional Package API).
      JDBC 3.0 - it provides classes and interfaces in
two packages(java.sql and javax.sql).
      JDBC 4.0 - it provides so many extra features
like Auto loading of the driver interface.
      Connection management.
      ROWID data type support.               http://www.java2all.com
Enhanced support for large object like
BLOB(Binary Large Object) and CLOB(Character
Large Object).




                                     http://www.java2all.com
JDBC Architecture:
     As we all know now that driver is required to
communicate with database.
     JDBC API provides classes and interfaces to
handle request made by user and response made by
database.
Some of the important JDBC API are as under.

DriverManager                   Driver
Connection                      Statement
PreparedStatement               CallableStatement
ResultSet                       DatabaseMetaData
ResultSetMetaData
                                           http://www.java2all.com
Here The DriverManager plays an important role
in JDBC architecture.
     It uses some database specific drivers to
communicate our J2EE application to database.




                                         http://www.java2all.com
As per the diagram first of all we have to
program our application with JDBC API.

      With the help of DriverManager class than
we connect to a specific database with the help of
spcific database driver.

    Java drivers require some library to
communicate with the database.

      We have four different types of java drivers.
We will learn all that four drivers with
architecture in next chapter.
                                             http://www.java2all.com
Some drivers are pure java drivers and some are
partial.

    So with this kind of JDBC architecture we can
communicate with specific database.

      We will learn programmatically all this thing in
further chapter.




                                             http://www.java2all.com
JDBC Driver Types:




                     http://www.java2all.com
There are four categories of drivers by which
developer can apply a connection between Client (The
JAVA application or an applet) to a DBMS.

       (1) Type 1 Driver : JDBC-ODBC Bridge.

      (2) Type 2 Driver : Native-API Driver (Partly
Java driver).

      (3) Type 3 Driver : Network-Protocol Driver
(Pure Java driver for database Middleware).

      (4) Type 4 Driver : Native-Protocol Driver
(Pure Java driver directly connected to database).
                                             http://www.java2all.com
(1)     Type 1 Driver: JDBC-ODBC Bridge :-

      The JDBC type 1 driver which is also known as
a JDBC-ODBC Bridge is a convert JDBC methods
into ODBC function calls.
      Sun provides a JDBC-ODBC Bridge driver by
“sun.jdbc.odbc.JdbcOdbcDriver”.

      The driver is a platform dependent because it
uses ODBC which is depends on native libraries of the
operating system and also the driver needs other
installation for example, ODBC must be installed on
the computer and the database must support ODBC
driver.                                      http://www.java2all.com
Type 1 is the simplest compare to all other driver
but it’s a platform specific i.e. only on Microsoft
platform.

      The JDBC-ODBC Bridge is use only when there
is no PURE-JAVA driver available for a particular
database.



           Architecture Diagram:


                                              http://www.java2all.com
http://www.java2all.com
Process:

     Java Application → JDBC APIs → JDBC
Driver Manager → Type 1 Driver → ODBC
Driver → Database library APIs → Database

Advantage:

     (1) Connect to almost any database on any
system, for which ODBC driver is installed.

     (2) It’s an easy for installation as well as
easy(simplest) to use as compare the all other driver.
                                              http://www.java2all.com
Disadvantage:

      (1) The ODBC Driver needs to be installed on
the client machine.

      (2) It’s a not a purely platform independent
because its use ODBC which is depends on native
libraries of the operating system on client machine.

      (3) Not suitable for applets because the ODBC
driver needs to be installed on the client machine.


                                             http://www.java2all.com
(2) Type 2 Driver: Native-API Driver (Partly Java
driver) :-

      The JDBC type 2 driver is uses the libraries of
the database which is available at client side and this
driver converts the JDBC method calls into native
calls of the database so this driver is also known as a
Native-API driver.


           Architecture Diagram :


                                              http://www.java2all.com
http://www.java2all.com
Process:

     Java Application → JDBC APIs → JDBC
Driver Manager → Type 2 Driver → Vendor
Client Database library APIs → Database

Advantage:

     (1) There is no implantation of JDBC-ODBC
Bridge so it’s faster than a type 1 driver; hence the
performance is better as compare the type 1 driver
(JDBC-ODBC Bridge).

                                             http://www.java2all.com
Disadvantage:

      (1) On the client machine require the extra
installation because this driver uses the vendor client
libraries.

      (2) The Client side software needed so cannot
use such type of driver in the web-based application.

      (3) Not all databases have the client side
library.

     (4) This driver supports all JAVA applications
except applets.                           http://www.java2all.com
(3) Type 3 Driver: Network-Protocol Driver (Pure
Java driver for database Middleware) :-

      The JDBC type 3 driver uses the middle
tier(application server) between the calling program
and the database and this middle tier converts JDBC
method calls into the vendor specific database
protocol and the same driver can be used for multiple
databases also so it’s also known as a Network-
Protocol driver as well as a JAVA driver for database
middleware.


           Architecture Diagram:            http://www.java2all.com
http://www.java2all.com
Process:

     Java Application → JDBC APIs → JDBC
Driver Manager → Type 3 Driver → Middleware
(Server)→ any Database

Advantage:
      (1) There is no need for the vendor database
library on the client machine because the middleware
is database independent and it communicates with
client.
      (2) Type 3 driver can be used in any web
application as well as on internet also because there is
no any software require at client side.       http://www.java2all.com
(3) A single driver can handle any database at
client side so there is no need a separate driver for
each database.
      (4) The middleware server can also provide the
typical services such as connections, auditing, load
balancing, logging etc.

Disadvantage:

      (1) An Extra layer added, may be time
consuming.
      (2) At the middleware develop the database
specific coding, may be increase complexity.
                                             http://www.java2all.com
(4) Type 4 Driver: Native-Protocol Driver (Pure
Java driver directly connected to database) :-

      The JDBC type 4 driver converts JDBC method
calls directly into the vendor specific database
protocol and in between do not need to be converted
any other formatted system so this is the fastest way to
communicate quires to DBMS and it is completely
written in JAVA because of that this is also known as
the “direct to database Pure JAVA driver”.


           Architecture Diagram:
                                              http://www.java2all.com
http://www.java2all.com
Process:

     Java Application → JDBC APIs → JDBC
Driver Manager → Type 4 Driver (Pure JAVA
Driver) → Database Server

Advantage:
      (1) It’s a 100% pure JAVA Driver so it’s a
platform independence.
      (2) No translation or middleware layers are
used so consider as a faster than other drivers.
      (3) The all process of the application-to-
database connection can manage by JVM so the
debugging is also managed easily.              http://www.java2all.com
Disadvantage:

     (1) There is a separate driver needed for each
database at the client side.

     (2) Drivers are Database dependent, as different
database vendors use different network protocols.




                                             http://www.java2all.com

More Related Content

What's hot

Java Servlets
Java ServletsJava Servlets
Java Servlets
BG Java EE Course
 
Applets
AppletsApplets
Servlet and servlet life cycle
Servlet and servlet life cycleServlet and servlet life cycle
Servlet and servlet life cycle
Dhruvin Nakrani
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Ravi Teja
 
STRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIESSTRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIES
VENNILAV6
 
Types of Drivers in JDBC
Types of Drivers in JDBCTypes of Drivers in JDBC
Types of Drivers in JDBC
Hemant Sharma
 
Event Handling in java
Event Handling in javaEvent Handling in java
Event Handling in java
Google
 
JDBC,Types of JDBC,Resultset, statements,PreparedStatement,CallableStatements...
JDBC,Types of JDBC,Resultset, statements,PreparedStatement,CallableStatements...JDBC,Types of JDBC,Resultset, statements,PreparedStatement,CallableStatements...
JDBC,Types of JDBC,Resultset, statements,PreparedStatement,CallableStatements...
Pallepati Vasavi
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management System
Janki Shah
 
Java-java virtual machine
Java-java virtual machineJava-java virtual machine
Java-java virtual machine
Surbhi Panhalkar
 
JAVA FEATURES
JAVA FEATURESJAVA FEATURES
JAVA FEATURES
shalinikarunakaran1
 
View of data DBMS
View of data DBMSView of data DBMS
View of data DBMS
Rahul Narang
 
MULTI THREADING IN JAVA
MULTI THREADING IN JAVAMULTI THREADING IN JAVA
MULTI THREADING IN JAVA
VINOTH R
 
Jsp ppt
Jsp pptJsp ppt
Jsp ppt
Vikas Jagtap
 
Threads in JAVA
Threads in JAVAThreads in JAVA
Java threads
Java threadsJava threads
Java threads
Prabhakaran V M
 
java Jdbc
java Jdbc java Jdbc
java Jdbc
Ankit Desai
 

What's hot (20)

Java Servlets
Java ServletsJava Servlets
Java Servlets
 
Applets
AppletsApplets
Applets
 
JVM
JVMJVM
JVM
 
Servlet and servlet life cycle
Servlet and servlet life cycleServlet and servlet life cycle
Servlet and servlet life cycle
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
STRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIESSTRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIES
 
Types of Drivers in JDBC
Types of Drivers in JDBCTypes of Drivers in JDBC
Types of Drivers in JDBC
 
Jdbc
JdbcJdbc
Jdbc
 
Event Handling in java
Event Handling in javaEvent Handling in java
Event Handling in java
 
JDBC,Types of JDBC,Resultset, statements,PreparedStatement,CallableStatements...
JDBC,Types of JDBC,Resultset, statements,PreparedStatement,CallableStatements...JDBC,Types of JDBC,Resultset, statements,PreparedStatement,CallableStatements...
JDBC,Types of JDBC,Resultset, statements,PreparedStatement,CallableStatements...
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management System
 
Java-java virtual machine
Java-java virtual machineJava-java virtual machine
Java-java virtual machine
 
JAVA FEATURES
JAVA FEATURESJAVA FEATURES
JAVA FEATURES
 
View of data DBMS
View of data DBMSView of data DBMS
View of data DBMS
 
MULTI THREADING IN JAVA
MULTI THREADING IN JAVAMULTI THREADING IN JAVA
MULTI THREADING IN JAVA
 
Jsp ppt
Jsp pptJsp ppt
Jsp ppt
 
Jdbc Ppt
Jdbc PptJdbc Ppt
Jdbc Ppt
 
Threads in JAVA
Threads in JAVAThreads in JAVA
Threads in JAVA
 
Java threads
Java threadsJava threads
Java threads
 
java Jdbc
java Jdbc java Jdbc
java Jdbc
 

Similar to Jdbc architecture and driver types ppt

JDBC java database connectivity with dbms
JDBC java database connectivity with dbmsJDBC java database connectivity with dbms
JDBC java database connectivity with dbms
KhyalNayak
 
Jdbc driver types
Jdbc driver typesJdbc driver types
Jdbc driver types
Soham Kansodaria
 
Jdbc
JdbcJdbc
Jdbc
JdbcJdbc
Unit 5-jdbc2
Unit 5-jdbc2Unit 5-jdbc2
Unit 5-jdbc2
msafad
 
Advanced JAVA
Advanced JAVAAdvanced JAVA
Advanced JAVA
Rajvi Vaghasiya
 
Jdbc drivers
Jdbc driversJdbc drivers
Jdbc drivers
Saurabh Bhartiya
 
JDBC Driver Types
JDBC Driver TypesJDBC Driver Types
JDBC Driver Types
Rahul Sharma
 
Chapter_4_-_JDBC[1].pptx
Chapter_4_-_JDBC[1].pptxChapter_4_-_JDBC[1].pptx
Chapter_4_-_JDBC[1].pptx
BachaSirata
 
java.pptx
java.pptxjava.pptx
java.pptx
bfgd1
 
jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx
 jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx
jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx
ujjwalmatoliya
 
chapter 5 java.pptx
chapter 5  java.pptxchapter 5  java.pptx
chapter 5 java.pptx
BekiTube
 
Jdbc complete
Jdbc completeJdbc complete
Jdbc complete
Sandeep Rawat
 

Similar to Jdbc architecture and driver types ppt (20)

JDBC java database connectivity with dbms
JDBC java database connectivity with dbmsJDBC java database connectivity with dbms
JDBC java database connectivity with dbms
 
jdbc document
jdbc documentjdbc document
jdbc document
 
Jdbc driver types
Jdbc driver typesJdbc driver types
Jdbc driver types
 
Jdbc
JdbcJdbc
Jdbc
 
Jdbc
JdbcJdbc
Jdbc
 
Unit 5-jdbc2
Unit 5-jdbc2Unit 5-jdbc2
Unit 5-jdbc2
 
Advanced JAVA
Advanced JAVAAdvanced JAVA
Advanced JAVA
 
Jdbc 1
Jdbc 1Jdbc 1
Jdbc 1
 
Jdbc drivers
Jdbc driversJdbc drivers
Jdbc drivers
 
Jdbc
JdbcJdbc
Jdbc
 
JDBC Driver Types
JDBC Driver TypesJDBC Driver Types
JDBC Driver Types
 
Jdbc driver types
Jdbc driver typesJdbc driver types
Jdbc driver types
 
Chapter_4_-_JDBC[1].pptx
Chapter_4_-_JDBC[1].pptxChapter_4_-_JDBC[1].pptx
Chapter_4_-_JDBC[1].pptx
 
Chapter2 j2ee
Chapter2 j2eeChapter2 j2ee
Chapter2 j2ee
 
java.pptx
java.pptxjava.pptx
java.pptx
 
jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx
 jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx
jdbc Java Database Connectivity ujjwal matoliya jdbc.pptx
 
Jdbc introduction
Jdbc introductionJdbc introduction
Jdbc introduction
 
chapter 5 java.pptx
chapter 5  java.pptxchapter 5  java.pptx
chapter 5 java.pptx
 
jdbc
jdbcjdbc
jdbc
 
Jdbc complete
Jdbc completeJdbc complete
Jdbc complete
 

More from kamal kotecha

Java Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and ExampleJava Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and Example
kamal kotecha
 
Network programming in java - PPT
Network programming in java - PPTNetwork programming in java - PPT
Network programming in java - PPT
kamal kotecha
 
Java servlet life cycle - methods ppt
Java servlet life cycle - methods pptJava servlet life cycle - methods ppt
Java servlet life cycle - methods ppt
kamal kotecha
 
Java rmi example program with code
Java rmi example program with codeJava rmi example program with code
Java rmi example program with codekamal kotecha
 
Java rmi
Java rmiJava rmi
Java rmi
kamal kotecha
 
Jdbc example program with access and MySql
Jdbc example program with access and MySqlJdbc example program with access and MySql
Jdbc example program with access and MySql
kamal kotecha
 
Jdbc api
Jdbc apiJdbc api
Jdbc api
kamal kotecha
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handling
kamal kotecha
 
JSP Error handling
JSP Error handlingJSP Error handling
JSP Error handling
kamal kotecha
 
Jsp element
Jsp elementJsp element
Jsp element
kamal kotecha
 
Jsp chapter 1
Jsp chapter 1Jsp chapter 1
Jsp chapter 1
kamal kotecha
 
String and string buffer
String and string bufferString and string buffer
String and string bufferkamal kotecha
 
Wrapper class
Wrapper classWrapper class
Wrapper class
kamal kotecha
 
Packages and inbuilt classes of java
Packages and inbuilt classes of javaPackages and inbuilt classes of java
Packages and inbuilt classes of java
kamal kotecha
 
Interface
InterfaceInterface
Interface
kamal kotecha
 
Inheritance chepter 7
Inheritance chepter 7Inheritance chepter 7
Inheritance chepter 7
kamal kotecha
 
Class method
Class methodClass method
Class method
kamal kotecha
 
Introduction to class in java
Introduction to class in javaIntroduction to class in java
Introduction to class in java
kamal kotecha
 
Jsp myeclipse
Jsp myeclipseJsp myeclipse
Jsp myeclipse
kamal kotecha
 

More from kamal kotecha (20)

Java Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and ExampleJava Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and Example
 
Network programming in java - PPT
Network programming in java - PPTNetwork programming in java - PPT
Network programming in java - PPT
 
Java servlet life cycle - methods ppt
Java servlet life cycle - methods pptJava servlet life cycle - methods ppt
Java servlet life cycle - methods ppt
 
Java rmi example program with code
Java rmi example program with codeJava rmi example program with code
Java rmi example program with code
 
Java rmi
Java rmiJava rmi
Java rmi
 
Jdbc example program with access and MySql
Jdbc example program with access and MySqlJdbc example program with access and MySql
Jdbc example program with access and MySql
 
Jdbc api
Jdbc apiJdbc api
Jdbc api
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handling
 
JSP Error handling
JSP Error handlingJSP Error handling
JSP Error handling
 
Jsp element
Jsp elementJsp element
Jsp element
 
Jsp chapter 1
Jsp chapter 1Jsp chapter 1
Jsp chapter 1
 
String and string buffer
String and string bufferString and string buffer
String and string buffer
 
Wrapper class
Wrapper classWrapper class
Wrapper class
 
Packages and inbuilt classes of java
Packages and inbuilt classes of javaPackages and inbuilt classes of java
Packages and inbuilt classes of java
 
Interface
InterfaceInterface
Interface
 
Inheritance chepter 7
Inheritance chepter 7Inheritance chepter 7
Inheritance chepter 7
 
Class method
Class methodClass method
Class method
 
Introduction to class in java
Introduction to class in javaIntroduction to class in java
Introduction to class in java
 
Control statements
Control statementsControl statements
Control statements
 
Jsp myeclipse
Jsp myeclipseJsp myeclipse
Jsp myeclipse
 

Recently uploaded

Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
Col Mukteshwar Prasad
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
bennyroshan06
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 

Recently uploaded (20)

Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
 

Jdbc architecture and driver types ppt

  • 1. JDBC http://www.java2all.com
  • 2. Chapter 1 JDBC Introduction http://www.java2all.com
  • 3. Introduction to JDBC http://www.java2all.com
  • 4. JDBC - Java Database Connectivity. JDBC provides API or Protocol to interact with different databases. With the help of JDBC driver we can connect with different types of databases. Driver is must needed for connection establishment with any database. A driver works as an interface between the client and a database server. http://www.java2all.com
  • 5. JDBC have so many classes and interfaces that allow a java application to send request made by user to any specific DBMS(Data Base Management System). JDBC supports a wide level of portability. JDBC provides interfaces that are compatible with java application http://www.java2all.com
  • 6. components and specification of JDBC: http://www.java2all.com
  • 7. Components of JDBC: JDBC has four main components as under and with the help of these components java application can connect with database. The JDBC API - it provides various methods and interfaces for easy communication with database. The JDBC DriverManager - it loads database specific drivers in an application to establish connection with database. The JDBC test suite - it will be used to test an operation being performed by JDBC drivers. The JDBC-ODBC bridge - it connects database drivers to the database. http://www.java2all.com
  • 8. JDBC Specification: Different version of JDBC has different specification as under. JDBC 1.0 - it provides basic functionality of JDBC. JDBC 2.0 - it provides JDBC API(JDBC 2.0 Core API and JDBC 2.0 Optional Package API). JDBC 3.0 - it provides classes and interfaces in two packages(java.sql and javax.sql). JDBC 4.0 - it provides so many extra features like Auto loading of the driver interface. Connection management. ROWID data type support. http://www.java2all.com
  • 9. Enhanced support for large object like BLOB(Binary Large Object) and CLOB(Character Large Object). http://www.java2all.com
  • 10. JDBC Architecture: As we all know now that driver is required to communicate with database. JDBC API provides classes and interfaces to handle request made by user and response made by database. Some of the important JDBC API are as under. DriverManager Driver Connection Statement PreparedStatement CallableStatement ResultSet DatabaseMetaData ResultSetMetaData http://www.java2all.com
  • 11. Here The DriverManager plays an important role in JDBC architecture. It uses some database specific drivers to communicate our J2EE application to database. http://www.java2all.com
  • 12. As per the diagram first of all we have to program our application with JDBC API. With the help of DriverManager class than we connect to a specific database with the help of spcific database driver. Java drivers require some library to communicate with the database. We have four different types of java drivers. We will learn all that four drivers with architecture in next chapter. http://www.java2all.com
  • 13. Some drivers are pure java drivers and some are partial. So with this kind of JDBC architecture we can communicate with specific database. We will learn programmatically all this thing in further chapter. http://www.java2all.com
  • 14. JDBC Driver Types: http://www.java2all.com
  • 15. There are four categories of drivers by which developer can apply a connection between Client (The JAVA application or an applet) to a DBMS. (1) Type 1 Driver : JDBC-ODBC Bridge. (2) Type 2 Driver : Native-API Driver (Partly Java driver). (3) Type 3 Driver : Network-Protocol Driver (Pure Java driver for database Middleware). (4) Type 4 Driver : Native-Protocol Driver (Pure Java driver directly connected to database). http://www.java2all.com
  • 16. (1) Type 1 Driver: JDBC-ODBC Bridge :- The JDBC type 1 driver which is also known as a JDBC-ODBC Bridge is a convert JDBC methods into ODBC function calls. Sun provides a JDBC-ODBC Bridge driver by “sun.jdbc.odbc.JdbcOdbcDriver”. The driver is a platform dependent because it uses ODBC which is depends on native libraries of the operating system and also the driver needs other installation for example, ODBC must be installed on the computer and the database must support ODBC driver. http://www.java2all.com
  • 17. Type 1 is the simplest compare to all other driver but it’s a platform specific i.e. only on Microsoft platform. The JDBC-ODBC Bridge is use only when there is no PURE-JAVA driver available for a particular database. Architecture Diagram: http://www.java2all.com
  • 19. Process: Java Application → JDBC APIs → JDBC Driver Manager → Type 1 Driver → ODBC Driver → Database library APIs → Database Advantage: (1) Connect to almost any database on any system, for which ODBC driver is installed. (2) It’s an easy for installation as well as easy(simplest) to use as compare the all other driver. http://www.java2all.com
  • 20. Disadvantage: (1) The ODBC Driver needs to be installed on the client machine. (2) It’s a not a purely platform independent because its use ODBC which is depends on native libraries of the operating system on client machine. (3) Not suitable for applets because the ODBC driver needs to be installed on the client machine. http://www.java2all.com
  • 21. (2) Type 2 Driver: Native-API Driver (Partly Java driver) :- The JDBC type 2 driver is uses the libraries of the database which is available at client side and this driver converts the JDBC method calls into native calls of the database so this driver is also known as a Native-API driver. Architecture Diagram : http://www.java2all.com
  • 23. Process: Java Application → JDBC APIs → JDBC Driver Manager → Type 2 Driver → Vendor Client Database library APIs → Database Advantage: (1) There is no implantation of JDBC-ODBC Bridge so it’s faster than a type 1 driver; hence the performance is better as compare the type 1 driver (JDBC-ODBC Bridge). http://www.java2all.com
  • 24. Disadvantage: (1) On the client machine require the extra installation because this driver uses the vendor client libraries. (2) The Client side software needed so cannot use such type of driver in the web-based application. (3) Not all databases have the client side library. (4) This driver supports all JAVA applications except applets. http://www.java2all.com
  • 25. (3) Type 3 Driver: Network-Protocol Driver (Pure Java driver for database Middleware) :- The JDBC type 3 driver uses the middle tier(application server) between the calling program and the database and this middle tier converts JDBC method calls into the vendor specific database protocol and the same driver can be used for multiple databases also so it’s also known as a Network- Protocol driver as well as a JAVA driver for database middleware. Architecture Diagram: http://www.java2all.com
  • 27. Process: Java Application → JDBC APIs → JDBC Driver Manager → Type 3 Driver → Middleware (Server)→ any Database Advantage: (1) There is no need for the vendor database library on the client machine because the middleware is database independent and it communicates with client. (2) Type 3 driver can be used in any web application as well as on internet also because there is no any software require at client side. http://www.java2all.com
  • 28. (3) A single driver can handle any database at client side so there is no need a separate driver for each database. (4) The middleware server can also provide the typical services such as connections, auditing, load balancing, logging etc. Disadvantage: (1) An Extra layer added, may be time consuming. (2) At the middleware develop the database specific coding, may be increase complexity. http://www.java2all.com
  • 29. (4) Type 4 Driver: Native-Protocol Driver (Pure Java driver directly connected to database) :- The JDBC type 4 driver converts JDBC method calls directly into the vendor specific database protocol and in between do not need to be converted any other formatted system so this is the fastest way to communicate quires to DBMS and it is completely written in JAVA because of that this is also known as the “direct to database Pure JAVA driver”. Architecture Diagram: http://www.java2all.com
  • 31. Process: Java Application → JDBC APIs → JDBC Driver Manager → Type 4 Driver (Pure JAVA Driver) → Database Server Advantage: (1) It’s a 100% pure JAVA Driver so it’s a platform independence. (2) No translation or middleware layers are used so consider as a faster than other drivers. (3) The all process of the application-to- database connection can manage by JVM so the debugging is also managed easily. http://www.java2all.com
  • 32. Disadvantage: (1) There is a separate driver needed for each database at the client side. (2) Drivers are Database dependent, as different database vendors use different network protocols. http://www.java2all.com