Explain JDBC architectures and components with suitable and brief description.

 JDBC Architecture

The JDBC API supports both two-tier and three-tier processing models for database access but in general JDBC Architecture consists of two layers:

a) JDBC API: This provides the application-to-JDBC Manager connection.

b)  JDBC Driver API: This supports the JDBC Manager-to-Driver Connection.


Description:

Application: It is a java applet or a servlet that communicates with a data source.

The JDBC API: The JDBC API allows Java programs to execute SQL statements and retrieve results. Some of the important classes and interfaces defined in JDBC API are as follows:

  • DriverManager
  • Driver
  • Connection
  • Statement
  • PreparedStatement
  • CallableStatement
  • ResultSet
  • SQL data

DriverManager: It plays an important role in the JDBC architecture.It uses some database-specific drivers to effectively connect enterprise applications to databases.

JDBC drivers: To communicate with a data source through JDBC, you need a JDBC driver that intelligently communicates with the respective data source.

Common JDBC Components

The JDBC API provides the following interfaces and classes:

DriverManager: This class manages a list of database drivers. Matches connection requests from the java application with the proper database driver. 

Driver: This interface handles the communications with the database server. We interact directly with Driver objects very rarely. Instead, we use DriverManager objects, which manage objects of this type. It also abstracts the details associated with working with Driver objects.

Connection: This interface with all methods for contacting a database. All communication with the database is done through the connection object only.

Statement: We use objects created from this interface to submit the SQL statements to the database.

ResultSet: These objects hold data retrieved from a database after we execute an SQL query using Statement objects. It acts as an iterator to allow us to move through its data. 

SQLException: This is the subclass of the Exception class and handles any errors that occur in a database application.

                  OR,

Components of JDBC

There are generally four main components of JDBC through which it can interact with a database. They are as mentioned below:

JDBC API: It provides various methods and interfaces for easy communication with the database. It provides two packages as follows which contain the java SE and Java EE platforms to exhibit WORA(write once run everywhere) capabilities.

1. java.sql.*;

2. javax.sql.*;

It also provides a standard to connect a database to a client application.


JDBC Driver manager: It loads a database-specific driver in an application to establish a connection with a database. It is used to make a database-specific call to the database to process the user request.

JDBC Test suite: It is used to test the operation(such as insertion, deletion, updation) being performed by JDBC Drivers.

JDBC-ODBC Bridge Drivers: It connects database drivers to the database. This bridge translates the JDBC method call to the ODBC function call.It makes the use of

sun.jdbc.odbc

the package that includes a native library to access ODBC characteristics.

Comments

Popular posts from this blog

Suppose that a data warehouse for Big-University consists of the following four dimensions: student, course, semester, and instructor, and two measures count and avg_grade. When at the lowest conceptual level (e.g., for a given student, course, semester, and instructor combination), the avg_grade measure stores the actual course grade of the student. At higher conceptual levels, avg_grade stores the average grade for the given combination. a) Draw a snowflake schema diagram for the data warehouse. b) Starting with the base cuboid [student, course, semester, instructor], what specific OLAP operations (e.g., roll-up from semester to year) should one perform in order to list the average grade of CS courses for each BigUniversity student. c) If each dimension has five levels (including all), such as “student < major < status < university < all”, how many cuboids will this cube contain (including the base and apex cuboids)?

Suppose that a data warehouse consists of the four dimensions; date, spectator, location, and game, and the two measures, count and charge, where charge is the fee that a spectator pays when watching a game on a given date. Spectators may be students, adults, or seniors, with each category having its own charge rate. a) Draw a star schema diagram for the data b) Starting with the base cuboid [date; spectator; location; game], what specific OLAP operations should perform in order to list the total charge paid by student spectators at GM Place in 2004?

Explain market-Oriented Cloud computing architecture.