SlideShare a Scribd company logo
1 of 12
Java Database Connectivity
(JDBC)
Sujit Kumar
Zenolocity LLC
Copyright @
JDBC
• Enables connectivity between java
applications and different kinds of relational
databases (RDBMS).
• JDBC API – all the interfaces & classes in
java.sql package
• JDBC drivers => JDBC API Implementation for
different databases. The drivers will contain
classes that implement the interfaces in the
JDBC API.
JDBC
• Java => write once, run anywhere
• JDBC => write once, connect with any
database.
• 4 types of drivers – Type 1 to Type 4.
Types of JDBC Drivers
• Type 1: JDBC-ODBC Bridge driver (Bridge)
• Type 2: Native-API/partly Java driver (Native)
• Type 3: All Java/Net-protocol driver
(Middleware)
• Type 4: All Java/Native-protocol driver (Pure)
JDBC Type 1 Driver
• JDBC-ODBC Bridge driver (Bridge)
Advantages of Type 1
• The JDBC-ODBC Bridge allows access to almost any
database, since the database's ODBC drivers are already
available.
Disadvantages of Type 1
• Bridge driver is not written fully in Java, hence not portable.
• Slowest of all driver types - performance issues as JDBC call
goes through the bridge to the ODBC driver & then to the
database.
• Client system requires the ODBC Installation to use the
driver.
JDBC Type 2 Driver

Type 2 drivers convert JDBC calls into database-specific calls i.e. this driver is specific
to a particular database. Example: Oracle will have oracle native api.
Type 2 Drivers
Advantages of Type 2

•

The distinctive characteristic of type 2 jdbc drivers are that they are typically offer
better performance than the JDBC-ODBC Bridge as the layers of communication
(tiers) are less than that of Type 1 and also it uses Native API which is database
specific.

Disadvantages of Type 2
•
•
•
•
•

Native API must be installed in the Client System and hence type 2 drivers cannot
be used for the Internet.
Like Type 1 drivers, it’s not written in Java Language , hence NOT PORTABLE.
If we change the Database we have to change the native api as it is specific to a
database.
Mostly obsolete now.
Usually not thread safe.
Type 3 Drivers
Type 3 drivers pass database requests through the middle-tier server. The middle-tier then
translates the request to the database. The middle-tier server can in turn use Type1, Type 2 or
Type 4 drivers.
Advantages of Type 3
•
•
•
•
•
•
•

This driver is server-based, so there is no need for any vendor database library to
be present on client machines.
This driver is fully written in Java and hence portable. It is suitable for the web.
There are many opportunities to optimize portability, performance, and scalability.
The net protocol can be designed to make the client JDBC driver very small and
fast to load.
The type 3 driver typically provides support for features such as caching
(connections, query results, and so on), load balancing, and advanced system
administration such as logging and auditing.
This driver is very flexible, allows access to multiple databases using one driver.
They are the most efficient amongst all driver types.

Disadvantages of Type 3
•

It requires another server application to install and maintain. Traversing the record
set may take longer, since the data comes through the backend server.
Type 4 Drivers
• Uses java networking libraries to communicate
directly with the database server.
Advantages of Type 4
• The major benefit of using a type 4 jdbc drivers are that they are
completely written in Java to achieve platform independence and
eliminate deployment administration issues. It is most suitable for
the web.
• Number of translation layers is very less i.e. type 4 JDBC drivers
don't have to translate database requests to ODBC or a native
connectivity interface or to pass the request on to another
server, performance is typically quite good.
• You don’t need to install special software on the client or server.
Further, these drivers can be downloaded dynamically.
Disadvantages of Type 4

• Requires a different driver for each database.

More Related Content

What's hot

Java.sql package
Java.sql packageJava.sql package
Java.sql packagemyrajendra
 
Enterprise beans
Enterprise beansEnterprise beans
Enterprise beansvpulec
 
