SlideShare a Scribd company logo
1 of 4
List various types of JDBC drives. Explain JDBC-ODBC bridge driver
Type 1: JDBC-ODBC bridge Type 2: JDBC-native API Type 3:100% pure java, JDBC network Type
4:100% java JDBC-ODBC bridge

This category works with ODBC drivers supplied by your database vendor or a third party. To use
the bridge, you must first have an ODBC driver specifically for you database and additional software
that you need for connectivity. Using ODBC also requires configuring on your system a DNS that
represents the target database.
Advantages
1) It offers the ability to connect to almost all databases on almost all platforms.
2) It may be the only way to gain access to some low and desktop database and application
Disadvantages
1) ODBC driver must also be loaded on the target machine.
2) Translation between JDBC and ODBC affects performance
Describe the two –tier and three –tier database design of JDBC API with neat diagram.
Two Tier Architecture:In a two tier model a java application is designed to interact directly with
the database. Application functionality is divided into these two layers:
1) Application Layer: Including the JDBC driver, business logic and user interface
2) Database Layer: including RDBMS
The interface to the database is handled by the Java Database Connectivity(JDBC) Driver
appropriate to the particularly database management system being accessed. The JDBC Driver
passes SQL statements to the database and returns the results of those statements to the
application. A client/server configuration is the special case of the two tier model where the
database is located on another machine referred to as the server. The application runs on the client
machine which is connected to the server over a network. Commonly the network is an Intranet
using dedicated database servers to support multiple clients but it can just as easily be the internet.

Three Tier Architecture:-In the three tier model, the client typically sends requests to an application
server, forming the middle tier. The application server interprets these requests and formats the
necessary SQL statement to fulfill
These requests, and sends them to the database. The database process the SQL statements and sends
result back to the application server, which then sends them to the client. Following are some
advantages of Three-tier architecture:
1. Performance can be improved by separating the application server and database server
2. Business logic is clearly separated from the database.
3. Client application can use a simple protocol such as CGI to access services.
The three-tier model show in following fig is a common in web application. In this scenario, the
client tier is frequently implemented in a browse on a client machine, the middle tier is
implemented in a web server with a Servlet engine and the database management system runs on a
dedicated database server.

Following are the main components of three tier architecture
1. Client Tier: - Typically, this is thin presentation layer that may be implemented using a web
browser
2. Middle Tier :- This tier handles the business or application logic . This may be implemented using
a Servlet engine such as Tomcat or an application server such as JBOSS. The JDBC driver also
resides in this layer.
3. Data source layer: This component includes the RDBMS
Drive Manager: Driver Manager is a static class in the Java Software Development Kit (J2SDK).
Driver Manager manages the set of Java Database Connectivity (JDBC) drivers that are available for
an application to use. Applications can use multiple JDBC drivers concurrently if necessary. Each
application specifies a JDBC driver by using a Uniform Resource Locator (URL). By passing a URL
for a specific JDBC driver to the Driver Manager, the application informs the Driver Manager about
which type of JDBC connection should be returned to the application. Before this can be done, the
Driver Manager must be made aware of the available JDBC drivers so it can hand out connections.
By making a call to the Class.forName method, it loads a class into the running Java virtual machine
(JVM) based on its string name that is passed into the method.
Connection: Connection is a interface. It allows to establish connection between data source and
application i.e program written by the user. Connection interface helps by providing the different
methods for transactions and error handling. Different approaches can be used to establish a
connection with the database.
1. DriverManager.getConnection (string url)
2. DriverManager.getConnection (string url, String user,Stringurl)
3. Connection con= DriverManager.getConnection (string url)
Explain necessity of JDBC-ODBC bridge driver
i. The JDBC type1 driver, also known as the JDBC-ODBC bridge, is a database driver
implementation that employs the ODBC driver to connect to the database.
ii. The driver converts JDBC method calls into ODBC function calls.
iii. The driver is platform-dependent as it makes use of ODBC which in turn depends on native
libraries of the underlying operating system the JVM is running upon.
iv. Also, use of this driver leads to other installation dependencies; for example, ODBC must be
installed on the computer having the driver and the database must support an ODBC driver.
v. The use of this driver is discouraged if the alternative of a pure-Java driver is available.
vi. The other implication is that any application using a type 1 driver is non-portable given the
binding between the driver and platform.
vii. This technology isn't suitable for a high-transaction environment. Type 1 drivers also don't
support the complete Java command set and are limited by the functionality of the ODBC driver.

