SlideShare une entreprise Scribd logo
1  sur  10
www.javaelearn.com

(USA) 609-308-7395

JAVA DATABASE CONNECTIVITY
[JDBC]
JDBC was designed to be very compact, simple interface focusing on the
execution of raw SQL statements and retrieving the results. The goal of
creating JDBC is to create an interface that keeps simple tasks, while
ensuring the more difficult and uncommon tasks are at least made
possible.

The following are the characteristics of JDBC:
 It is a call-level SQL interface for java
 It does not restrict the type of queries passed to an underlying DBMS
driver
 JDBC mechanism are simple to understand and use
 It provides a java interface that stays consistent with the rest of the
Java system
 JDBC may be implemented on top of common SQL level APIs.

Microsoft ODBC API offers connectivity to almost all databases on all
platforms and is the most widely used programming interface for accessing
relational database. But ODBC [open database connectivity] cannot be
directly used with java programs. Hence the need for JDBC came into
existence.
It is possible to access various relational databases like Sybase, Oracle,
Informix, Ingers, using JDBC API. Using JDBC, we can write individual
programs to connect to individual database or one program that take care
of connecting to the respective database.

REGISTER FOR A FREE DEMO

javaelearn@gmail.com
www.javaelearn.com

(USA) 609-308-7395

 JAVA and JDBC
The combination of java with JDBC is very useful because it lets the
programmer run his/her program on different platforms, Java programs are
secure, robust, automatically downloaded from the network and java is a
good language to create database applications.
JDBC API enables Java applications to interact with different types of
database. It is possible to publish vital information from a remote database
on a web page using a java applet. With increasing inclination of
programmers towards Java, knowledge about JDBC is essential.
Some of the advantages of using Java with JDBC are as follows:





Easy and economical
Continued usage of already installed databases
Development time is short
Installation and version control simplified

 How does JDBC work?
JDBC defines a set of API objects and methods to interact with the
underlying database. A Java program first opens a connection to the
database, makes a statement object, passes SQL statements to the
underlying database management system (DBMS) through the statement
object and retrieve the results as well as information about the result set.
There are two types of interfaces
 low –level interface
 high-level interface.

REGISTER FOR A FREE DEMO

javaelearn@gmail.com
www.javaelearn.com

(USA) 609-308-7395

While high level interfaces are user-friendly, low-level interfaces are
not user-friendly.
JDBC is a low-level API interface, ie. it used to invoke or call SQL
commands directly. The required SQL statements are passed as
strings to Java methods.
Some of the current trend that are being developed to add more features to
JDBC are embedded SQL for java and direct mapping of relational
database to java classes.
Embedded SQL enables mixing of java into SQL statements. These
statements are translated into JDBC calls using SQL Processor. In this
type of direct mapping of relational database tables to java, each row of the
table becomes an instance of the class and each column value
corresponds to an attribute of that instance. Mapping is being provided that
makes rows of multiple tables to form a java class.

 JDBC VS ODBC
The most widely used interface to access relational database today is
Microsoft‘s ODBC API. ODBC performs similar tasks as that of JDC(Java
Development Connection) and yet JDBC is preferred due to the following
reasons :
 ODBC cannot be directly used with Java because it uses a C
interface. Calls from Java to native C code have a number of
drawbacks in the security, implementation, robustness and automatic
portability of applications.
 ODBC makes use of pointers which have been totally removed from
Java
 ODBC mixes simple and advanced features together and has
complex options for simple queries. But JDBC is designed to keep
things simple while allowing advanced capabilities when required.

REGISTER FOR A FREE DEMO

javaelearn@gmail.com
www.javaelearn.com

(USA) 609-308-7395

 JDBC API is a natural Java Interface and is built on ODBC. JDBC
retains some of the basic features of ODBC like X/Open SQL Call
Level Interface.
 JDBC is to Java programs and ODBC is to programs written in
languages other than Java.
 ODBC is used between applications and JDBC is used by Java
programmers to connect to databases.

 About JDBC:
The JDBC API is in the package java.sql it consists of 8 interfaces, 6
classes and 3 exceptions in JDK1.1.

Interfaces:









CallableStatement
Connection
DatabaseMetaData
Driver
PreparedStatement
ResultSet
ResultSetMetaData
Statement

Classes:







Date
DriverManager
DriverPropertyInfo
Time
Timestamp
Types

REGISTER FOR A FREE DEMO

javaelearn@gmail.com
www.javaelearn.com

(USA) 609-308-7395

Exceptions:
 DataTruncation
 SQLException
 SQLWarning

JDBC DRIVER MODEL

JDBC Driver Types :
There are 4 types of JDBC drivers :
REGISTER FOR A FREE DEMO

javaelearn@gmail.com
www.javaelearn.com

(USA) 609-308-7395

 JDBC Type 1 Driver - They are JDBC-ODBC Bridge drivers i.e,
Translate JDBC into ODBC and use Windows ODBC built in drivers.
They delegate the work of data access to ODBC API. They are the
slowest of all. SUN provides a JDBC/ODBC driver implementation.

 JDBC Type 2 Driver - They mainly use native API for data access ie.
Converts JDBC to data base vendors native SQL calls and provide
Java wrapper classes to be able to be invoked using JDBC drivers
like Type 1 drivers; requires installation of binaries on each client.
 JDBC Type 3 Driver - Translates JDBC to a DBMS independent
network protocol. They are written in 100% Java and use vendor
independent Net-protocol to access a vendor independent remote
listener. This listener in turn maps the vendor independent calls to
vender dependent ones. This extra step adds complexity and
decreases the data access efficiency.
 JDBC Type 4 Driver - They are also written in 100% Java and are
the most efficient among all driver types. It compiles into the
application, applet or servlet; doesn‘t require anything to be installed
on client machine, except JVM. It also converts JDBC directly to
native API used by the RDBMS.

The JDBC API supports both two-tier and three-tier processing models for
database access.

 Two-tier Architecture for Data Access

REGISTER FOR A FREE DEMO

javaelearn@gmail.com
www.javaelearn.com

(USA) 609-308-7395

In the two-tier model, a Java application talks directly to the data source.
This requires a JDBC driver that can communicate with the particular data
source being accessed.
A user's commands are delivered to the database or other data source,
and the results of those statements are sent back to the user. The data
source may be located on another machine to which the user is connected
via a network.
This is referred to as a client/server configuration, with the user's machine
as the client, and the machine housing the data source as the server. The
network can be an intranet, which, for example, connects employees within
a corporation, or it can be the Internet.

 Three-tier Architecture for Data Access:

REGISTER FOR A FREE DEMO

javaelearn@gmail.com
www.javaelearn.com

(USA) 609-308-7395

In the three-tier model, commands are sent to a "middle tier" of services,
which then sends the commands to the data source. The data source
processes the commands and sends the results back to the middle tier,
which then sends them to the user. MIS directors find the three-tier model
very attractive because the middle tier makes it possible to maintain control
over access and the kinds of updates that can be made to corporate data.
Another advantage is that it simplifies the deployment of applications.
Finally, in many cases, the three-tier architecture can provide performance
advantages.
Until recently, the middle tier has often been written in languages such as C
or C++, which offer fast performance. However, with the introduction of
optimizing compilers that translate Java byte code into efficient machinespecific code and technologies such as Enterprise JavaBeans™, the Java
platform is fast becoming the standard platform for middle-tier
development. This is a big plus, making it possible to take advantage of
Java's robustness, multithreading, and security features.
With enterprises increasingly using the Java programming language for
writing server code, the JDBC API is being used more and more in the
middle tier of a three-tier architecture. Some of the features that make
JDBC a server technology are its support for connection pooling,
distributed transactions, and disconnected row sets. The JDBC API is also
what allows access to a data source from a Java middle tier.

 SQL CONFORMANCE
Structured Query Language (SQL) is the standard language used to
access relational databases, unfortunately, there are no standards set at
present for it for ex, problems may arise due to the variations in different
data types of different databases. JDBC defines a set of generic SWL types
identifiers in the class Java.SQL.Types
Ways of dealing with SQL conformance
REGISTER FOR A FREE DEMO

javaelearn@gmail.com
www.javaelearn.com

(USA) 609-308-7395

JDBC deals with SQL conformance by performing the following :
 JDBC API allows any query string to be passed through to an
underlying DBMS driver. But there are possibilities of getting an error
on some DBMS.
 Provision of ODBC style escape closes.
 Provision of descriptive information about the DBMS using an
interface, DatabaseMetaData.

 The designation JDBC Compliant was created to set a standard level
of JDBC functionality on which users can rely. Only the ANSI SQL 2
entry level supported drivers can make use of this designation.
 The conformance tests check for the existence of all classes and
