- JDBC(Java Database Connectivity) API is provided by sun-micro system for the communication between a java application and database server in loosely coupled manner.
- JDBC API consist of interfaces helper class and very few implementation classes.
- JDBC API is available in rt.jar file which is present in jar system library.
- JDBC API is distributed into two packages:
- Java.sql.package
- Javax.sql.package
- The basic feature of JDBC API are available in Java.sql.package. Extended feature of JDBC are available in javax.sql.package.
- JDBC API is not required to be impoted because. It is available in rt.jar file. Since rt.jar file is already imported in jre system library.
- Imported interfaces of JDBC API:-
- Driver
- Connection
- Statement
- Prepared statement
- Callable statement
- Database meta data
- Resultset meta data
- Result set
- JDBC driver is implementation of JDBC API.
- JDBC driver consists of implementation class of interfaces of JDBC API.
- JDBC driver will be provided by specific DB vendor in a form .jar file.
- JDBC driver should be imported while developing the application.
Steps of JDBC:
- Load and register the driver.
- Establish a connection with database server.
- Create statement or platform.
- Execute Sql statement and Query
- Process resultant data.
- Close the costly resources in finally block.
No comments:
Post a Comment