JDBC
JDBC
Types of Drivers
Connection
• A Connection is the session between java application and
database.
• The Connection interface is a factory of Statement,
PreparedStatement, and DatabaseMetaData i.e. object of
Connection can be used to get the object of Statement and
DatabaseMetaData.
• The Connection interface provide many methods for transaction
management like commit(), rollback() etc.
Methods:
public Statement createStatement(): creates a
statement object that can be used to execute SQL queries.
Type of ResultSet
The possible RSType are given below. If you do not specify any ResultSet type, you will
automatically get one that is TYPE_FORWARD_ONLY.
Type Description
ResultSet.TYPE_FORWARD_ONLY The cursor can only move forward in the result set.
ResultSet.TYPE_SCROLL_INSENSITIVE The cursor can scroll forward and backward, and the
result set is not sensitive to changes made by others
to the database that occur after the result set was
created.
ResultSet.TYPE_SCROLL_SENSITIVE. The cursor can scroll forward and backward, and the
result set is sensitive to changes made by others to the
database that occur after the result set was created.
Concurrency of ResultSet
The possible RSConcurrency are given below. If you do not specify any
Concurrency type, you will automatically get one that is
CONCUR_READ_ONLY.
Concurrency Description