Thursday, December 7, 2017

JDBC API

  • 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:-
  1. Driver
  2. Connection
  3. Statement
  4. Prepared statement
  5. Callable statement
  6. Database meta data
  7. Resultset meta data
  8. 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:

  1. Load and register the driver.
  2. Establish a connection with database server.
  3. Create statement or platform.
  4. Execute Sql statement and Query
  5. Process resultant data.
  6. Close the costly resources in finally block.


No comments:

Post a Comment