Comment

tpr
java,
March 31, 2008 at 2:32 PM

Understanding the JDBC Architecture


JDBC is an API specification developed by Sun Microsystems that defines a uniform interface for accessing various relational databases. JDBC is a core part of the Java platform and is included in the standard JDK distribution.

The primary function of the JDBC API is to provide a means for the developer to issue SQL statements and process the results in a consistent, database-independent manner. JDBC provides rich, object-oriented access to databases by defining classes and interfaces that represent objects such as:

Database connections
SQL statements
Result Set
Database metadata
Prepared statements
Binary Large Objects (BLOBs)
Character Large Objects (CLOBs)
Callable statements
Database drivers
Driver manager
The JDBC API uses a Driver Manager and database-specific drivers to provide transparent connectivity to heterogeneous databases. The JDBC driver manager ensures that the correct driver is used to access each data source. The Driver Manager is capable of supporting multiple concurrent drivers connected to multiple heterogeneous databases. The location of the driver manager with respect to the JDBC drivers and the servlet is shown in Figure 1.

Layers of the JDBC Architecture



A JDBC driver translates standard JDBC calls into a network or database protocol or into a database library API call that facilitates communication with the database. This translation layer provides JDBC applications with database independence. If the back-end database changes, only the JDBC driver need be replaced with few code modifications required. There are four distinct types of JDBC drivers.

Type 1 JDBC-ODBC Bridge. Type 1 drivers act as a "bridge" between JDBC and another database connectivity mechanism such as ODBC. The JDBC- ODBC bridge provides JDBC access using most standard ODBC drivers. This driver is included in the Java 2 SDK within the sun.jdbc.odbc package. In this driver the java statements are converted to a jdbc statements. JDBC statements calls the ODBC by using the JDBC-ODBC Bridge. And finally the query is executed by the database. This driver has serious limitation for many applications. (See Figure 2.)

Type 1 JDBC Architecture



Type 2 Java to Native API. Type 2 drivers use the Java Native Interface (JNI) to make calls to a local database library API. This driver converts the JDBC calls into a database specific call for databases such as SQL, ORACLE etc. This driver communicates directly with the database server. It requires some native code to connect to the database. Type 2 drivers are usually faster than Type 1 drivers. Like Type 1 drivers, Type 2 drivers require native database client libraries to be installed and configured on the client machine. (See Figure 3.)

Type 2 JDBC Architecture



Type 3 Java to Network Protocol Or All- Java Driver. Type 3 drivers are pure Java drivers that use a proprietary network protocol to communicate with JDBC middleware on the server. The middleware then translates the network protocol to database-specific function calls. Type 3 drivers are the most flexible JDBC solution because they do not require native database libraries on the client and can connect to many different databases on the back end. Type 3 drivers can be deployed over the Internet without client installation. (See Figure 4.)
Java-------> JDBC statements------> SQL statements ------> databases.

Type 3 JDBC Architecture