More Related Content

What's hot (20)

Jdbc
JdbcJdbc
Jdbc
 
JDBC-Introduction
JDBC-IntroductionJDBC-Introduction
JDBC-Introduction
 
Jdbc
JdbcJdbc
Jdbc
 
java Jdbc
java Jdbc java Jdbc
java Jdbc
 
Jdbc
JdbcJdbc
Jdbc
 
Java DataBase Connectivity API (JDBC API)
Java DataBase Connectivity API (JDBC API)Java DataBase Connectivity API (JDBC API)
Java DataBase Connectivity API (JDBC API)
 
Jdbc drivers
Jdbc driversJdbc drivers
Jdbc drivers
 
Unit 5-jdbc2
Unit 5-jdbc2Unit 5-jdbc2
Unit 5-jdbc2
 
Database and Java Database Connectivity
Database and Java Database ConnectivityDatabase and Java Database Connectivity
Database and Java Database Connectivity
 
JDBC Connectivity Model
JDBC Connectivity ModelJDBC Connectivity Model
JDBC Connectivity Model
 
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...
 
Jdbc
JdbcJdbc
Jdbc
 
Ajp notes-chapter-05
Ajp notes-chapter-05Ajp notes-chapter-05
Ajp notes-chapter-05
 
Java- JDBC- Mazenet Solution
Java- JDBC- Mazenet SolutionJava- JDBC- Mazenet Solution
Java- JDBC- Mazenet Solution
 
Vinay
VinayVinay
Vinay
 
Overview Of JDBC
Overview Of JDBCOverview Of JDBC
Overview Of JDBC
 
Jdbc new
Jdbc newJdbc new
Jdbc new
 
Jdbc complete
Jdbc completeJdbc complete
Jdbc complete
 
J2 ee architecture
J2 ee architectureJ2 ee architecture
J2 ee architecture
 
3 jdbc
3 jdbc3 jdbc
3 jdbc
 

Viewers also liked

Viewers also liked (7)

Exp 8...
Exp 8...Exp 8...
Exp 8...
 
rtrtrNew text document
rtrtrNew text documentrtrtrNew text document
rtrtrNew text document
 
5 k z mao
5 k z mao5 k z mao
5 k z mao
 
It 4-yr-1-sem-digital image processing
It 4-yr-1-sem-digital image processingIt 4-yr-1-sem-digital image processing
It 4-yr-1-sem-digital image processing
 
Result analysis hek (1)
Result analysis hek (1)Result analysis hek (1)
Result analysis hek (1)
 
Exp 8...
Exp 8...Exp 8...
Exp 8...
 
15ss
15ss15ss
15ss
 

Similar to Jdbc

Java Database Connectivity
Java Database ConnectivityJava Database Connectivity
Java Database Connectivitybackdoor
 
JDBC java database connectivity with dbms
JDBC java database connectivity with dbmsJDBC java database connectivity with dbms
JDBC java database connectivity with dbmsKhyalNayak
 
java.pptx
java.pptxjava.pptx
java.pptxbfgd1
 
Ajp notes-chapter-05
Ajp notes-chapter-05Ajp notes-chapter-05
Ajp notes-chapter-05JONDHLEPOLY
 
jdbc.ppt
jdbc.pptjdbc.ppt
jdbc.pptKanaKo8
 
Jdbc architecture and driver types ppt
Jdbc architecture and driver types pptJdbc architecture and driver types ppt
Jdbc architecture and driver types pptkamal kotecha
 
