SlideShare a Scribd company logo
1 of 24
By:
Gaurav Godhwani,
Sushil Sinhal
CSE Department , IES IPS Academy
Before APIs like JDBC and ODBC, database connectivity was
tedious:
> Database vendor provided function libraries for database access.
> Connectivity library was proprietary.
> Data access portions had to be rewritten with changes in the
application.
> Application developers were stuck with a particular database
product for a given application
> Write once, run anywhere
> Multiple client and server platforms
> Object-relational mapping
> databases optimized for searching/indexing
> objects optimized for engineering/flexibility
> Network independence
> Works across Internet Protocol
> Database independence
> Java can access any database vendor
> Ease of administration
> A standard or open application programming interface (API) for
accessing a database
> Developed by SQL Access Group, chiefly Microsoft, in 1992
> Access to various kinds of Databases
> Allows programs to use SQL requests that will access databases
without knowledge of the proprietary interfaces to the databases
> Handles these requests and converts it into a request
understandable by an individual database system.
> An ODBC software for a particular OS.
> A separate module or driver for each database to be accessed
> Driver masks the heterogeneity of DBMS, operating system and
network protocol.
> Ex: Sybase Driver, Windows Driver, etc.
Application
ODBC driver
manager
Driver
(DBMS/OS/network)
Data Source
> Java API for connecting programs written in Java to the data in
relational databases
> The standard defined by Sun Microsystems, allowing individual
providers to implement and extend the standard with their own
JDBC drivers.
> Tasks of JDBC:
1) establishes a connection with a database
2) sends SQL statements
3) processes the results
> The JDBC API supports both two-tier and three-tier models for
database access.
> Two-tier model -- a Java applet or application interacts directly
with the database.
> Three-tier model -- introduces a middle-level server for execution
of business logic:
> the middle tier to maintain control over data access.
> the user can employ an easy-to-use higher-level API which is
translated by the middle tier into the appropriate low-level
calls.
Java Application
JDBC driver manager
JDBC/native
bridge
DBMS
Native driver
(DBMS specific)
JDBC/ODBC
bridge
ODBC Driver
JDBC middleware
(various DBMS)
JDBC Driver
(DBMS Specific)
> Class-I:
JDBC:ODBC ( mainly for Desktop Applications)
> Use bridging technology
> Requires installation/configuration on client machines
> Not good for Web
> Class-II:
Native API Drivers (Vendor Specific drivers)
> Requires installation/configuration on client machines
> Used to leverage existing CLI libraries
> Usually not thread-safe
> Mostly obsolete now
> e.g. Intersolv Oracle Driver, WebLogic drivers
> Class-III:
Network API
> Calls middleware server, usually on database host
> Very flexible & allows access to multiple databases
using one driver
> Only need to download one driver
> But it’s another server application to install and maintain
> e.g. Symantec DBAnywhere
> Class-IV:
Network Protocol Driver (used for Network based Applications)
> Pure Java Drivers
> Use Java networking libraries to talk directly to database
engines
> need to download a new driver for each database engine
> e.g. Oracle, MySQL
Query
Close
Connect
Process
results
Query
Close
Connect
Process
results
Register the driver
Connect to the database
Close
Connect
Query Create a statement
Process
results
Query the database
Close
Query
Step through the results
Process
results
Assign results to Java
variables
Connect
Connect
Query
Process
results
Close
Close the result set
Close the statement
Close the connection
Thank You !!!

More Related Content

What's hot

Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework Serhat Can
 
Introduction to java beans
Introduction to java beansIntroduction to java beans
Introduction to java beansHitesh Parmar
 
Types of Drivers in JDBC
Types of Drivers in JDBCTypes of Drivers in JDBC
Types of Drivers in JDBCHemant Sharma
 
Fundamentals of JAVA
Fundamentals of JAVAFundamentals of JAVA
Fundamentals of JAVAKUNAL GADHIA
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentationguest11106b
 
Java DataBase Connectivity API (JDBC API)
Java DataBase Connectivity API (JDBC API)Java DataBase Connectivity API (JDBC API)
Java DataBase Connectivity API (JDBC API)Luzan Baral
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentationivpol
 
Java database connectivity with MySql
Java database connectivity with MySqlJava database connectivity with MySql
Java database connectivity with MySqlDhyey Dattani
 
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 Server Pages(jsp)
Java Server Pages(jsp)Java Server Pages(jsp)
Java Server Pages(jsp)Manisha Keim
 

What's hot (20)

Spring boot
Spring bootSpring boot
Spring boot
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
Jdbc complete
Jdbc completeJdbc complete
Jdbc complete
 
Java Spring Framework
Java Spring FrameworkJava Spring Framework
Java Spring Framework
 
Introduction to java beans
Introduction to java beansIntroduction to java beans
Introduction to java beans
 
LINQ in C#
LINQ in C#LINQ in C#
LINQ in C#
 
Types of Drivers in JDBC
Types of Drivers in JDBCTypes of Drivers in JDBC
Types of Drivers in JDBC
 
Fundamentals of JAVA
Fundamentals of JAVAFundamentals of JAVA
Fundamentals of JAVA
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentation
 
Java DataBase Connectivity API (JDBC API)
Java DataBase Connectivity API (JDBC API)Java DataBase Connectivity API (JDBC API)
Java DataBase Connectivity API (JDBC API)
 
Jsp ppt
Jsp pptJsp ppt
Jsp ppt
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
Jdbc
JdbcJdbc
Jdbc
 
