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 (20)

PPTX
Inner classes in java
PhD Research Scholar
 
PPT
Java collections concept
kumar gaurav
 
PPTX
Hibernate ppt
Aneega
 
PPT
Java interfaces
Raja Sekhar
 
PPTX
Jdbc ppt
sandeep54552
 
PDF
Spring Framework - Core
Dzmitry Naskou
 
PDF
Hibernate Presentation
guest11106b
 
PDF
What is Dependency Injection in Spring Boot | Edureka
Edureka!
 
PDF
Arrays in Java
Naz Abdalla
 
PPTX
CSharp Presentation
Vishwa Mohan
 
PDF
Generics
Ravi_Kant_Sahu
 
PPTX
Interface in java
PhD Research Scholar
 
PPS
Java Exception handling
kamal kotecha
 
PPT
Collection Framework in java
CPD INDIA
 
PPT
Awt controls ppt
soumyaharitha
 
PPTX
Classes, objects in JAVA
Abhilash Nair
 
PPT
JDBC – Java Database Connectivity
Information Technology
 
PDF
Java Basic Oops Concept
atozknowledge .com
 
PPTX
Java Spring Framework
Mehul Jariwala
 
Inner classes in java
PhD Research Scholar
 
Java collections concept
kumar gaurav
 
Hibernate ppt
Aneega
 
Java interfaces
Raja Sekhar
 
Jdbc ppt
sandeep54552
 
Spring Framework - Core
Dzmitry Naskou
 
Hibernate Presentation
guest11106b
 
What is Dependency Injection in Spring Boot | Edureka
Edureka!
 
Arrays in Java
Naz Abdalla
 
CSharp Presentation
Vishwa Mohan
 
Generics
Ravi_Kant_Sahu
 
Interface in java
PhD Research Scholar
 
Java Exception handling
kamal kotecha
 
Collection Framework in java
CPD INDIA
 
Awt controls ppt
soumyaharitha
 
Classes, objects in JAVA
Abhilash Nair
 
JDBC – Java Database Connectivity
Information Technology
 
Java Basic Oops Concept
atozknowledge .com
 
Java Spring Framework
Mehul Jariwala
 

Similar to Jdbc architecture and driver types ppt (20)

PPT
JDBC java database connectivity with dbms
KhyalNayak
 
DOC
jdbc document
Yamuna Devi
 
PDF
unit8_jdbc.pdf mysql and java jdbc connection
Indu32
 
PPTX
Jdbc driver types
Soham Kansodaria
 
PPT
JDBC Architecture and Drivers
SimoniShah6
 
PPT
Jdbc ppt
Vikas Jagtap
 
PPT
Unit 5-jdbc2
msafad
 
PPTX
Advanced JAVA
Rajvi Vaghasiya
 
PDF
Java and Database - Interacting with database
Amol Gaikwad
 
PDF
Jdbc 1
Mukesh Tekwani
 
PPTX
Jdbc drivers
Saurabh Bhartiya
 
PPTX
jdbc.pptx jdbc.pptxjdbc.pptxjdbc.pptxjdb
devamrana27
 
PPTX
Jdbc
gee eew3
 
PPTX
UNIT 1 PPT- FINAL.pptx Advance Java JDBC
iamspidey0104
 
PPTX
JDBC Driver Types
Rahul Sharma
 
DOCX
Jdbc driver types
Arvind Kumar
 
PPTX
Chapter_4_-_JDBC[1].pptx
BachaSirata
 
PPTX
Chapter2 j2ee
Jafar Nesargi
 
JDBC java database connectivity with dbms
KhyalNayak
 
jdbc document
Yamuna Devi
 
unit8_jdbc.pdf mysql and java jdbc connection
Indu32
 
Jdbc driver types
Soham Kansodaria
 
JDBC Architecture and Drivers
SimoniShah6
 
Jdbc ppt
Vikas Jagtap
 