Enterprise java unit-1_chapter-1
Enterprise java unit-1_chapter-1Enterprise java unit-1_chapter-1
Enterprise java unit-1_chapter-1sandeep54552
 
Java Training in Chennai
Java Training in Chennai Java Training in Chennai
Java Training in Chennai raj esaki
 
Basic javaprogramming(session1)
Basic javaprogramming(session1)Basic javaprogramming(session1)
Basic javaprogramming(session1)Barm Bannasan
 
NetBeans Platform for Rich Client Development
NetBeans Platform for Rich Client DevelopmentNetBeans Platform for Rich Client Development
NetBeans Platform for Rich Client DevelopmentWidura Wijenayake
 
Netbeans65 Osum Slides
Netbeans65 Osum SlidesNetbeans65 Osum Slides
Netbeans65 Osum SlidesAbhishek Gupta
 
Building software using Rich Clients Platforms Rikard Thulin
Building software using Rich Clients Platforms Rikard ThulinBuilding software using Rich Clients Platforms Rikard Thulin
Building software using Rich Clients Platforms Rikard ThulinRikard Thulin
 
WebSphere Application Server Topology Options
WebSphere Application Server Topology OptionsWebSphere Application Server Topology Options
WebSphere Application Server Topology Optionsejlp12
 
creating jdbc connection
creating jdbc connectioncreating jdbc connection
creating jdbc connectionPaneliya Prince
 
creating jdbc connection
creating jdbc connectioncreating jdbc connection
creating jdbc connectionPaneliya Prince
 
Parallel language and compiler
Parallel language and compilerParallel language and compiler
Parallel language and compilerSVijaylakshmi
 
Vertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UG
Vertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UGVertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UG
Vertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UGBojan Veljanovski
 
Inter-operabable Server Smalltalk
Inter-operabable Server SmalltalkInter-operabable Server Smalltalk
Inter-operabable Server SmalltalkESUG
 

What's hot (20)

Jdbc drivers
Jdbc driversJdbc drivers
Jdbc drivers
 
Java
JavaJava
Java
 
Java.sql package
Java.sql packageJava.sql package
Java.sql package
 
Enterprise beans
Enterprise beansEnterprise beans
Enterprise beans
 
Enterprise java unit-1_chapter-1
Enterprise java unit-1_chapter-1Enterprise java unit-1_chapter-1
Enterprise java unit-1_chapter-1
 
Ra framework 0.1
Ra framework 0.1Ra framework 0.1
Ra framework 0.1
 
Java Training in Chennai
Java Training in Chennai Java Training in Chennai
Java Training in Chennai
 
Basic javaprogramming(session1)
Basic javaprogramming(session1)Basic javaprogramming(session1)
Basic javaprogramming(session1)
 
NetBeans Platform for Rich Client Development
NetBeans Platform for Rich Client DevelopmentNetBeans Platform for Rich Client Development
NetBeans Platform for Rich Client Development
 
Netbeans65 Osum Slides
Netbeans65 Osum SlidesNetbeans65 Osum Slides
Netbeans65 Osum Slides
 
Building software using Rich Clients Platforms Rikard Thulin
Building software using Rich Clients Platforms Rikard ThulinBuilding software using Rich Clients Platforms Rikard Thulin
Building software using Rich Clients Platforms Rikard Thulin
 
WebSphere Application Server Topology Options
WebSphere Application Server Topology OptionsWebSphere Application Server Topology Options
WebSphere Application Server Topology Options
 
creating jdbc connection
creating jdbc connectioncreating jdbc connection
creating jdbc connection
 
creating jdbc connection
creating jdbc connectioncreating jdbc connection
creating jdbc connection
 
MMC
MMCMMC
MMC
 
Parallel language and compiler
Parallel language and compilerParallel language and compiler
Parallel language and compiler
 
Vertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UG
Vertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UGVertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UG
Vertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UG
 
Spring framework
Spring frameworkSpring framework
Spring framework
 
Inter-operabable Server Smalltalk
Inter-operabable Server SmalltalkInter-operabable Server Smalltalk
Inter-operabable Server Smalltalk
 
Ead pertemuan-7
Ead pertemuan-7Ead pertemuan-7
Ead pertemuan-7
 

Similar to Jdbc

java.pptx
java.pptxjava.pptx
java.pptxbfgd1
 
2 jdbc drivers
2 jdbc drivers2 jdbc drivers
2 jdbc driversmyrajendra
 
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 java database connectivity with dbms
JDBC java database connectivity with dbmsJDBC java database connectivity with dbms
JDBC java database connectivity with dbmsKhyalNayak
 
JDBC Architecture and Drivers
JDBC Architecture and DriversJDBC Architecture and Drivers
JDBC Architecture and DriversSimoniShah6
 
Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)Pooja Talreja
 
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
 
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-5Pallepati Vasavi
 
Unit 5-jdbc2
Unit 5-jdbc2Unit 5-jdbc2
Unit 5-jdbc2msafad
 
Unit 1 Advance Java - JDBC.ppt
Unit 1 Advance Java -           JDBC.pptUnit 1 Advance Java -           JDBC.ppt
Unit 1 Advance Java - JDBC.pptcreativegamerz00
 

Similar to Jdbc (20)

Advanced JAVA
Advanced JAVAAdvanced JAVA
Advanced JAVA
 
java.pptx
java.pptxjava.pptx
java.pptx
 
2 jdbc drivers
2 jdbc drivers2 jdbc drivers
2 jdbc drivers
 
Jdbc architecture and driver types ppt
Jdbc architecture and driver types pptJdbc architecture and driver types ppt
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
 
Chapter2 j2ee
Chapter2 j2eeChapter2 j2ee
Chapter2 j2ee
 
JDBC Architecture and Drivers
JDBC Architecture and DriversJDBC Architecture and Drivers
JDBC Architecture and Drivers
 
jdbc document
jdbc documentjdbc document
jdbc document
 
Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)
 
JDBC
JDBCJDBC
JDBC
 
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...
 
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
 
Jdbc complete
Jdbc completeJdbc complete
Jdbc complete
 
Jdbc drivers
Jdbc driversJdbc drivers
Jdbc drivers
 
Jdbc
JdbcJdbc
Jdbc
 
jdbc
jdbcjdbc
jdbc
 
Unit 5-jdbc2
Unit 5-jdbc2Unit 5-jdbc2
Unit 5-jdbc2
 
Jdbc
JdbcJdbc
Jdbc
 
Jdbc 1
Jdbc 1Jdbc 1
Jdbc 1
 
Unit 1 Advance Java - JDBC.ppt
Unit 1 Advance Java -           JDBC.pptUnit 1 Advance Java -           JDBC.ppt
Unit 1 Advance Java - JDBC.ppt
 

More from Sujit Kumar

Introduction to OOP with java
Introduction to OOP with javaIntroduction to OOP with java
Introduction to OOP with javaSujit Kumar
 
SFDC Database Basics
SFDC Database BasicsSFDC Database Basics
SFDC Database BasicsSujit Kumar
 
SFDC Database Security
SFDC Database SecuritySFDC Database Security
SFDC Database SecuritySujit Kumar
 
SFDC Social Applications
SFDC Social ApplicationsSFDC Social Applications
SFDC Social ApplicationsSujit Kumar
 
SFDC Other Platform Features
SFDC Other Platform FeaturesSFDC Other Platform Features
SFDC Other Platform FeaturesSujit Kumar
 
SFDC Outbound Integrations
SFDC Outbound IntegrationsSFDC Outbound Integrations
SFDC Outbound IntegrationsSujit Kumar
 
SFDC Inbound Integrations
SFDC Inbound IntegrationsSFDC Inbound Integrations
SFDC Inbound IntegrationsSujit Kumar
 
SFDC UI - Advanced Visualforce
SFDC UI - Advanced VisualforceSFDC UI - Advanced Visualforce
SFDC UI - Advanced VisualforceSujit Kumar
 
