

Lennart Jorelid



A: The JDBC is used whenever a Java application should communicate with a relational database for which a JDBC driver exists. JDBC is part of the Java platform standard; all visible classes used in the Java/database communication are placed in package java.sql.

JDBC as a mediator between the Java Application and the database

Main JDBC classes:

  • DriverManager. Manages a list of database drivers. Matches connection requests from the java application with the proper database driver using communication subprotocol. The first driver that recognizes a certain subprotocol under jdbc (such as odbc or dbAnywhere/dbaw) will be used to establish a database Connection.
  • Connection. Interface with all methods for contacting a database
  • Statement. Encapsulates an SQL statement which is passed to the database to be parsed, compiled, planned and executed.
  • ResultSet. The answer/result from a statement. A ResultSet is a fancy 2D list which encapsulates all outgoing results from a given SQL query.

JDBC classes normally seen and used by the developer.

0 Comments  (click to add your comment)
Comment and Contribute









About | Sitemap | Contact