Type 4 Java to Database Protocol. Type 4 drivers are pure Java drivers that implement a proprietary database protocol (like Oracle's SQL*Net) to communicate directly with the database. Like Type 3 drivers, they do not require native database libraries and can be deployed over the Internet without client installation. One drawback to Type 4 drivers is that they are database specific. Unlike Type 3 drivers, if your back-end database changes, you may save to purchase and deploy a new Type 4 driver (some Type 4 drivers are available free of charge from the database manufacturer). However, because Type drivers communicate directly with the database engine rather than through middleware or a native library, they are usually the fastest JDBC drivers available. This driver directly converts the java statements to SQL statements.

(See Figure 5.)

Type 4 JDBC Architecture



So, you may be asking yourself, "Which is the right type of driver for your application?" Well, that depends on the requirements of your particular project. If you do not have the opportunity or inclination to install and configure software on each client, you can rule out Type 1 and Type 2 drivers.

However, if the cost of Type 3 or Type 4 drivers is prohibitive, Type 1 and type 2 drivers may become more attractive because they are usually available free of charge. Price aside, the debate will often boil down to whether to use Type 3 or Type 4 driver for a particular application. In this case, you may need to weigh the benefits of flexibility and interoperability against performance. Type 3 drivers offer your application the ability to transparently access different types of databases, while Type 4 drivers usually exhibit better performance and, like Type 1 and Type 2 drivers, may be available free if charge from the database manufacturer.



View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
JDBC

Understanding the JDBC Architecture
Understanding the JDBC Architecture   ... databases. JDBC is a core part of the Java platform and is included in the standard JDK... the java statements are converted to a jdbc statements. JDBC statements calls 

Java Beginners

Jdbc
Jdbc  A java program with jdbc connectivity with insert,delete,update options for name,regno,mark1,mark2,total 

Java Beginners

JDBC
JDBC  how to set classpath for eclipse, java, where to copy jdbc connector 

Java Beginners

jdbc
jdbc   how to write program to save data and retrieve data from the form in Java 

JDBC Questions

jdbc
links: http://www.roseindia.net/jdbc/Jdbc-batch-update.shtml http://www.roseindia.net/tutorial/java/jdbc/batchupdateresultsetexample.html...jdbc define batch updates  define batch updates?exp   JDBC 

JDBC Questions

JDBC
between java and mysql using JDBC and saves the data into the database. import...JDBC save a data in the database  I need a code to save a data... con = null; String url = "jdbc:mysql://localhost:3306/"; String db 

JDBC Questions

JDBC
the connection between java and mysql using JDBC and saves the data into the database...JDBC code to save a data in the database  I need a code to save...!"); Connection con = null; String url = "jdbc:mysql://localhost:3306/"; String db 

JDBC Questions

java - JDBC
on JDBC visit to : http://www.roseindia.net/jdbc/understanding-driver-manager.shtml http://www.roseindia.net/jdbc/ Thanks... automatically loaded. The driver is loaded by calling the Class.forName() method. JDBC 

JDBC Questions

jdbc
of ms-access using java application i want to perform both operations of ms-access using jdbc connection   import java.sql.*; public class CreateTable... = DriverManager.getConnection("jdbc:odbc:student"); Class.forName 

SQL Question

JDBC
retrieve the value from database into dropdown list using JDBC SQL 2005  How to retrieve the value from database into dropdown list using JDBC &...").newInstance(); String connectionURL = "jdbc:mysql://localhost:3306/test";; Connection 

JDBC Questions

jdbc - JDBC
Java JDBC application  Database Application in Java JDBC 

JDBC Questions

jdbc
define resulset?define stored procedure? exmp  define resulset?define stored procedure? exmp   ResultSet: ResultSet is a java object... logical group of data with a number of columns. JDBC ResultSet Example Stored 

JDBC Questions

jdbc
how i can access Microsoft Access database by java program  how i can access Microsoft Access database by java program ? if any package or jar file required then please specify it. please give java source code for such database 

Java Beginners

jdbc
jdbc  I compiling my jdbcodbc progrm. D:\Java\jdk1.6.0\bin>javac JdbcExample.java JdbcExample.java:12: cannot find symbol symbol : method...{ Connection con; con=DriverManager.getConnection("jdbc:odbc:student 

Java Beginners

jdbc
jdbc  how can i store the image file and retrive the images from the database using java with querys also   import java.sql.*; import... = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root 

JDBC Questions

JDBC
JDBC  How to connect JAVA Servlet with the database 

JDBC Questions

jdbc
jdbc  write a java program to accept the details of employee(eno,ename,sal)from the user and insert into the database(use awt 

JDBC Questions

jdbc
jdbc  if i create one table that consist of usename ,joiningdate for joining date i have used varchar datatype not date . then we store date into database table as a string by using java .then what are the drawbacks 

Java Beginners

jdbc
jdbc  sir i want a java code which have some method(new a/c(),update a/c(),serchUser(through id ),getuser(id , pass),changePass(id, id)); using oracle 10g thank u 

Java Beginners

jdbc
jdbc  sir i want a java code which have some method(new a/c(),update a/c(),serchUser(through id ),getuser(id , pass),changePass(id, id)); using oracle 10g thank u 

Java Beginners

jdbc
jdbc  sir i want a java code which have some method(new a/c(),update a/c(),serchUser(through id ),getuser(id , pass),changePass(id, id)); using oracle 10g thank u 

Java Beginners

jdbc
jdbc  sir i want a java code which have some method(new a/c(),update a/c(),serchUser(through id ),getuser(id , pass),changePass(id, id)); using oracle 10g thank u 

Java Beginners

jdbc
jdbc  sir i want a java code which have some method(new a/c(),update a/c(),serchUser(through id ),getuser(id , pass),changePass(id, id)); using oracle 10g thank u 

Java Beginners

jdbc
jdbc  sir i want a java code which have some method(new a/c(),update a/c(),serchUser(through id ),getuser(id , pass),changePass(id, id)); using oracle 10g thank u 

Java Beginners

jdbc
jdbc  sir i want a java code which have some method(new a/c(),update a/c(),serchUser(through id ),getuser(id , pass),changePass(id, id)); using oracle 10g thank u 

Java Beginners

jdbc
jdbc  sir i want a java code which have some method(new a/c(),update a/c(),serchUser(through id ),getuser(id , pass),changePass(id, id)); using oracle 10g thank u 

Java Beginners

jdbc
jdbc  sir i want a java code which have some method(new a/c(),update a/c(),serchUser(through id ),getuser(id , pass),changePass(id, id)); using oracle 10g thank u 

JDBC Questions

JDBC - JDBC
Java technology-enabled driver converts JDBC calls into calls on the client API... middleware products.Type 4: JDBC Net pure Java DriverA native-protocol fully Java...explanation of JDBC drivers  Need tutorial on JDBC driversThanks 

JDBC-Tutorials

JDBC Training, Learn JDBC yourself
that helps you in understanding JDBC Connectivity Code in Java. The code include a class... is JDBC? , Product Components of  JDBC, Understanding JDBC..., New Features in JDBC 4.0 and More APIs Become Available. Understanding 

JDBC Questions

JDBC - JDBC
JDBC  i am goint to work on JDBC and i knew oracle but very poor in java is it possoble to me to do JDBC is it so please give me SOME SAMPLE ILLUSTRATIONS to understand the way to do work in JDBC with syntaxes  Hi 

JDBC Questions

JDBC - JDBC
JDBC  how to do connectivity with SQL Server and MS Access in java... MSAccess in Java : import java.sql.*; public class... String url = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=D 

JDBC Questions

jdbc - JDBC
drivers for concurrent access?   Question: Is the JDBC-ODBC Bridge multi-threaded? Answer: No. The JDBC-ODBC Bridge does not support concurrent access from different threads. The JDBC-ODBC Bridge uses synchronized methods 

JDBC Questions

jdbc - JDBC
of columns even the developer don't know how many columns,(using java script new text... in JSP to create a table. 2)how desc can be written in JDBC concepts  ... = null; String url = "jdbc:mysql://localhost:3306/"; String db 

JDBC Questions

jdbc - JDBC
."); Connection conn = null; String url = "jdbc:mysql://localhost:3306... on Netbeans and jdbc visit to : http://www.roseindia.net/jdbc/ http://www.roseindia.net/java/java-tips/background/30java_tools/netbeans.shtml Thanks 

JDBC Questions

jdbc - JDBC
jdbc  How to do connectivity with java?  Hi friend... conn = null; String url = "jdbc:mysql://localhost:3306/"; String dbName.../jdbc/ Thanks 

JDBC Questions

JDBC - JDBC
JDBC  how can i do jdbc through oracle.. pls if u can send me d.... thanking u santosh.  Hi Friend, Use JDBC with Oracle Follow these steps: 1) Import the following packages in your java file 

JDBC Questions

jdbc - JDBC
jdbc   kindly give the example program for connecting oracle dase... the following packages in your java file:*********** import java.sql.*; import oracle.jdbc.driver.*; import oracle.sql.*; 2) Load and Register the JDBC 

JDBC Questions

jdbc - JDBC
: http://www.roseindia.net/jdbc/save_image.shtml Retrieve Image using Java... and retrive it using a java program? plz help me with the code.  Hi... = DriverManager.getConnection( "jdbc:mysql://localhost:3306/test", "root", "root 

JDBC

JDBC Tutorial, JDBC API Tutorials
Java Database Connectivity(JDBC) Tutorial This tutorial on JDBC explains you... to use JDBC API effectively to develop database driven applications in Java. You... to JDBC Java database connectivity or JDBC is an interface (API) used 

Java Interview Questions

Java jdbc
Java jdbc  What is JDBC 

Java Interview Questions

Java JDBC
Java JDBC   Is the JDBC-ODBC Bridge multi-threaded 

JDBC

Understanding JDBC warning Methods
.style1 { text-align: center; } .style2 { background-color: #FFFFCC; } JDBC getWarnings() And clearWarnings() In JDBC getWarnings() method is used... = DriverManager.getConnection( "jdbc:mysql://localhost:3306/student", "root 

JDBC Questions

Java - JDBC
Java and JDBC programming  Need to learn the kills to develop the application using java and jdbc 

JDBC

JDBC connection
JDBC connection       The JDBC.... The JDBC includes execution of SQL queries return a result set over... we illustrates you JDBC url connection. The current Tutorial helps you 

JDBC Questions

Jdbc Driver - JDBC
-ODBC Driver)Type 2(java native driver)Type 3Type 4  Type of JDBC..., partly Java driver, also called Type 2. * JDBC-Net, pure Java driver, also called Type 3. * Native-protocol, pure Java driver, also called Type 4.For JDBC 

JDBC Questions

Java JDBC
Java JDBC  How to make pagination using JDBC 

Java Interview Questions

Java JDBC
Java JDBC  What is the fastest type of JDBC driver 

JDBC Questions

java servlets jdbc - JDBC
java servlets jdbc  i am running the servlet program with jdbc connections in this porgram i used two 'esultset' objects.. in this wat ever coding is available in the first resultset is executed like updating and retrieiving 

JDBC

Understanding Data Source
Understanding Data Source       The JDBC API provides the DataSource... source in the Java programming language. DataSouce object is mostly preferred over 

JDBC Questions

JAVA(JDBC) - JDBC
JAVA(JDBC)  Hello friends, please tel me, how can we retrieve..."; String driverName = "com.mysql.jdbc.Driver"; String url = "jdbc:mysql... for more information. http://www.roseindia.net/jdbc/save_image.shtml 

JDBC Questions

jdbc adapter exception - JDBC
jdbc adapter exception  Through JDBC, I connected to MySQL Server... in MySQL through my Java Application. For that I added "?sessionVariables = FOREIGN_KEY_CHECKS = 0" to JDBC URL( i.e., "jdbc:mysql://MyHost/myDB").Modified URL 

JDBC Questions

java - JDBC
java  hello, i have oracle 8i,i am a java-learner, i would like to run a jdbc programs. please tell me the steps how to run the jdbc program  For the complete reference and tutorial on Java Database Connectivity visit 

JDBC Questions

java - JDBC
have to use JDBC and oracle. plz send the details for connecting "java... sending data inserting code into database using JDBC with jsp... for database connectivity: http://www.roseindia.net/jdbc/jdbc-mysql 

JDBC

JDBC Connectivity Code In Java
in understanding JDBC Connectivity Code in Java. In this program, the code... JDBC Connectivity Code In Java      ...;url = "jdbc:mysql://localhost:3306/";    

JDBC Questions

java - JDBC
java  how to get connectoin to database server from mysql through java programme  Hi Friend, Please visit the following link for more detailed information http://www.roseindia.net/jdbc/jdbc-mysql 

JDBC Questions

about jdbc - JDBC
about jdbc  Hello folks, I am very new JDBC. I am doing a project on java messaging service on the part of the project we are using JDBC. In my project i am having two tables one is"person" table and other is"student" table   

JDBC Questions

jdbc-oracle - JDBC
jdbc-oracle  Hi! sub: image insertion in oracle: I inserted the image in oracle database using java through jdbc-odbc bridge driver... though my java program compiles and runs without any error. Pl. answer 

Java Interview Questions

Java JDBC
Java JDBC  Is JDBC-ODBC bridge multi-threaded?  NO. The JDBC-ODBC Bridge uses synchronized methods to serialize all of the calls made.... The JDBC-ODBC Bridge uses synchronized methods to serialize all of the calls 

JDBC

JDBC Drive For Mysql
JDBC Drive For Mysql       In this Tutorial we want to describe you a code that help you in understanding JDBC Drive.... Once the driver is loaded ,you connect the front end of the Java application 

JDBC Questions

JDBC Connectivity - JDBC
JDBC Connectivity  my question is how to connect a Java program with MS-Access database?  Hello Use this code import java.sql.... String filename = "d:/java/mdbTEST.mdb"; String database = "jdbc 

JDBC Questions

JDBC, JAVA
JDBC, JAVA  I want to develop a s/w that will work on a LAN, so is there any need for a server, bcoz I am using database to store information, and these information will be on LAN 

JDBC Questions

java - JDBC
java  how can i connect jdbc with oracle 9i.please give detailed procedure.  Hi Friend, Use JDBC with Oracle Follow these steps: 1) Import the following packages in your java file:*********** import 

JDBC Questions

java jdbc
java jdbc  what is a prepared statement?   Hi Friend, It is a pre compiled form of Statement class. It send sql statements to the database... from the given link: JDBC Tutorials Thanks 

JDBC Questions

java - JDBC
, The JDBC-ODBC Bridge uses synchronized methods to serialize all of the calls that it makes to ODBC. Multi-threaded Java programs may use the Bridge... is the traditional management layer of JDBC, working between the user 

JDBC Questions

JAVA - JDBC
JAVA  WRITE A PROGRAM USING SERVLET AND JDBC FOR DEVELOPING AN ONLINE APPLICATION FOR THE SHOPPING OF COMPUTER SCIENCE BOOK.YOU HAVE TO CREATE... the following links to have sample Servlet and JDBC applications. http 

Hibernate-Tutorials

Hibernate vs JDBC
This section is better understanding of how hibernate is differ from JDBC 

JDBC Questions

jdbc mysql - JDBC
jdbc mysql  import java.sql.*; public class AllTableName...=DriverManager.getConnection("jdbc:mysql://localhost:3306/ram","root","root... this problemm thank u ---------- java ---------- Listing all table name in Database! SDKH 

JDBC Questions

jdbc mysqll - JDBC
jdbc mysqll  import java.sql.*; public class AllTableName{ public...("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnection("jdbc:mysql...(); } } } this is O/P please solve this problemm thank u ---------- java 

Java Beginners

jdbc
jdbc  Hai , Give a steps for jdbc connectivity 

Java Beginners

jdbc
jdbc  display the records using index in jdbc 

JDBC Questions

JDBC
JDBC  why we use batch in jdbc 

JDBC Questions

Java jdbc class.forName error - JDBC
Java jdbc class.forName error  HI: how is possible that my JDBC connection to an MYSQL instance works inside the IDE (Netbeans) and not when I start it from the jar file? Could some please give some pointers please? Higly 

JDBC Questions

java - JDBC
java  How to do connectivity with JDBC on a simple frame ?  Hi friend, Insert into database Insert User Information page User ID 

JDBC Questions

JAVA - JDBC
JAVA  HOW TO CONNECT JDBC IN SERVLET AND HOW TO PREPARE WEB.XML   Hi Friend, Please visit the following links: http://www.roseindia.net/servlets/ServletInsertingData.shtml http://www.roseindia.net/servlets 

JDBC Questions

java - JDBC
java  what is the life of a resultset object  Hi friend, In the JDBC 2.0 core API, the ResultSet interface has a set of new updateXXX..."); ---------------------------------------------- Read for more information. http://www.roseindia.net/jdbc 

JDBC Questions

regarding jdbc - JDBC
regarding jdbc  how to connect mysql with java example you have provided is having some error and i am not able to remove that error please... = DriverManager.getConnection("jdbc:mysql://localhost:3306/yourdatabase", "your username", "your 

JDBC Questions

java - JDBC
metadata  Hi friend, 1. First import the java packages... = "com.mysql.jdbc.Driver"; 3.Creating a jdbc Connection String url = "jdbc.... Creating a jdbc Statement object Statement st = conn.createStatement(); 5 

JDBC Questions

JAVA - JDBC
JAVA  how to store and retrieve an image in a database(ORACLE)using java or JSP?  Hi friend, I am sending you image insert code in jsp using mysql jdbc driver so please change driver name and implement 

JDBC Questions

Java Jdbc
Java Jdbc  sir i want to databse(oracle 10g)connectivity through java through program   Hi Friend, Follow these steps: 1) Import the following packages in your java file: import java.sql.*; import 

JDBC Questions

jdbc java
jdbc java  i have one table in database, now i want to store in notepad these table field, how is it possible through jdbc?   Hi Friend...( "jdbc:mysql://localhost:3306/register", "root", "root 

JDBC Questions

JDBC to EXcel
JDBC to EXcel  How to insert data in excel sheet from java 

Java Interview Questions

Java JDBC driver
Java JDBC driver  What is JDBC Driver 

JDBC Questions

java - JDBC
java   how insert the row through ResultSet using the insertRow()method   Hi Friend, Try the following code: import java.sql.... con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","root 

JDBC Questions

java - JDBC
java  how to store and retrive images from oracle 10g using jdbc..."; String driverName = "com.mysql.jdbc.Driver"; String url = "jdbc:mysql...(); } } ---------------------------------------------------- in this program using jdbc driver, if you 