methods defined in the JDBC API and SQL entry level functionality.

 Types of Driver Managers
JDBC contains three components:
1. Application,
2. Driver Manager,
3. Driver.
The user application invokes JDBC methods to send SQL statements to
the database and retrieves results. JDBC driver manager is used to
connect Java applications to the correct JDBC driver . JDBC driver test
suite is used to ensure that the installed JDBC driver is JDBC Compliant.

There are four different types of JDBC drivers as follows
1. The JDBC-ODBC Bridge plus ODBC driver :

REGISTER FOR A FREE DEMO

javaelearn@gmail.com
www.javaelearn.com

(USA) 609-308-7395

The JDBC-ODBC Bridge plus ODBC driver is a JavaSoft Bridge protocol
that provides JDBC access via ODBC drivers. But as we have mentioned
earlier, combining ODBC brings in a lot of drawbacks and limitations, since
the ODBC driver has to be installed on each client machine, it is not
advisable to choose this type of driver for large networks.
2. Native-API partly-Java driver :
Native-API partly-Java driver converts JDBC calls into calls on the client
API for Oracle, Sybase, Informix or other DBMS. But some binary code has
to be loaded on all client like the bridge driver and hence is not suitable for
large networks.

3. JDBC-Net pure Java driver:
JDBC-Net pure Java driver translates JDBC calls into DBMS independent
net protocol. A server again translates this protocol to a DBMS protocol.
The net server middleware connects its pure Java clients to many different
databases. The type of protocol in this middleware depends on the vendor.
4. Native-protocol pure Java driver :
Native-protocol pure Java driver convert JDBC calls to network protocols
used by the DBMSs directly. Requests from client machines are made
directly to the DBMS server.
Drivers 3 and 4 are the most preferred ways to access databases from
JDBC drivers

REGISTER FOR A FREE DEMO

javaelearn@gmail.com

Contenu connexe

En vedette

En vedette (9)

Week 12 CSS - Review from last week
Week 12 CSS - Review from last weekWeek 12 CSS - Review from last week
Week 12 CSS - Review from last week
 
JDBC – Java Database Connectivity
JDBC – Java Database ConnectivityJDBC – Java Database Connectivity
JDBC – Java Database Connectivity
 
JDBC Java Database Connectivity
JDBC Java Database ConnectivityJDBC Java Database Connectivity
JDBC Java Database Connectivity
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Agile Development | Agile Process Models
Agile Development | Agile Process ModelsAgile Development | Agile Process Models
Agile Development | Agile Process Models
 
Java RMI Presentation
Java RMI PresentationJava RMI Presentation
Java RMI Presentation
 
Java servlet life cycle - methods ppt
Java servlet life cycle - methods pptJava servlet life cycle - methods ppt
Java servlet life cycle - methods ppt
 
Jdbc Ppt
Jdbc PptJdbc Ppt
Jdbc Ppt
 
Gsm bss kpi analysis
Gsm bss kpi analysisGsm bss kpi analysis
Gsm bss kpi analysis
 

Dernier

Dernier (20)

Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 