Basic Java Database Connectivity(JDBC)
Basic Java Database Connectivity(JDBC)Basic Java Database Connectivity(JDBC)
Basic Java Database Connectivity(JDBC)suraj pandey
 
JDBC Presentation with JAVA code Examples.pdf
JDBC Presentation with JAVA code Examples.pdfJDBC Presentation with JAVA code Examples.pdf
JDBC Presentation with JAVA code Examples.pdfssuser8878c1
 
Introduction to MySQL - Part 1
Introduction to MySQL - Part 1Introduction to MySQL - Part 1
Introduction to MySQL - Part 1webhostingguy
 
Introduction to MySQL - Part 1
Introduction to MySQL - Part 1Introduction to MySQL - Part 1
Introduction to MySQL - Part 1webhostingguy
 
Introduction to MySQL - Part 1
Introduction to MySQL - Part 1Introduction to MySQL - Part 1
Introduction to MySQL - Part 1webhostingguy
 
Introduction to MySQL - Part 1
Introduction to MySQL - Part 1Introduction to MySQL - Part 1
Introduction to MySQL - Part 1webhostingguy
 

Similar to Jdbc (20)

Jdbc 1
Jdbc 1Jdbc 1
Jdbc 1
 
Chapter2 j2ee
Chapter2 j2eeChapter2 j2ee
Chapter2 j2ee
 
Java jdbc
Java jdbcJava jdbc
Java jdbc
 
JDBC.ppt
JDBC.pptJDBC.ppt
JDBC.ppt
 
Java Database Connectivity
Java Database ConnectivityJava Database Connectivity
Java Database Connectivity
 
JDBC java database connectivity with dbms
JDBC java database connectivity with dbmsJDBC java database connectivity with dbms
JDBC java database connectivity with dbms
 
Jdbc ppt
Jdbc pptJdbc ppt
Jdbc ppt
 
java.pptx
java.pptxjava.pptx
java.pptx
 
Ajp notes-chapter-05
Ajp notes-chapter-05Ajp notes-chapter-05
Ajp notes-chapter-05
 
jdbc.ppt
jdbc.pptjdbc.ppt
jdbc.ppt
 
Jdbc architecture and driver types ppt
Jdbc architecture and driver types pptJdbc architecture and driver types ppt
Jdbc architecture and driver types ppt
 
Core jdbc basics
Core jdbc basicsCore jdbc basics
Core jdbc basics
 
Jdbc driver types
Jdbc driver typesJdbc driver types
Jdbc driver types
 
Jdbcdriver
JdbcdriverJdbcdriver
Jdbcdriver
 
Basic Java Database Connectivity(JDBC)
Basic Java Database Connectivity(JDBC)Basic Java Database Connectivity(JDBC)
Basic Java Database Connectivity(JDBC)
 
JDBC Presentation with JAVA code Examples.pdf
JDBC Presentation with JAVA code Examples.pdfJDBC Presentation with JAVA code Examples.pdf
JDBC Presentation with JAVA code Examples.pdf
 
Introduction to MySQL - Part 1
Introduction to MySQL - Part 1Introduction to MySQL - Part 1
Introduction to MySQL - Part 1
 
Introduction to MySQL - Part 1
Introduction to MySQL - Part 1Introduction to MySQL - Part 1
Introduction to MySQL - Part 1
 
Introduction to MySQL - Part 1
Introduction to MySQL - Part 1Introduction to MySQL - Part 1
Introduction to MySQL - Part 1
 
Introduction to MySQL - Part 1
Introduction to MySQL - Part 1Introduction to MySQL - Part 1
Introduction to MySQL - Part 1
 

