0% found this document useful (0 votes)
2 views1 page

Java Scrollable ResultSet Example

The Java program demonstrates how to use a scrollable ResultSet with a MySQL database connection. It retrieves and displays records from the 'emp' table, showcasing various ResultSet navigation methods such as first, absolute, last, and relative. The program includes error handling to catch exceptions during database operations.

Uploaded by

hike.praji
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Java Scrollable ResultSet Example

The Java program demonstrates how to use a scrollable ResultSet with a MySQL database connection. It retrieves and displays records from the 'emp' table, showcasing various ResultSet navigation methods such as first, absolute, last, and relative. The program includes error handling to catch exceptions during database operations.

Uploaded by

hike.praji
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

import [Link].

*;
class Scroll ResultSet {
public static void main(String[] args) {
try {
[Link]("[Link]");
Connection con =
[Link]("jdbc:mysql//localhost:3306/test", "root", "root");
Statement st = [Link](ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.
CONCUR_READ_ONLY);
ResultSet rs = [Link]("select * from emp"); [Link]("RECORDS IN
THE TABLE..."); while ([Link]()) {
[Link]([Link](1) + " " + [Link](2));
[Link]("FIRST RECORD...");
}
[Link]();
[Link]([Link](1) + "
"+[Link](2));
[Link](3);
[Link]("THIRD RECORD...");
[Link]();
[Link]();
"
[Link]([Link](1) + " + [Link](2));
[Link]("LAST RECORD...");
""
[Link]([Link](1) + "+[Link](2));
[Link](-1);
[Link]("FIRST RECORD...");
[Link]([Link](1) + " "+[Link](2));
[Link]();
} catch (Exception e) {
[Link](e);

You might also like