JDBC concepts

Before performing any operations in JDBC, we need to establish a connection to the database. Here are some of the important classes/interfaces in JDBC for executing SQL statements:

JDBC class/interface

Description

java.sql.Connection

Represents the connection between the application and the backend database. Must for performing any action on the database.

java.sql.DriverManager

Manages JDBC drivers used in the application. Call the DriverManager.getConnection static method to obtain the connection.

java.sql.Statement

Used for executing static SQL statements.

java.sql.PreparedStatement

Used for preparing parameterized SQL statements. SQL statements are pre-compiled and can be executed repeatedly with different parameters.

Java.sqlCallableStatement

Used for executing a stored procedure.

java.sql.ResultSet

Represents a row in the database table in the result returned after execution of an SQL query by Statement or PreparedStatement.

You can find all the interfaces for JDBC at http://docs.oracle.com/javase/8/docs/api/java/sql/package-frame.html.

Many of these are interfaces, and implementations of these interfaces are provided by the JDBC drivers.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.99.71