What is the best way to handle Java ResultSet? I'm creating a Desktop application that will connect to an oracle database using JDBC.

However, I am having problem with handling ResultSets since I can't do comparison using for loop.

```
// create a database connection object
DB db = new DB();

// get rows of my first table and second table
ResultSet firstRS = db.getMyFirstTable();
ResultSet seconRS = db.getSecondTable();

// compare the two tables
while(firstRS.next()) 
{
    // get the row of my first table
    String firstRSRow = firstRS.getString("col1");

    while(secondRS.next()) 
    {
        // get the row of my second table
        String secondRSRow = seconRS.getString("col1");

        // compare row from first table to the row in second table
        if(firstRSRow.startsWith(secondRSRow))
        {
            // do some processing here....
        } // end if
    } // end while
} // end while

```

I know that this could be accomplish with [Hibernate](http://www.hibernate.org/) with a few lines of code but I don't have the luxury of time to study it.

I also found commons [DbUtils](http://commons.apache.org/dbutils/index.html) from apache but it seems complicated for me as a novice programmer.

Is there other way/tools/libraries/framework simple enough to get ResultSet from databases and manipulate it in simple and straightforward manner?

I will also appreciate if you could direct me to a website that has sample codes concerning java database connectivity.

Thank you very much for your support.