JDBC Questions

JDBC
JDBC  How to add set of queries in a single query in JDBC 

JDBC Questions

Help on JSP and JDBC - JDBC
Help on JSP and JDBC  Retrieve data from Database in JSP and JDBC...;% Connection con = null; String url = "jdbc:mysql://localhost:3306/"... do this, we are java programmers keep mind 

JDBC Questions

java - JDBC
  Hi Read for more information. http://www.roseindia.net/jdbc... url = "jdbc:mysql://localhost:3306/"; String dbName = "databasename 

JDBC Questions

java - JDBC
available in that particular place in the same page.(by using Oracle and java(jdbc)).... please......It's very important and urgent....  Hi 

Core Java

JDBC
JDBC       JDBC stands for Java Data Base Connectivity that defines how a client may access a database. It is a Java API that enables Java programs to execute SQL statements 

JDBC Questions

java - JDBC
java  how to create a database for java with images in ms access(2007...{ String url="jdbc:odbc:access"; File file=new File("c:\\barbie.jpg...("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection("jdbc:odbc 

JDBC Questions

java - JDBC
java  how to access excel file through jdbc show record in table.... Click "Ok" and restart your compiler. 7. Compile the following java code...("sun.jdbc.odbc.JdbcOdbcDriver"); Connection conn=DriverManager.getConnection("jdbc:odbc:excel 

JDBC Questions

What is JDBC?
  Hi, JDBC stands for Java Database Connectivity. It is a set of API for connecting the database from Java program. JDBC API provides the API... views, Stored procedures from Java program. Learn in detail at JDBC Tutorial page 

JDBC Questions

java - JDBC
= DriverManager.getConnection( "jdbc:mysql://localhost:3306/test", "root", "root 

JDBC Questions

regarding jdbc - JDBC
regarding jdbc  how i can configure java with ms access 

JDBC Questions

java - JDBC
java  How to connect java(jsp) and oracle8i? plz, explain every step included in the process. It's urgent..  Hi friend, Code to help... oracle.jdbc.driver.OracleDriver()); Connection conn = DriverManager.getConnection("jdbc 

JDBC Questions

java - JDBC
= "jdbc:mysql://localhost:3306/"; String dbName = "register" 

JDBC Questions

java - JDBC
= DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root"); Statement st 

JDBC Questions

java - JDBC
conn = DriverManager.getConnection("jdbc:oracle:thin:@training:1521:Oracle 

JDBC Questions

jdbc
jdbc  why do we need to load jdbc drivers before connecting to database 

JDBC Questions

JDBC
JDBC  can u send me the code of jdbc how to join two tables that are in relation 

Advertisements Advertisements
 

 

 

DMCA.com