Java database connectivity (JDBC)

  • 1. www.javaelearn.com (USA) 609-308-7395 JAVA DATABASE CONNECTIVITY [JDBC] JDBC was designed to be very compact, simple interface focusing on the execution of raw SQL statements and retrieving the results. The goal of creating JDBC is to create an interface that keeps simple tasks, while ensuring the more difficult and uncommon tasks are at least made possible. The following are the characteristics of JDBC:  It is a call-level SQL interface for java  It does not restrict the type of queries passed to an underlying DBMS driver  JDBC mechanism are simple to understand and use  It provides a java interface that stays consistent with the rest of the Java system  JDBC may be implemented on top of common SQL level APIs. Microsoft ODBC API offers connectivity to almost all databases on all platforms and is the most widely used programming interface for accessing relational database. But ODBC [open database connectivity] cannot be directly used with java programs. Hence the need for JDBC came into existence. It is possible to access various relational databases like Sybase, Oracle, Informix, Ingers, using JDBC API. Using JDBC, we can write individual programs to connect to individual database or one program that take care of connecting to the respective database. REGISTER FOR A FREE DEMO javaelearn@gmail.com
  • 2. www.javaelearn.com (USA) 609-308-7395  JAVA and JDBC The combination of java with JDBC is very useful because it lets the programmer run his/her program on different platforms, Java programs are secure, robust, automatically downloaded from the network and java is a good language to create database applications. JDBC API enables Java applications to interact with different types of database. It is possible to publish vital information from a remote database on a web page using a java applet. With increasing inclination of programmers towards Java, knowledge about JDBC is essential. Some of the advantages of using Java with JDBC are as follows:     Easy and economical Continued usage of already installed databases Development time is short Installation and version control simplified  How does JDBC work? JDBC defines a set of API objects and methods to interact with the underlying database. A Java program first opens a connection to the database, makes a statement object, passes SQL statements to the underlying database management system (DBMS) through the statement object and retrieve the results as well as information about the result set. There are two types of interfaces  low –level interface  high-level interface. REGISTER FOR A FREE DEMO javaelearn@gmail.com
  • 3. www.javaelearn.com (USA) 609-308-7395 While high level interfaces are user-friendly, low-level interfaces are not user-friendly. JDBC is a low-level API interface, ie. it used to invoke or call SQL commands directly. The required SQL statements are passed as strings to Java methods. Some of the current trend that are being developed to add more features to JDBC are embedded SQL for java and direct mapping of relational database to java classes. Embedded SQL enables mixing of java into SQL statements. These statements are translated into JDBC calls using SQL Processor. In this type of direct mapping of relational database tables to java, each row of the table becomes an instance of the class and each column value corresponds to an attribute of that instance. Mapping is being provided that makes rows of multiple tables to form a java class.  JDBC VS ODBC The most widely used interface to access relational database today is Microsoft‘s ODBC API. ODBC performs similar tasks as that of JDC(Java Development Connection) and yet JDBC is preferred due to the following reasons :  ODBC cannot be directly used with Java because it uses a C interface. Calls from Java to native C code have a number of drawbacks in the security, implementation, robustness and automatic portability of applications.  ODBC makes use of pointers which have been totally removed from Java  ODBC mixes simple and advanced features together and has complex options for simple queries. But JDBC is designed to keep things simple while allowing advanced capabilities when required. REGISTER FOR A FREE DEMO javaelearn@gmail.com
  • 4. www.javaelearn.com (USA) 609-308-7395  JDBC API is a natural Java Interface and is built on ODBC. JDBC retains some of the basic features of ODBC like X/Open SQL Call Level Interface.  JDBC is to Java programs and ODBC is to programs written in languages other than Java.  ODBC is used between applications and JDBC is used by Java programmers to connect to databases.  About JDBC: The JDBC API is in the package java.sql it consists of 8 interfaces, 6 classes and 3 exceptions in JDK1.1. Interfaces:         CallableStatement Connection DatabaseMetaData Driver PreparedStatement ResultSet ResultSetMetaData Statement Classes:       Date DriverManager DriverPropertyInfo Time Timestamp Types REGISTER FOR A FREE DEMO javaelearn@gmail.com
  • 5. www.javaelearn.com (USA) 609-308-7395 Exceptions:  DataTruncation  SQLException  SQLWarning JDBC DRIVER MODEL JDBC Driver Types : There are 4 types of JDBC drivers : REGISTER FOR A FREE DEMO javaelearn@gmail.com
  • 6. www.javaelearn.com (USA) 609-308-7395  JDBC Type 1 Driver - They are JDBC-ODBC Bridge drivers i.e, Translate JDBC into ODBC and use Windows ODBC built in drivers. They delegate the work of data access to ODBC API. They are the slowest of all. SUN provides a JDBC/ODBC driver implementation.  JDBC Type 2 Driver - They mainly use native API for data access ie. Converts JDBC to data base vendors native SQL calls and provide Java wrapper classes to be able to be invoked using JDBC drivers like Type 1 drivers; requires installation of binaries on each client.  JDBC Type 3 Driver - Translates JDBC to a DBMS independent network protocol. They are written in 100% Java and use vendor independent Net-protocol to access a vendor independent remote listener. This listener in turn maps the vendor independent calls to vender dependent ones. This extra step adds complexity and decreases the data access efficiency.  JDBC Type 4 Driver - They are also written in 100% Java and are the most efficient among all driver types. It compiles into the application, applet or servlet; doesn‘t require anything to be installed on client machine, except JVM. It also converts JDBC directly to native API used by the RDBMS. The JDBC API supports both two-tier and three-tier processing models for database access.  Two-tier Architecture for Data Access REGISTER FOR A FREE DEMO javaelearn@gmail.com
  • 7. www.javaelearn.com (USA) 609-308-7395 In the two-tier model, a Java application talks directly to the data source. This requires a JDBC driver that can communicate with the particular data source being accessed. A user's commands are delivered to the database or other data source, and the results of those statements are sent back to the user. The data source may be located on another machine to which the user is connected via a network. This is referred to as a client/server configuration, with the user's machine as the client, and the machine housing the data source as the server. The network can be an intranet, which, for example, connects employees within a corporation, or it can be the Internet.  Three-tier Architecture for Data Access: REGISTER FOR A FREE DEMO javaelearn@gmail.com
  • 8. www.javaelearn.com (USA) 609-308-7395 In the three-tier model, commands are sent to a "middle tier" of services, which then sends the commands to the data source. The data source processes the commands and sends the results back to the middle tier, which then sends them to the user. MIS directors find the three-tier model very attractive because the middle tier makes it possible to maintain control over access and the kinds of updates that can be made to corporate data. Another advantage is that it simplifies the deployment of applications. Finally, in many cases, the three-tier architecture can provide performance advantages. Until recently, the middle tier has often been written in languages such as C or C++, which offer fast performance. However, with the introduction of optimizing compilers that translate Java byte code into efficient machinespecific code and technologies such as Enterprise JavaBeans™, the Java platform is fast becoming the standard platform for middle-tier development. This is a big plus, making it possible to take advantage of Java's robustness, multithreading, and security features. With enterprises increasingly using the Java programming language for writing server code, the JDBC API is being used more and more in the middle tier of a three-tier architecture. Some of the features that make JDBC a server technology are its support for connection pooling, distributed transactions, and disconnected row sets. The JDBC API is also what allows access to a data source from a Java middle tier.  SQL CONFORMANCE Structured Query Language (SQL) is the standard language used to access relational databases, unfortunately, there are no standards set at present for it for ex, problems may arise due to the variations in different data types of different databases. JDBC defines a set of generic SWL types identifiers in the class Java.SQL.Types Ways of dealing with SQL conformance REGISTER FOR A FREE DEMO javaelearn@gmail.com
  • 9. www.javaelearn.com (USA) 609-308-7395 JDBC deals with SQL conformance by performing the following :  JDBC API allows any query string to be passed through to an underlying DBMS driver. But there are possibilities of getting an error on some DBMS.  Provision of ODBC style escape closes.  Provision of descriptive information about the DBMS using an interface, DatabaseMetaData.  The designation JDBC Compliant was created to set a standard level of JDBC functionality on which users can rely. Only the ANSI SQL 2 entry level supported drivers can make use of this designation.  The conformance tests check for the existence of all classes and methods defined in the JDBC API and SQL entry level functionality.  Types of Driver Managers JDBC contains three components: 1. Application, 2. Driver Manager, 3. Driver. The user application invokes JDBC methods to send SQL statements to the database and retrieves results. JDBC driver manager is used to connect Java applications to the correct JDBC driver . JDBC driver test suite is used to ensure that the installed JDBC driver is JDBC Compliant. There are four different types of JDBC drivers as follows 1. The JDBC-ODBC Bridge plus ODBC driver : REGISTER FOR A FREE DEMO javaelearn@gmail.com
  • 10. www.javaelearn.com (USA) 609-308-7395 The JDBC-ODBC Bridge plus ODBC driver is a JavaSoft Bridge protocol that provides JDBC access via ODBC drivers. But as we have mentioned earlier, combining ODBC brings in a lot of drawbacks and limitations, since the ODBC driver has to be installed on each client machine, it is not advisable to choose this type of driver for large networks. 2. Native-API partly-Java driver : Native-API partly-Java driver converts JDBC calls into calls on the client API for Oracle, Sybase, Informix or other DBMS. But some binary code has to be loaded on all client like the bridge driver and hence is not suitable for large networks. 3. JDBC-Net pure Java driver: JDBC-Net pure Java driver translates JDBC calls into DBMS independent net protocol. A server again translates this protocol to a DBMS protocol. The net server middleware connects its pure Java clients to many different databases. The type of protocol in this middleware depends on the vendor. 4. Native-protocol pure Java driver : Native-protocol pure Java driver convert JDBC calls to network protocols used by the DBMSs directly. Requests from client machines are made directly to the DBMS server. Drivers 3 and 4 are the most preferred ways to access databases from JDBC drivers REGISTER FOR A FREE DEMO javaelearn@gmail.com