SlideShare uma empresa Scribd logo
1 de 25
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/

Mais conteúdo relacionado

Mais procurados

Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)Pooja Talreja
 
Jdbc architecture and driver types ppt
Jdbc architecture and driver types pptJdbc architecture and driver types ppt
Jdbc architecture and driver types pptkamal kotecha
 
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
 
Java.sql package
Java.sql packageJava.sql package
Java.sql packagemyrajendra
 
Java Database Connectivity
Java Database ConnectivityJava Database Connectivity
Java Database Connectivitybackdoor
 
Java- JDBC- Mazenet Solution
Java- JDBC- Mazenet SolutionJava- JDBC- Mazenet Solution
Java- JDBC- Mazenet SolutionMazenetsolution
 
Jdbc in servlets
Jdbc in servletsJdbc in servlets
Jdbc in servletsNuha Noor
 
Interface callable statement
Interface callable statementInterface callable statement
Interface callable statementmyrajendra
 
Jdbc (database in java)
Jdbc (database in java)Jdbc (database in java)
Jdbc (database in java)Maher Abdo
 
Java database connectivity
Java database connectivityJava database connectivity
Java database connectivityVaishali Modi
 

Mais procurados (20)

JDBC
JDBCJDBC
JDBC
 
Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)
 
Database Access With JDBC
Database Access With JDBCDatabase Access With JDBC
Database Access With JDBC
 
Jdbc architecture and driver types ppt
Jdbc architecture and driver types pptJdbc architecture and driver types ppt
Jdbc architecture and driver types ppt
 
Jdbc complete
Jdbc completeJdbc complete
Jdbc complete
 
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...
 
Chap3 3 12
Chap3 3 12Chap3 3 12
Chap3 3 12
 
Java.sql package
Java.sql packageJava.sql package
Java.sql package
 
Java Database Connectivity
Java Database ConnectivityJava Database Connectivity
Java Database Connectivity
 
Java- JDBC- Mazenet Solution
Java- JDBC- Mazenet SolutionJava- JDBC- Mazenet Solution
Java- JDBC- Mazenet Solution
 
Jdbc
JdbcJdbc
Jdbc
 
Core jdbc basics
Core jdbc basicsCore jdbc basics
Core jdbc basics
 
Overview Of JDBC
Overview Of JDBCOverview Of JDBC
Overview Of JDBC
 
Jdbc in servlets
Jdbc in servletsJdbc in servlets
Jdbc in servlets
 
Jdbc_ravi_2016
Jdbc_ravi_2016Jdbc_ravi_2016
Jdbc_ravi_2016
 
Interface callable statement
Interface callable statementInterface callable statement
Interface callable statement
 
Jdbc (database in java)
Jdbc (database in java)Jdbc (database in java)
Jdbc (database in java)
 
Java database connectivity
Java database connectivityJava database connectivity
Java database connectivity
 
jdbc document
jdbc documentjdbc document
jdbc document
 
Jdbc
JdbcJdbc
Jdbc
 

Destaque (20)

Jdbc workflow
Jdbc workflowJdbc workflow
Jdbc workflow
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Fundamentals
FundamentalsFundamentals
Fundamentals
 
Sessionex1
Sessionex1Sessionex1
Sessionex1
 
Forms
FormsForms
Forms
 
Views
ViewsViews
Views
 
Data type
Data typeData type
Data type
 
Various io stream classes .47
Various io stream classes .47Various io stream classes .47
Various io stream classes .47
 
Scan scheduling 50 1
Scan scheduling 50 1Scan scheduling 50 1
Scan scheduling 50 1
 
C scan scheduling 50 2
C scan scheduling 50 2C scan scheduling 50 2
C scan scheduling 50 2
 
Look scheduling.51
Look scheduling.51Look scheduling.51
Look scheduling.51
 
C look scheduling 51 1
C look scheduling 51 1C look scheduling 51 1
C look scheduling 51 1
 
Java stereams
Java stereamsJava stereams
Java stereams
 
Character stream classes .52
Character stream classes .52Character stream classes .52
Character stream classes .52
 