SFDC UI - Introduction to Visualforce
SFDC UI -  Introduction to VisualforceSFDC UI -  Introduction to Visualforce
SFDC UI - Introduction to VisualforceSujit Kumar
 
SFDC Deployments
SFDC DeploymentsSFDC Deployments
SFDC DeploymentsSujit Kumar
 
SFDC Data Loader
SFDC Data LoaderSFDC Data Loader
SFDC Data LoaderSujit Kumar
 
SFDC Advanced Apex
SFDC Advanced Apex SFDC Advanced Apex
SFDC Advanced Apex Sujit Kumar
 
SFDC Introduction to Apex
SFDC Introduction to ApexSFDC Introduction to Apex
SFDC Introduction to ApexSujit Kumar
 
SFDC Database Additional Features
SFDC Database Additional FeaturesSFDC Database Additional Features
SFDC Database Additional FeaturesSujit Kumar
 
Introduction to SalesForce
Introduction to SalesForceIntroduction to SalesForce
Introduction to SalesForceSujit Kumar
 
More about java strings - Immutability and String Pool
More about java strings - Immutability and String PoolMore about java strings - Immutability and String Pool
More about java strings - Immutability and String PoolSujit Kumar
 
Hibernate First and Second level caches
Hibernate First and Second level cachesHibernate First and Second level caches
Hibernate First and Second level cachesSujit Kumar
 
Java equals hashCode Contract
Java equals hashCode ContractJava equals hashCode Contract
Java equals hashCode ContractSujit Kumar
 
Java Comparable and Comparator
Java Comparable and ComparatorJava Comparable and Comparator
Java Comparable and ComparatorSujit Kumar
 

More from Sujit Kumar (20)

Introduction to OOP with java
Introduction to OOP with javaIntroduction to OOP with java
Introduction to OOP with java
 
SFDC Database Basics
SFDC Database BasicsSFDC Database Basics
SFDC Database Basics
 
SFDC Database Security
SFDC Database SecuritySFDC Database Security
SFDC Database Security
 
SFDC Social Applications
SFDC Social ApplicationsSFDC Social Applications
SFDC Social Applications
 
SFDC Other Platform Features
SFDC Other Platform FeaturesSFDC Other Platform Features
SFDC Other Platform Features
 
SFDC Outbound Integrations
SFDC Outbound IntegrationsSFDC Outbound Integrations
SFDC Outbound Integrations
 
SFDC Inbound Integrations
SFDC Inbound IntegrationsSFDC Inbound Integrations
SFDC Inbound Integrations
 
SFDC UI - Advanced Visualforce
SFDC UI - Advanced VisualforceSFDC UI - Advanced Visualforce
SFDC UI - Advanced Visualforce
 
SFDC UI - Introduction to Visualforce
SFDC UI -  Introduction to VisualforceSFDC UI -  Introduction to Visualforce
SFDC UI - Introduction to Visualforce
 
SFDC Deployments
SFDC DeploymentsSFDC Deployments
SFDC Deployments
 
SFDC Batch Apex
SFDC Batch ApexSFDC Batch Apex
SFDC Batch Apex
 
SFDC Data Loader
SFDC Data LoaderSFDC Data Loader
SFDC Data Loader
 
SFDC Advanced Apex
SFDC Advanced Apex SFDC Advanced Apex
SFDC Advanced Apex
 
SFDC Introduction to Apex
SFDC Introduction to ApexSFDC Introduction to Apex
SFDC Introduction to Apex
 
SFDC Database Additional Features
SFDC Database Additional FeaturesSFDC Database Additional Features
SFDC Database Additional Features
 
Introduction to SalesForce
Introduction to SalesForceIntroduction to SalesForce
Introduction to SalesForce
 
More about java strings - Immutability and String Pool
More about java strings - Immutability and String PoolMore about java strings - Immutability and String Pool
More about java strings - Immutability and String Pool
 
Hibernate First and Second level caches
Hibernate First and Second level cachesHibernate First and Second level caches
Hibernate First and Second level caches
 
Java equals hashCode Contract
Java equals hashCode ContractJava equals hashCode Contract
Java equals hashCode Contract
 
Java Comparable and Comparator
Java Comparable and ComparatorJava Comparable and Comparator
Java Comparable and Comparator
 

Recently uploaded

New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 

Recently uploaded (20)

New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 

Jdbc

  • 1. Java Database Connectivity (JDBC) Sujit Kumar Zenolocity LLC Copyright @
  • 2. JDBC • Enables connectivity between java applications and different kinds of relational databases (RDBMS). • JDBC API – all the interfaces & classes in java.sql package • JDBC drivers => JDBC API Implementation for different databases. The drivers will contain classes that implement the interfaces in the JDBC API.
  • 3. JDBC • Java => write once, run anywhere • JDBC => write once, connect with any database. • 4 types of drivers – Type 1 to Type 4.
  • 4. Types of JDBC Drivers • Type 1: JDBC-ODBC Bridge driver (Bridge) • Type 2: Native-API/partly Java driver (Native) • Type 3: All Java/Net-protocol driver (Middleware) • Type 4: All Java/Native-protocol driver (Pure)
  • 5. JDBC Type 1 Driver • JDBC-ODBC Bridge driver (Bridge)
  • 6. Advantages of Type 1 • The JDBC-ODBC Bridge allows access to almost any database, since the database's ODBC drivers are already available. Disadvantages of Type 1 • Bridge driver is not written fully in Java, hence not portable. • Slowest of all driver types - performance issues as JDBC call goes through the bridge to the ODBC driver & then to the database. • Client system requires the ODBC Installation to use the driver.
  • 7. JDBC Type 2 Driver Type 2 drivers convert JDBC calls into database-specific calls i.e. this driver is specific to a particular database. Example: Oracle will have oracle native api.
  • 8. Type 2 Drivers Advantages of Type 2 • The distinctive characteristic of type 2 jdbc drivers are that they are typically offer better performance than the JDBC-ODBC Bridge as the layers of communication (tiers) are less than that of Type 1 and also it uses Native API which is database specific. Disadvantages of Type 2 • • • • • Native API must be installed in the Client System and hence type 2 drivers cannot be used for the Internet. Like Type 1 drivers, it’s not written in Java Language , hence NOT PORTABLE. If we change the Database we have to change the native api as it is specific to a database. Mostly obsolete now. Usually not thread safe.
  • 9. Type 3 Drivers Type 3 drivers pass database requests through the middle-tier server. The middle-tier then translates the request to the database. The middle-tier server can in turn use Type1, Type 2 or Type 4 drivers.
  • 10. Advantages of Type 3 • • • • • • • This driver is server-based, so there is no need for any vendor database library to be present on client machines. This driver is fully written in Java and hence portable. It is suitable for the web. There are many opportunities to optimize portability, performance, and scalability. The net protocol can be designed to make the client JDBC driver very small and fast to load. The type 3 driver typically provides support for features such as caching (connections, query results, and so on), load balancing, and advanced system administration such as logging and auditing. This driver is very flexible, allows access to multiple databases using one driver. They are the most efficient amongst all driver types. Disadvantages of Type 3 • It requires another server application to install and maintain. Traversing the record set may take longer, since the data comes through the backend server.
  • 11. Type 4 Drivers • Uses java networking libraries to communicate directly with the database server.
  • 12. Advantages of Type 4 • The major benefit of using a type 4 jdbc drivers are that they are completely written in Java to achieve platform independence and eliminate deployment administration issues. It is most suitable for the web. • Number of translation layers is very less i.e. type 4 JDBC drivers don't have to translate database requests to ODBC or a native connectivity interface or to pass the request on to another server, performance is typically quite good. • You don’t need to install special software on the client or server. Further, these drivers can be downloaded dynamically. Disadvantages of Type 4 • Requires a different driver for each database.