ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzaha_5.4.0.1/jdbctydr.htm

95 lines
6.5 KiB
HTML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="concept" />
<meta name="DC.Title" content="Types of JDBC drivers" />
<meta name="abstract" content="This topic defines the Java Database Connectivity (JDBC) driver types. Driver types are used to categorize the technology used to connect to the database. A JDBC driver vendor uses these types to describe how their product operates. Some JDBC driver types are better suited for some applications than others." />
<meta name="description" content="This topic defines the Java Database Connectivity (JDBC) driver types. Driver types are used to categorize the technology used to connect to the database. A JDBC driver vendor uses these types to describe how their product operates. Some JDBC driver types are better suited for some applications than others." />
<meta name="DC.Relation" scheme="URI" content="jdbcgets.htm" />
<meta name="DC.Relation" scheme="URI" content="jdbcreqs.htm" />
<meta name="DC.Relation" scheme="URI" content="jdbctutr.htm" />
<meta name="DC.Relation" scheme="URI" content="dasrjndi.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="jdbctydr" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Types of JDBC drivers</title>
</head>
<body id="jdbctydr"><a name="jdbctydr"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Types of JDBC drivers</h1>
<div><p>This topic defines the Java™ Database Connectivity (JDBC) driver
types. Driver types are used to categorize the technology used to connect
to the database. A JDBC driver vendor uses these types to describe how their
product operates. Some JDBC driver types are better suited for some applications
than others.</p>
<div class="section"><h4 class="sectiontitle">Type 1</h4><p>Type 1 drivers are "bridge" drivers. They
use another technology such as Open Database Connectivity (ODBC) to communicate
with a database. This is an advantage because ODBC drivers exist for many
Relational Database Management System (RDBMS) platforms. The Java Native
Interface (JNI) is used to call ODBC functions from the JDBC driver.</p>
<p>A
Type 1 driver needs to have the bridge driver installed and configured before
JDBC can be used with it. This can be a serious drawback for a production
application. Type 1 drivers cannot be used in an applet since applets cannot
load native code.</p>
</div>
<div class="section"><h4 class="sectiontitle">Type 2</h4><p>Type 2 drivers use a native API to communicate
with a database system. Java native methods are used to invoke the
API functions that perform database operations. Type 2 drivers are generally
faster than Type 1 drivers.</p>
<p>Type 2 drivers need native binary code installed
and configured to work. A Type 2 driver also uses the JNI. You cannot use
a Type 2 driver in an applet since applets cannot load native code. A Type
2 JDBC driver may require some Database Management System (DBMS) networking
software to be installed.</p>
<p>The Developer Kit for Java JDBC
driver is a Type 2 JDBC driver.</p>
</div>
<div class="section"><h4 class="sectiontitle">Type 3</h4><p>These drivers use a networking protocol and
middleware to communicate with a server. The server then translates the protocol
to DBMS function calls specific to DBMS.</p>
<p>Type 3 JDBC drivers are the
most flexible JDBC solution because they do not require any native binary
code on the client. A Type 3 driver does not need any client installation.</p>
</div>
<div class="section"><h4 class="sectiontitle">Type 4</h4><p>A Type 4 driver uses Java to
implement a DBMS vendor networking protocol. Since the protocols are usually
proprietary, DBMS vendors are generally the only companies providing a Type
4 JDBC driver.</p>
<p>Type 4 drivers are all Java drivers. This means that there is no
client installation or configuration. However, a Type 4 driver may not be
suitable for some applications if the underlying protocol does not handle
issues such as security and network connectivity well.</p>
<p>The <a href="../rzahh/jdbc.htm" target="_blank">IBM<sup>®</sup> Toolbox for Java JDBC
driver</a> is a Type 4 JDBC driver, indicating that the API is a pure Java networking
protocol driver.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="jdbcgets.htm" title="The Java Database Connectivity (JDBC) driver shipped with the Developer Kit for Java is called the Developer Kit for Java JDBC driver. This driver is also commonly known as the native JDBC driver.">Get started with JDBC</a></div>
</div>
<div class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="jdbcreqs.htm" title="Before you write and deploy your JDBC applications, you may need to include specific jar files in your classpath.">JDBC requirements</a></div>
</div>
<div class="reltasks"><strong>Related tasks</strong><br />
<div><a href="jdbctutr.htm" title="The following is a tutorial on writing a Java Database Connectivity (JDBC) program and having it run on the an iSeries server with the native JDBC driver. It is designed to show you the basic steps required for your program to run JDBC.">JDBC tutorial</a></div>
<div><a href="dasrjndi.htm" title="DataSources work hand-in-hand with the Java Naming and Directory Interface (JNDI). JNDI is a Java abstraction layer for directory services just as Java Database Connectivity (JDBC) is an abstraction layer for databases.">Use JNDI for the examples</a></div>
</div>
</div>
</body>
</html>