Jdbc

  • 1. List various types of JDBC drives. Explain JDBC-ODBC bridge driver Type 1: JDBC-ODBC bridge Type 2: JDBC-native API Type 3:100% pure java, JDBC network Type 4:100% java JDBC-ODBC bridge This category works with ODBC drivers supplied by your database vendor or a third party. To use the bridge, you must first have an ODBC driver specifically for you database and additional software that you need for connectivity. Using ODBC also requires configuring on your system a DNS that represents the target database. Advantages 1) It offers the ability to connect to almost all databases on almost all platforms. 2) It may be the only way to gain access to some low and desktop database and application Disadvantages 1) ODBC driver must also be loaded on the target machine. 2) Translation between JDBC and ODBC affects performance
  • 2. Describe the two –tier and three –tier database design of JDBC API with neat diagram. Two Tier Architecture:In a two tier model a java application is designed to interact directly with the database. Application functionality is divided into these two layers: 1) Application Layer: Including the JDBC driver, business logic and user interface 2) Database Layer: including RDBMS The interface to the database is handled by the Java Database Connectivity(JDBC) Driver appropriate to the particularly database management system being accessed. The JDBC Driver passes SQL statements to the database and returns the results of those statements to the application. A client/server configuration is the special case of the two tier model where the database is located on another machine referred to as the server. The application runs on the client machine which is connected to the server over a network. Commonly the network is an Intranet using dedicated database servers to support multiple clients but it can just as easily be the internet. Three Tier Architecture:-In the three tier model, the client typically sends requests to an application server, forming the middle tier. The application server interprets these requests and formats the necessary SQL statement to fulfill These requests, and sends them to the database. The database process the SQL statements and sends result back to the application server, which then sends them to the client. Following are some advantages of Three-tier architecture: 1. Performance can be improved by separating the application server and database server 2. Business logic is clearly separated from the database. 3. Client application can use a simple protocol such as CGI to access services. The three-tier model show in following fig is a common in web application. In this scenario, the client tier is frequently implemented in a browse on a client machine, the middle tier is
  • 3. implemented in a web server with a Servlet engine and the database management system runs on a dedicated database server. Following are the main components of three tier architecture 1. Client Tier: - Typically, this is thin presentation layer that may be implemented using a web browser 2. Middle Tier :- This tier handles the business or application logic . This may be implemented using a Servlet engine such as Tomcat or an application server such as JBOSS. The JDBC driver also resides in this layer. 3. Data source layer: This component includes the RDBMS Drive Manager: Driver Manager is a static class in the Java Software Development Kit (J2SDK). Driver Manager manages the set of Java Database Connectivity (JDBC) drivers that are available for an application to use. Applications can use multiple JDBC drivers concurrently if necessary. Each application specifies a JDBC driver by using a Uniform Resource Locator (URL). By passing a URL for a specific JDBC driver to the Driver Manager, the application informs the Driver Manager about which type of JDBC connection should be returned to the application. Before this can be done, the Driver Manager must be made aware of the available JDBC drivers so it can hand out connections. By making a call to the Class.forName method, it loads a class into the running Java virtual machine (JVM) based on its string name that is passed into the method. Connection: Connection is a interface. It allows to establish connection between data source and application i.e program written by the user. Connection interface helps by providing the different methods for transactions and error handling. Different approaches can be used to establish a connection with the database. 1. DriverManager.getConnection (string url) 2. DriverManager.getConnection (string url, String user,Stringurl) 3. Connection con= DriverManager.getConnection (string url)
  • 4. Explain necessity of JDBC-ODBC bridge driver i. The JDBC type1 driver, also known as the JDBC-ODBC bridge, is a database driver implementation that employs the ODBC driver to connect to the database. ii. The driver converts JDBC method calls into ODBC function calls. iii. The driver is platform-dependent as it makes use of ODBC which in turn depends on native libraries of the underlying operating system the JVM is running upon. iv. Also, use of this driver leads to other installation dependencies; for example, ODBC must be installed on the computer having the driver and the database must support an ODBC driver. v. The use of this driver is discouraged if the alternative of a pure-Java driver is available. vi. The other implication is that any application using a type 1 driver is non-portable given the binding between the driver and platform. vii. This technology isn't suitable for a high-transaction environment. Type 1 drivers also don't support the complete Java command set and are limited by the functionality of the ODBC driver.