JDBC, it stands for Java Database connectivity and it is an API released by sun microsystems now it is part of oracle. before going to jdbc see about jdbc let's have a small chitchat about Files and Database servers. Why we prefer Database servers to store the data instead of files.Here by using files we have soo many disadvantages like security,and limit to certain amount of data storage.
So, to resolve above issues we will go for Database servers,Now come out from this topic.Now see about JDBC , once Public API released into market anybody can provide the implementation, like way Sun microsystems provided Open JDBC API specification to interact with any database by using java application.So anybody can provide the implementation.Means API provides set of rules and regulations to implement S/W So based upon JDBC ApI Specification vendor companies can develop JDBC drivers.Then by using JDBC drivers we can interact with database servers, So JDBC driver will act as bridge between java application and Database s/w that converts java calls nothing but instructions to Database s/w and vice versa.
So every vendor will have seperate driver like Oracle ,MYSQL,DB2... have look at below picture for .how java application will interact with database
Jdbc specification gives jdbc API in the form of 2 packages representing rules and guide lines to develop jdbc drivers they are:
1) java.sql.*;
This package contains following classes and interfaces
classes:-
--------
DriverManager
types
Date
time, e.t.c...
interfaces:-
--------------
connection
driver
statement
PreparedStatement
callableStatement
Resultset
DatabaseMetaData
ResultsetMetaData, e.t.c....
2) javax.sql.*;
this package contains following classes and interfaces
classes:-
--------
ConnectionEvet
RowsetEvent
StatementEvent
interfaces:-
------------
Rowset
pooledConnecton
DataSource, e.t.c....
Implementing interfaces given in the above 2 packages is not the responsibilities of developer it is the responsibility vendor company who develops JDBC Driver.
JDBC contains different type of drivers those are:-
1) Type1 Driver(jdbcOdbc Bridge driver)
2) Type2 Driver(native API java driver)
3) Type3 Driver(net-protocol//all java driver)
4) Type4 Driver(pure java based driver)

0 comments:
Post a Comment