Thursday, 17 January 2013

Introduction to JDBC


Introduction to JDBC 


What is JDBC API?

JDBC API provides ways for Java applications to communicate with databases.

JDBC Architecture



  • Java application that needs to communicate with database has to be programmed with JDBC API.
  • The DriverManager class defines objects which can connect Java applications to a JDBC driver
  • JDBC driver will support Data source like oracle, mySQL and SQl.


Two Tier Architecture


  • A Java application / Applet will directly communicate with data source.
  • 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.

 Three Tier Architecture

  • 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. 
  • The data source may be located on another machine to which the user is connected via a network. 
  • Advantages 
    • Middle tier has control over access and updates. 
    • Simplifies deployment 
    • Performance advantages

No comments:

Post a Comment