Jdbc ppt
Jdbc pptJdbc ppt
Jdbc ppt
 
Java database connectivity with MySql
Java database connectivity with MySqlJava database connectivity with MySql
Java database connectivity with MySql
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
JPA and Hibernate
JPA and HibernateJPA and Hibernate
JPA and Hibernate
 
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...
 
Database Access With JDBC
Database Access With JDBCDatabase Access With JDBC
Database Access With JDBC
 
Java Server Pages(jsp)
Java Server Pages(jsp)Java Server Pages(jsp)
Java Server Pages(jsp)
 

Similar to Jdbc Ppt (20)

JDBC.pdf
JDBC.pdfJDBC.pdf
JDBC.pdf
 
Jdbc 1
Jdbc 1Jdbc 1
Jdbc 1
 
Jdbc
JdbcJdbc
Jdbc
 
Jdbc
JdbcJdbc
Jdbc
 
Jdbc
JdbcJdbc
Jdbc
 
Chapter2 j2ee
Chapter2 j2eeChapter2 j2ee
Chapter2 j2ee
 
JDBC java database connectivity with dbms
JDBC java database connectivity with dbmsJDBC java database connectivity with dbms
JDBC java database connectivity with dbms
 
jdbc
jdbcjdbc
jdbc
 
3 jdbc
3 jdbc3 jdbc
3 jdbc
 
java.pptx
java.pptxjava.pptx
java.pptx
 
jdbc
jdbcjdbc
jdbc
 
Java database connectivity
Java database connectivityJava database connectivity
Java database connectivity
 
Java database connectivity
Java database connectivityJava database connectivity
Java database connectivity
 
Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)
 
Jdbc driver types
Jdbc driver typesJdbc driver types
Jdbc driver types
 
JDBC.ppt
JDBC.pptJDBC.ppt
JDBC.ppt
 
JDBC with MySQL.pdf
JDBC with MySQL.pdfJDBC with MySQL.pdf
JDBC with MySQL.pdf
 
JDBC with MySQL.pdf
JDBC with MySQL.pdfJDBC with MySQL.pdf
JDBC with MySQL.pdf
 
Java database connectivity with MySql
Java database connectivity with MySqlJava database connectivity with MySql
Java database connectivity with MySql
 
Unit 5-jdbc2
Unit 5-jdbc2Unit 5-jdbc2
Unit 5-jdbc2
 

Jdbc Ppt

  • 1. By: Gaurav Godhwani, Sushil Sinhal CSE Department , IES IPS Academy
  • 2. Before APIs like JDBC and ODBC, database connectivity was tedious: > Database vendor provided function libraries for database access. > Connectivity library was proprietary. > Data access portions had to be rewritten with changes in the application. > Application developers were stuck with a particular database product for a given application
  • 3. > Write once, run anywhere > Multiple client and server platforms > Object-relational mapping > databases optimized for searching/indexing > objects optimized for engineering/flexibility > Network independence > Works across Internet Protocol > Database independence > Java can access any database vendor > Ease of administration
  • 4. > A standard or open application programming interface (API) for accessing a database > Developed by SQL Access Group, chiefly Microsoft, in 1992 > Access to various kinds of Databases > Allows programs to use SQL requests that will access databases without knowledge of the proprietary interfaces to the databases > Handles these requests and converts it into a request understandable by an individual database system.
  • 5. > An ODBC software for a particular OS. > A separate module or driver for each database to be accessed > Driver masks the heterogeneity of DBMS, operating system and network protocol. > Ex: Sybase Driver, Windows Driver, etc.
  • 7. > Java API for connecting programs written in Java to the data in relational databases > The standard defined by Sun Microsystems, allowing individual providers to implement and extend the standard with their own JDBC drivers. > Tasks of JDBC: 1) establishes a connection with a database 2) sends SQL statements 3) processes the results
  • 8. > The JDBC API supports both two-tier and three-tier models for database access. > Two-tier model -- a Java applet or application interacts directly with the database. > Three-tier model -- introduces a middle-level server for execution of business logic: > the middle tier to maintain control over data access. > the user can employ an easy-to-use higher-level API which is translated by the middle tier into the appropriate low-level calls.
  • 9. Java Application JDBC driver manager JDBC/native bridge DBMS Native driver (DBMS specific) JDBC/ODBC bridge ODBC Driver JDBC middleware (various DBMS) JDBC Driver (DBMS Specific)
  • 10. > Class-I: JDBC:ODBC ( mainly for Desktop Applications) > Use bridging technology > Requires installation/configuration on client machines > Not good for Web > Class-II: Native API Drivers (Vendor Specific drivers) > Requires installation/configuration on client machines > Used to leverage existing CLI libraries > Usually not thread-safe > Mostly obsolete now > e.g. Intersolv Oracle Driver, WebLogic drivers
  • 11. > Class-III: Network API > Calls middleware server, usually on database host > Very flexible & allows access to multiple databases using one driver > Only need to download one driver > But it’s another server application to install and maintain > e.g. Symantec DBAnywhere > Class-IV: Network Protocol Driver (used for Network based Applications) > Pure Java Drivers > Use Java networking libraries to talk directly to database engines > need to download a new driver for each database engine > e.g. Oracle, MySQL
  • 14. Close Connect Query Create a statement Process results Query the database
  • 15. Close Query Step through the results Process results Assign results to Java variables Connect
  • 16. Connect Query Process results Close Close the result set Close the statement Close the connection
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.