JDBC, ResultSet interface, Updatable ResultSet . Part:2 JDBC-Ep:5

Опубликовано: 03 Август 2026
на канале: Ajoy Debnath
77
8

Hi,
Hope you are all doing great. Let's learn together.
Join Telegram: 📲 https://t.me/contactajoydebnath

Chapters ❤
0:00 Introduction
03:27 What is Resultset?
10:11 Updatable Resultset
12:25 Insert Operation Using Updatable Resultset
18:00 Update Operation Using Updatable Resultset
20:13 Delete Operation Using Updatable Resultset
23:30 Request & End


Note:
JDBC stands for Java Database Connectivity. JDBC is a Java API to connect and execute the query with the database. It is a part of JavaSE (Java Standard Edition). JDBC API uses JDBC drivers to connect with the database.

Video Links:
Core Java Playlist:
   • Core Java  

Spring Playlist:
   • Spring Framework  

Video Link:
JDBC established a connection with the database. --    • JDBC, established connection with database...  
JDBC, DatabaseMetaData interface. --    • JDBC, DatabaseMetaData interface. JDBC-Ep:...  
JDBC, Statement interface. JDBC. --    • JDBC, Statement interface. JDBC-Ep:3 #jdbc...  
JDBC, ResultSet interface. --    • JDBC, ResultSet interface. Part:1 JDBC-Ep:...  
JDBC, ResultSet interface, Updatable ResultSet. --    • JDBC, ResultSet interface, Updatable Resul...  

Document Link -
https://docs.google.com/document/d/1i...
https://docs.google.com/document/d/1U...


Like, Comment, Share, and Subscribe.
Thank you again.

Eclipse Download
https://www.eclipse.org/downloads/pac...

JDK Link:
https://www.oracle.com/java/technolog...

MySQL Connector JAR
https://mvnrepository.com/artifact/my...

MySQL Installer
https://dev.mysql.com/downloads/insta...


JDBC
The JDBC API is a Java API that can access any kind of tabular data, especially data stored in a relational database.

Tabular Data: A tabular database, as the name implies is a database that is structured in a tabular form. It arranges data elements in vertical columns and horizontal rows. Each cell is formed by the intersection of a column and a row.

JDBC helps you to write Java applications that manage these three programming activities:

1. Connect to a data source, like a database
2. Send queries and update statements to the database
3. Retrieve and process the results received from the database in answer to your query

Connection Interface:
A Connection is a session between a Java application and a 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 provides many methods for transaction management like commit(), rollback(), etc.

Result Set Operation:
ResultSet Object is used to access query results retrieved from the relational databases. ResultSet maintains a cursor/pointer which points to a single row of the query results. Using navigational and getter methods provided by ResultSet, we can iterate and access database records one by one.

We can obtain data from ResultSet using the getter methods provided by it. e.g. getInt(), getString(), getDate().

All the getter methods have two variants. 1st variant takes the column index as a Parameter and 2nd variant accepts the column name as a Parameter.
Finally, we need to call the close method on the ResultSet instance so that all resources are cleaned up properly.

boolean next() throws SQLException: This method moves the ResultSet cursor to the next row.
boolean previous() throws SQLException: This method moves ResultSet cursor to the previous row.
void afterLast() throws SQLException**:** This method moves ResultSet cursor to the position after the last row.
void beforeFirst() throws SQLException**:** This method moves ResultSet cursor to the position before the first row.
boolean absolute(int row) throws SQLException**:** This method moves ResultSet cursor to the specified row and returns true if the operation is successful.
boolean first() throws SQLException: This method moves ResultSet cursor to the first row.
boolean last() throws SQLException: This method moves ResultSet cursor to the last row.

resultSet.moveToInsertRow(); – Moves the cursor to the insert row. The current cursor position is remembered while the cursor is positioned on the insert row. The insert row is a special row associated with an updatable result set. It is essentially a buffer where a new row may be constructed by calling the updater methods prior to inserting the row into the result set. Only the updater, getter, and insertRow methods may be called when the cursor is on the insert row. All of the columns in a result set must be given a value each time this method is called before calling insertRow. An updater method must be called before a getter method can be called on a column value.
resultSet.update*{int,string..}({column name}, {value});
resultSet.insertRow();