Unit 5-jdbc2
msafad
 
Advanced JAVA
Rajvi Vaghasiya
 
Java and Database - Interacting with database
Amol Gaikwad
 
Jdbc drivers
Saurabh Bhartiya
 
jdbc.pptx jdbc.pptxjdbc.pptxjdbc.pptxjdb
devamrana27
 
Jdbc
gee eew3
 
UNIT 1 PPT- FINAL.pptx Advance Java JDBC
iamspidey0104
 
JDBC Driver Types
Rahul Sharma
 
Jdbc driver types
Arvind Kumar
 
Chapter_4_-_JDBC[1].pptx
BachaSirata
 
Chapter2 j2ee
Jafar Nesargi
 
Ad

More from kamal kotecha (20)

PPS
Java Hibernate Programming with Architecture Diagram and Example
kamal kotecha
 
PPTX
Network programming in java - PPT
kamal kotecha
 
PPT
Java servlet life cycle - methods ppt
kamal kotecha
 
PPS
Java rmi example program with code
kamal kotecha
 
PPS
Java rmi
kamal kotecha
 
PPS
Jdbc example program with access and MySql
kamal kotecha
 
PPS
Jdbc api
kamal kotecha
 
PPS
JSP Error handling
kamal kotecha
 
PPS
Jsp element
kamal kotecha
 
PPS
Jsp chapter 1
kamal kotecha
 
PPS
String and string buffer
kamal kotecha
 
PPS
Wrapper class
kamal kotecha
 
PPS
Packages and inbuilt classes of java
kamal kotecha
 
PPS
Interface
kamal kotecha
 
PPS
Inheritance chepter 7
kamal kotecha
 
PPS
Class method
kamal kotecha
 
PPS
Introduction to class in java
kamal kotecha
 
PPS
Control statements
kamal kotecha
 
PPTX
Jsp myeclipse
kamal kotecha
 
PPTX
basic core java up to operator
kamal kotecha
 
Java Hibernate Programming with Architecture Diagram and Example
kamal kotecha
 
Network programming in java - PPT
kamal kotecha
 
Java servlet life cycle - methods ppt
kamal kotecha
 
Java rmi example program with code
kamal kotecha
 
Java rmi
kamal kotecha
 
Jdbc example program with access and MySql
kamal kotecha
 
Jdbc api
kamal kotecha
 
JSP Error handling
kamal kotecha
 
Jsp element
kamal kotecha
 
Jsp chapter 1
kamal kotecha
 
String and string buffer
kamal kotecha
 
Wrapper class
kamal kotecha
 
Packages and inbuilt classes of java
kamal kotecha
 
Interface
kamal kotecha
 
Inheritance chepter 7
kamal kotecha
 
Class method
kamal kotecha
 
Introduction to class in java
kamal kotecha
 
Control statements
kamal kotecha
 
Jsp myeclipse
kamal kotecha
 
basic core java up to operator
kamal kotecha
 
Ad

Recently uploaded (20)

PDF
The-Ever-Evolving-World-of-Science (1).pdf/7TH CLASS CURIOSITY /1ST CHAPTER/B...
Sandeep Swamy
 
PPTX
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
PDF
LAW OF CONTRACT (5 YEAR LLB & UNITARY LLB )- MODULE - 1.& 2 - LEARN THROUGH P...
APARNA T SHAIL KUMAR
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
PPTX
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
PDF
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
PDF
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PDF
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
PPTX
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
PDF
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
PDF
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
PDF
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
PPTX
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PDF
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
PDF
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PDF
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
The-Ever-Evolving-World-of-Science (1).pdf/7TH CLASS CURIOSITY /1ST CHAPTER/B...
Sandeep Swamy
 
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
LAW OF CONTRACT (5 YEAR LLB & UNITARY LLB )- MODULE - 1.& 2 - LEARN THROUGH P...
APARNA T SHAIL KUMAR
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 

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