JDBC:
Introduction:
JDBC provides set of standard Java API’s for
connecting and performing transactions with RDBMS. Thus provides flexibility to
java developers from switching to different data bases in the project life cycle
without much effort.
Following are key components of JDBC
1)
JDBC
Driver:
JDBC
Driver provides set of concrete classes that implement the interfaces defined
by the JDBC API to interact with RDBMS. Each RDMS vendors have to implement
certain interfaces defined by JDBC, thus each vendor comes up with his own JDBC
driver implementation. For example MYSQL gives us their implementation of JDBC
drivers and oracle comes up with its own implementation of the drivers. Thus
this coding for interfaces provides the flexibility of changing the RDMS on the
fly without much effort.
2) Connections:
After
the JDBC driver is loaded, the next step is to make connection to Database server.
We can do this by obtaining the connection object of the JDBC API.
3) Result Set:
Once
we do a Read operation or a SELECT query on the RDBMS we get the result set
containing the set of records for a particular query.
standard imposed by SUN
through these interfaces. This provides more flexibility as the data base can
be changed without any / much changes to the source code and also the
performance is much better compared to other Driver types. No need to mention
that being a pure java implementation this makes the DB application platform
independent.
No comments:
Post a Comment