Presentation is loading. Please wait.

Presentation is loading. Please wait.

JDBC Vs. Java Blend Presentation by Gopal Manchikanti Shivakumar Balasubramanyam.

Similar presentations

Presentation on theme: "JDBC Vs. Java Blend Presentation by Gopal Manchikanti Shivakumar Balasubramanyam."— Presentation transcript:

1 JDBC Vs. Java Blend Presentation by Gopal Manchikanti Shivakumar Balasubramanyam

2 JDBC Technology

3 INTRODUCTION Structured Query Language(SQL) Microsoft’s ODBC Need for JDBC About JDBC

4 SQL Used to Create,Manipulate,Examine and Manage Databases Application Specific Language Unsuitable as a General Application Language Another Language Needed for Visual Display and Report Generation

5 ODBC Microsoft Product C-Based Interface to SQL-Based Databases Provides a consistent Interface for communicating

6 WHY JDBC? ODBC not appropriate for direct use from Java Translation of ODBC API into Java API - Not Desirable ODBC is hard to Learn JDBC is needed to enable a “pure Java” solution

7 JDBC Creates a Interface for communicating with Databases Based on the X/Open SQL Call Level Interface Allows Reuse of Database Connections - Connection Pooling Useful in Accessing data across incompatible DBMS

8 JDBC Easy to Learn and Use Provides a truly portable solution to writing Database Applications Talk to a variety of Databases Maintain the Security, Robustness and Portability

9 JDBC Architecture JDBC API for Application Writers JDBC API for Driver Writers JDBC - Two-Tier and Three-Tier Models JDBC URL’s

10 The JDBC API Establish a Connection with a Database java.sql.Environment - allows creation of new database connections Send SQL statements java.sql.Statement - container class for embedded SQL statements Process the results java.sql.ResultSet - access control to results of a statement

11 JDBC API Client DataBase Sever Application GUI JDBC API Network Interface Network Connection SQL Requests SQL Results

12 JDBC Drivers JDBC requires drivers to connect with individual Databases Types of Drivers: 1.JDBC-ODBC bridge 2.Partial Java Driver 3.Pure Java driver for database middle ware 4.Direct-to-database pure Java driver

13 Two-tier and Three-tier Models JDBC supports both two-tier and three-tier models for database access Two-tier Model : Applet/Application talks directly to the database Requires a JDBC driver that can communicate with the database Referred to as Client/Server Configuration

14 Client/Server Model Client DataBase Sever Application GUI JDBC Driver Network Interface Network Connection SQL Requests SQL Results Network Interface

15 Two-tier and Three-tier Models Three-tier Model : Commands and Results sent to “middle tier” of services Attractive as it maintains control on the accesses and updates User can use a easy-to-use higher-level API Middle-tier implemented in Java gives advantages of Robustness, Multithreading and Security features

16 Three-Tier Model Client DataBase Sever Application GUI JDBC Driver(Cl) Network Interface JDBC Driver(ser)Database Lib. Network Interface Network A Network B MIDDLE WARE

17 JDBC URL’s Way of Identifying a database Appropriate Driver recognizes it and establishes a connection Allow driver writers to encode all necessary connection information Allow a level of indirection Standard syntax: jdbc: :

18 Driver Manager DriverManager class maintains a list of Driver classes Driver classes need to register with the Driver Manager Registration is done automatically by the driver when it loaded Allows Keeping Track of Available Drivers

19 Connecting-Talking-Processing A Connection Object represents a connection with a database A Connection Session includes Statements executed and Results got DriverManager.getConnection() - Standard way to establish connection The method takes a string containing a URL DriverManager tries to use each of the drivers in the order of registration

20 Connecting - Talking-Processing DriverManager tests the drivers by calling the Driver.connect The first driver that recognizes the URL makes the connection Mechanism for reading and writing data between Java and SQL JDBC define a set of generic SQL type identifiers Dynamic Data Access

21 SECURITY Issues Restriction from opening Network Connections DataBase needs to reside on the WebServer

22 Key Features of JDBC Full Access to Metadata No Installation Database Connection Identified by URL Connection Pooling and Distributed Transactions

23 Advantages of JDBC Leverage Existing Enterprise Data Simplified Enterprise Development Zero Configuration for Network Computers For e-commerce applications running on the Internet Gives all advantages of Java like Portability, Security and Robustness

24 FURTHER Advancements JDBC is a base for Higher-Level APIs Higher-Level APIs on top of JDBC : An embedded SQL for Java - allows mixing SQL statements within Java Direct Mapping of Relational Database tables to Java classes.(Java Blend)

Download ppt "JDBC Vs. Java Blend Presentation by Gopal Manchikanti Shivakumar Balasubramanyam."

Similar presentations

Ads by Google