Let’s learn JDBC API Components in this tutorial. JDBC API is a collection of classes and interfaces that provide database access. Using the JDBC API, we can access any database. The core JDBC API is comprised of two main packages. We automatically get both packages when we download the Java on the machine.
The two packages are as follows:
The main JDBC API Components are as follows:
- ResultSet Metadata
DriverManger manages the JDBC drivers and establishes the connection to the database. It uses the JDBC URL to establish the connection to the database. It returns the Connection object on a successful database connection.
The Connection object represents the session to the connected database. The createStatement() method creates a Statement object to send SQL statements to the database.
The Statement object is used for executing the SQL statements and returns the SQL query results.
The ResultSet object refers to the SQL query result table. The ResultSet object maintains a cursor pointing to the current row of the query result table. We can use a while loop to iterate through the ResultSet.
Java Tutorial on this website:
For more information on Java, visit the official website :
More information about Oracle Database: