 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is RowId object in JDBC Explain?
A RowId is a built-in type of SQL which is an address of a row in a table of a database. The RowId interface of the java.sql package maps with the SQL ROWID value.
RowId values are unique for every row and they are the fastest way to access a row. You cannot use this as a primary key of a table.
Retrieving RowId objects
You can retrieve the RowId of a particular row using the getRowId() method of the ResultSet, CallableStatement, PreparedStatement interfaces.
This method accepts a String value representing a column label or, an integer value representing the column index and returns the respective RowId object.
//Retrieving the RowId objects RowId rowId1 = rs.getRowId("Mobile_Brand"); RowId rowId2 = rs.getRowId("Unit_Sale");  Setting the RowId values to prepared statement
You can use this as a unique value representing each row. You can set it as a parameter in PreparedStatement using the setRowId() method. To this method, you need to pass an integer representing the parameter index at which you need to set RowId as a value.
RowId rowid = rs.getRowId("Mobile_Brand"); PreparedStatement pstmt = con.prepareStatement("insert into myTable values (?, ?, ?)"); pstmt.setRowId(1, rowId); pstmt.setString(2, "Raja"); pstmt.setString(3, "Hyderabad");