SlideShare a Scribd company logo
JDBC type 2 driver
http://rajjdbc.blogspot.in/
http://rajjdbc.blogspot.in/
• JDBC TYPE -2 Driver:
• What is JDBC Type-2 Driver?
• Ans: Type 2 Driver is a JDBC Driver that converts JDBC API calls to DB Driver Native API Calls.
• Architecture:
• Fig: Type2Driver1.jpg
• This 2 tier architecture, because we have API calls is considered as layer but not tier. Here server is
a tier because it is not part of the client.
• Server means which gives the service. Here Database server is giving service like we are storing the
data, and retrieving the data.
• Advantages:
• Is fast compares to the other type of drivers.
• Disadvantages:
• It is database dependent (however this is not a big problem in most of the cases)
• This driver is partly implemented in java and partly in Native, thus this driver is unsafe to use
unless we are sure that the native implementation is bug free. As any bug in the native code could
crash the JVM.
• The Native libraries (i.e: the database client software) is need to be installed in t client machine.
http://rajjdbc.blogspot.in/
• When to use this type-2 Driver?
• Ans:
• Is preferred to use in case if the database is
accessed from the server side (Middleware
server) application such as a web application
as show n in the below architecture:
• CASE 1:
• Fig: Type2Driver2.JPG
http://rajjdbc.blogspot.in/
Fig Type2Driver2.jpg
http://rajjdbc.blogspot.in/
• CASE 2:
• In this example for suppose in a super market
there are several billing machines are available, in
each machine standalone software should be
installed and all the data should be stored in the
Database server, for this purpose Type 2 driver is
not recommended.
•
• Fig: Type2Driver3.JPG
http://rajjdbc.blogspot.in/
Fig: Type2Driver3.JPG
http://rajjdbc.blogspot.in/
• This type of drivers are named as part java, part native drivers.
• Example:
• The JDBC OCI is a Type 2 driver from Oracle Corporation for
accessing the oracle database server.
• This JDBC Driver works with the OCI (Oracle Call Interface) Native
Driver.
• The weblogicOCI is a Type-2 driver from BEA system (now this
company is merged into Oracle Corp) for accessing the Oracle DB
server.
• This driver also works with the OCI native Driver.
• (For example you are a MCA Students (for example WEBLOGICOCI),
and each of student have a unique name or rollnumber( this type -2
driver).
http://rajjdbc.blogspot.in/
TYPE-4 DRIVER
• What is Type-4 Driver?
• Ans:
• A JDBC Driver that converts JDBC API calls to
Database Native Network calls is known as
JDBC-4 DRIVER.
• Fig: Type4Driver.JPG
http://rajjdbc.blogspot.in/
http://rajjdbc.blogspot.in/
• It contains 3 elements, 2 tier architecture and 3 layers.
• Advantages:
• This is purely implemented in java, thus it is light weight (resource
consumption (ex: memory, time) is less) and portable.
• No need of DB client software to install in the client machine.
• This is platform independent thus this is the best suitable driver for
the web based application.
• Disadvantages:
• This type of driver is database dependent.
• This type of driver has to implement the database network protocol
so is most likely expected from the database vendor.
•
http://rajjdbc.blogspot.in/
http://rajjdbc.blogspot.in/
Q: WHEN TO USE Type-4 Driver?
• Note: java performance is totally depends upon JRE.
• Ans: This type of driver is suitable in the client side
running applications such as desktop application access
DB , and applet.
• However this can be also used in the middleware
server running application but would be choice after
the type-2 driver.
• Example:
• Fig: Type4Driver b.JPG
• This type of drivers referred as pure java drivers
http://rajjdbc.blogspot.in/
http://rajjdbc.blogspot.in/
Type 3 Driver
• A JDBC Driver that converts JDBC API calls into
DATABASE independent network calls is
referred as Type-3 Driver.
• Type-4 DRIVER is purely developed in java
language as part of this driver the java
networking code is provided to communicate
with database server.
http://rajjdbc.blogspot.in/
http://rajjdbc.blogspot.in/
Advantages of type 3 driver
• Most of times type-3 driver is used as part of
the applications which cares about the
security.
• This type of JDBC Driver is implemented in 3
tier architecture
• Convenient and applicable to access the
database between the networks.
http://rajjdbc.blogspot.in/
http://rajjdbc.blogspot.in/
• The database server details such as location and
authentication details are not exposed to the client (java
application)
• This has an opportunity of managing the db recourses such
as connection effectively by reusing them between the
clients improving the scalability and reducing the cost.
• Note: this can reduce the cost in case if the application is
multiuser and multi-threaded or multiple applications
accessing the same database.
• Type 3 Is database independent
• Type 3 is pure java driver thus lightweight and portable
• Supports conveniently working with distributed
transaction.
http://rajjdbc.blogspot.in/
Disadvantages:
• Having a middleware server and multiple
network calls finds costlier in some times (i.e
for the application.
• That are not seriously interested with the
above listed advantages.
http://rajjdbc.blogspot.in/
When to use this type of driver?
• Ans: this is the first choice of any java
enterprise application. However in case if the
applications is really small and does not
matter the advantage of this driver then only
it looks for Type-2/4.
• (port means receiving the request, sends
response, it is just like a door)
http://rajjdbc.blogspot.in/
• Note:
• If you want to communicate with database
server we have only two ways to communicate
1. API calls or 2. Network calls:
http://rajjdbc.blogspot.in/
Fig: InterfaceDriver.JPG
http://rajjdbc.blogspot.in/
•
• Note: Interface: there are 3 types of interfaces:
1. UI (User Interface)
2. API
3. Network Interface
• Here API Interface and Network Interface are
divided into 2 types:
I. Independent
II. Dependent.
http://rajjdbc.blogspot.in/
http://rajjdbc.blogspot.in/

More Related Content

PPTX
3 jdbc api
PPTX
4 jdbc step1
PPTX
Hibernate example1
PPTX
Dao example
PPT
PPT
Basic Java Database Connectivity(JDBC)
PDF
Dao pattern
3 jdbc api
4 jdbc step1
Hibernate example1
Dao example
Basic Java Database Connectivity(JDBC)
Dao pattern

What's hot (20)

PPTX
Java Database Connectivity (JDBC)
PPTX
Database Access With JDBC
PPS
Jdbc architecture and driver types ppt
PPT
Jdbc complete
PPT
JDBC,Types of JDBC,Resultset, statements,PreparedStatement,CallableStatements...
PPT
Chap3 3 12
PPTX
Java.sql package
PPT
Java Database Connectivity
PPTX
Java- JDBC- Mazenet Solution
PPTX
Core jdbc basics
PDF
Overview Of JDBC
PPTX
Jdbc in servlets
PPTX
Jdbc_ravi_2016
PPTX
Interface callable statement
PPT
Jdbc (database in java)
PPT
Java database connectivity
DOC
jdbc document
PPT
Java Database Connectivity (JDBC)
Database Access With JDBC
Jdbc architecture and driver types ppt
Jdbc complete
JDBC,Types of JDBC,Resultset, statements,PreparedStatement,CallableStatements...
Chap3 3 12
Java.sql package
Java Database Connectivity
Java- JDBC- Mazenet Solution
Core jdbc basics
Overview Of JDBC
Jdbc in servlets
Jdbc_ravi_2016
Interface callable statement
Jdbc (database in java)
Java database connectivity
jdbc document
Ad

Viewers also liked (20)

PPTX
Jdbc workflow
PPTX
Views
PPTX
Views
PPT
Fundamentals
PPTX
Sessionex1
PPTX
Forms
PPTX
Views
PPT
Data type
PPT
Various io stream classes .47
PPT
Scan scheduling 50 1
PPT
C scan scheduling 50 2
PPT
Look scheduling.51
PPT
C look scheduling 51 1
PPTX
Java stereams
PPT
Character stream classes .52
PPTX
Wr ex2
PPT
Class
PPTX
Exceptions
PPTX
Internal
PPTX
Headings
Jdbc workflow
Views
Views
Fundamentals
Sessionex1
Forms
Views
Data type
Various io stream classes .47
Scan scheduling 50 1
C scan scheduling 50 2
Look scheduling.51
C look scheduling 51 1
Java stereams
Character stream classes .52
Wr ex2
Class
Exceptions
Internal
Headings
Ad

Similar to 2 jdbc drivers (20)

PPTX
Jdbc
PPTX
Types of Drivers in JDBC
DOC
Jdbc drivers
PPTX
PPTX
Advanced JAVA
PPTX
java.pptx
PPTX
Jdbc driver types
DOCX
Jdbc driver types
PPT
PPTX
Chapter2 j2ee
PPTX
JDBC Driver Types
PPT
unit-v-17071204384654656646455455448.ppt
PPT
JDBC java database connectivity with dbms
PPT
Mobile Application Devlopement-Database connections-UNIT-5
PDF
Java unit 14
PPTX
jdbc.pptx jdbc.pptxjdbc.pptxjdbc.pptxjdb
PPTX
Chapter 11:Understanding Client-Side Technologies
PDF
unit8_jdbc.pdf mysql and java jdbc connection
PPT
Accessing Database using jdbc Template and record set
PPT
Unit 5-jdbc2
Jdbc
Types of Drivers in JDBC
Jdbc drivers
Advanced JAVA
java.pptx
Jdbc driver types
Jdbc driver types
Chapter2 j2ee
JDBC Driver Types
unit-v-17071204384654656646455455448.ppt
JDBC java database connectivity with dbms
Mobile Application Devlopement-Database connections-UNIT-5
Java unit 14
jdbc.pptx jdbc.pptxjdbc.pptxjdbc.pptxjdb
Chapter 11:Understanding Client-Side Technologies
unit8_jdbc.pdf mysql and java jdbc connection
Accessing Database using jdbc Template and record set
Unit 5-jdbc2

More from myrajendra (12)

PPTX
3. elements
PPTX
2. attributes
PPTX
1 introduction to html
PPT
Starting jdbc
PPTX
Properties
PPTX
Interface result set
PPTX
Interface database metadata
PPTX
Interface connection
PPTX
Indexing
PPTX
Get excelsheet
PPTX
Get data
PPTX
Driver
3. elements
2. attributes
1 introduction to html
Starting jdbc
Properties
Interface result set
Interface database metadata
Interface connection
Indexing
Get excelsheet
Get data
Driver

Recently uploaded (20)

PDF
Complications of Minimal Access Surgery at WLH
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Insiders guide to clinical Medicine.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Cell Structure & Organelles in detailed.
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
Complications of Minimal Access Surgery at WLH
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Insiders guide to clinical Medicine.pdf
Final Presentation General Medicine 03-08-2024.pptx
Microbial diseases, their pathogenesis and prophylaxis
102 student loan defaulters named and shamed – Is someone you know on the list?
Abdominal Access Techniques with Prof. Dr. R K Mishra
Cell Structure & Organelles in detailed.
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Supply Chain Operations Speaking Notes -ICLT Program
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
2.FourierTransform-ShortQuestionswithAnswers.pdf
human mycosis Human fungal infections are called human mycosis..pptx
Pharma ospi slides which help in ospi learning
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...

2 jdbc drivers

  • 1. JDBC type 2 driver http://rajjdbc.blogspot.in/
  • 3. • JDBC TYPE -2 Driver: • What is JDBC Type-2 Driver? • Ans: Type 2 Driver is a JDBC Driver that converts JDBC API calls to DB Driver Native API Calls. • Architecture: • Fig: Type2Driver1.jpg • This 2 tier architecture, because we have API calls is considered as layer but not tier. Here server is a tier because it is not part of the client. • Server means which gives the service. Here Database server is giving service like we are storing the data, and retrieving the data. • Advantages: • Is fast compares to the other type of drivers. • Disadvantages: • It is database dependent (however this is not a big problem in most of the cases) • This driver is partly implemented in java and partly in Native, thus this driver is unsafe to use unless we are sure that the native implementation is bug free. As any bug in the native code could crash the JVM. • The Native libraries (i.e: the database client software) is need to be installed in t client machine. http://rajjdbc.blogspot.in/
  • 4. • When to use this type-2 Driver? • Ans: • Is preferred to use in case if the database is accessed from the server side (Middleware server) application such as a web application as show n in the below architecture: • CASE 1: • Fig: Type2Driver2.JPG http://rajjdbc.blogspot.in/
  • 6. • CASE 2: • In this example for suppose in a super market there are several billing machines are available, in each machine standalone software should be installed and all the data should be stored in the Database server, for this purpose Type 2 driver is not recommended. • • Fig: Type2Driver3.JPG http://rajjdbc.blogspot.in/
  • 8. • This type of drivers are named as part java, part native drivers. • Example: • The JDBC OCI is a Type 2 driver from Oracle Corporation for accessing the oracle database server. • This JDBC Driver works with the OCI (Oracle Call Interface) Native Driver. • The weblogicOCI is a Type-2 driver from BEA system (now this company is merged into Oracle Corp) for accessing the Oracle DB server. • This driver also works with the OCI native Driver. • (For example you are a MCA Students (for example WEBLOGICOCI), and each of student have a unique name or rollnumber( this type -2 driver). http://rajjdbc.blogspot.in/
  • 9. TYPE-4 DRIVER • What is Type-4 Driver? • Ans: • A JDBC Driver that converts JDBC API calls to Database Native Network calls is known as JDBC-4 DRIVER. • Fig: Type4Driver.JPG http://rajjdbc.blogspot.in/
  • 11. • It contains 3 elements, 2 tier architecture and 3 layers. • Advantages: • This is purely implemented in java, thus it is light weight (resource consumption (ex: memory, time) is less) and portable. • No need of DB client software to install in the client machine. • This is platform independent thus this is the best suitable driver for the web based application. • Disadvantages: • This type of driver is database dependent. • This type of driver has to implement the database network protocol so is most likely expected from the database vendor. • http://rajjdbc.blogspot.in/
  • 13. Q: WHEN TO USE Type-4 Driver? • Note: java performance is totally depends upon JRE. • Ans: This type of driver is suitable in the client side running applications such as desktop application access DB , and applet. • However this can be also used in the middleware server running application but would be choice after the type-2 driver. • Example: • Fig: Type4Driver b.JPG • This type of drivers referred as pure java drivers http://rajjdbc.blogspot.in/
  • 15. Type 3 Driver • A JDBC Driver that converts JDBC API calls into DATABASE independent network calls is referred as Type-3 Driver. • Type-4 DRIVER is purely developed in java language as part of this driver the java networking code is provided to communicate with database server. http://rajjdbc.blogspot.in/
  • 17. Advantages of type 3 driver • Most of times type-3 driver is used as part of the applications which cares about the security. • This type of JDBC Driver is implemented in 3 tier architecture • Convenient and applicable to access the database between the networks. http://rajjdbc.blogspot.in/
  • 19. • The database server details such as location and authentication details are not exposed to the client (java application) • This has an opportunity of managing the db recourses such as connection effectively by reusing them between the clients improving the scalability and reducing the cost. • Note: this can reduce the cost in case if the application is multiuser and multi-threaded or multiple applications accessing the same database. • Type 3 Is database independent • Type 3 is pure java driver thus lightweight and portable • Supports conveniently working with distributed transaction. http://rajjdbc.blogspot.in/
  • 20. Disadvantages: • Having a middleware server and multiple network calls finds costlier in some times (i.e for the application. • That are not seriously interested with the above listed advantages. http://rajjdbc.blogspot.in/
  • 21. When to use this type of driver? • Ans: this is the first choice of any java enterprise application. However in case if the applications is really small and does not matter the advantage of this driver then only it looks for Type-2/4. • (port means receiving the request, sends response, it is just like a door) http://rajjdbc.blogspot.in/
  • 22. • Note: • If you want to communicate with database server we have only two ways to communicate 1. API calls or 2. Network calls: http://rajjdbc.blogspot.in/
  • 24. • • Note: Interface: there are 3 types of interfaces: 1. UI (User Interface) 2. API 3. Network Interface • Here API Interface and Network Interface are divided into 2 types: I. Independent II. Dependent. http://rajjdbc.blogspot.in/