Wr ex2
Wr ex2Wr ex2
Wr ex2
 
Class
ClassClass
Class
 
Exceptions
ExceptionsExceptions
Exceptions
 
Internal
InternalInternal
Internal
 
Headings
HeadingsHeadings
Headings
 

Semelhante a 2 jdbc drivers

Semelhante a 2 jdbc drivers (20)

Jdbc
JdbcJdbc
Jdbc
 
Types of Drivers in JDBC
Types of Drivers in JDBCTypes of Drivers in JDBC
Types of Drivers in JDBC
 
Jdbc drivers
Jdbc driversJdbc drivers
Jdbc drivers
 
Jdbc
JdbcJdbc
Jdbc
 
Advanced JAVA
Advanced JAVAAdvanced JAVA
Advanced JAVA
 
java.pptx
java.pptxjava.pptx
java.pptx
 
Jdbc driver types
Jdbc driver typesJdbc driver types
Jdbc driver types
 
Jdbc driver types
Jdbc driver typesJdbc driver types
Jdbc driver types
 
Jdbcdriver
JdbcdriverJdbcdriver
Jdbcdriver
 
Chapter2 j2ee
Chapter2 j2eeChapter2 j2ee
Chapter2 j2ee
 
JDBC Driver Types
JDBC Driver TypesJDBC Driver Types
JDBC Driver Types
 
JDBC java database connectivity with dbms
JDBC java database connectivity with dbmsJDBC java database connectivity with dbms
JDBC java database connectivity with dbms
 
Mobile Application Devlopement-Database connections-UNIT-5
Mobile Application Devlopement-Database connections-UNIT-5Mobile Application Devlopement-Database connections-UNIT-5
Mobile Application Devlopement-Database connections-UNIT-5
 
Java unit 14
Java unit 14Java unit 14
Java unit 14
 
Chapter 11:Understanding Client-Side Technologies
Chapter 11:Understanding Client-Side TechnologiesChapter 11:Understanding Client-Side Technologies
Chapter 11:Understanding Client-Side Technologies
 
Unit 5-jdbc2
Unit 5-jdbc2Unit 5-jdbc2
Unit 5-jdbc2
 
Jdbc
JdbcJdbc
Jdbc
 
jdbc
jdbcjdbc
jdbc
 
PROGRAMMING IN JAVA- unit 5-part II
PROGRAMMING IN JAVA- unit 5-part IIPROGRAMMING IN JAVA- unit 5-part II
PROGRAMMING IN JAVA- unit 5-part II
 
java database connection (jdbc)
java database connection (jdbc)java database connection (jdbc)
java database connection (jdbc)
 

Mais de myrajendra

1 introduction to html
1 introduction to html1 introduction to html
1 introduction to htmlmyrajendra
 
Interface result set
Interface result setInterface result set
Interface result setmyrajendra
 
Interface database metadata
Interface database metadataInterface database metadata
Interface database metadatamyrajendra
 
Interface connection
Interface connectionInterface connection
Interface connectionmyrajendra
 
Get excelsheet
Get excelsheetGet excelsheet
Get excelsheetmyrajendra
 

Mais de myrajendra (12)

3. elements
3. elements3. elements
3. elements
 
2. attributes
2. attributes2. attributes
2. attributes
 
1 introduction to html
1 introduction to html1 introduction to html
1 introduction to html
 
Starting jdbc
Starting jdbcStarting jdbc
Starting jdbc
 
Properties
PropertiesProperties
Properties
 
Interface result set
Interface result setInterface result set
Interface result set
 
Interface database metadata
Interface database metadataInterface database metadata
Interface database metadata
 
Interface connection
Interface connectionInterface connection
Interface connection
 
Indexing
IndexingIndexing
Indexing
 
Get excelsheet
Get excelsheetGet excelsheet
Get excelsheet
 
Get data
Get dataGet data
Get data
 
Driver
DriverDriver
Driver
 

Último

Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataBabyAnnMotar
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsPooky Knightsmith
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Developmentchesterberbo7
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1GloryAnnCastre1
 

Último (20)

Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped data
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young minds
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Development
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1
 

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/