Answer:
Java
Code:
package com.java2novice.jdbc;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class MyResultSetEx //Main Class
{
    public static void main(String a[]) //Main
Function
{
        Â
        try
   {
            Class.forName(\"oracle.jdbc.driver.OracleDriver\");
            Connection
con =
DriverManager.getConnection(\"jdbc:oracle:thin:@::\",\"user\",\"password\"); // Provide the
database name,username and password details to establish the
connection with database
            Statement
stmt = con.createStatement();
            System.out.println(\"Created
DB Connection....\"); //Displaying if connection is established with
database
            ResultSet
rs = stmt.executeQuery(\"SELECT BK.Title, BW.Name FROM BOOK_LOANS BL
JOIN BORROWER BW ON BL.Card_no=BW.Card_no JOIN BOOK BK ON
BL.Book_id=BK.Book_id WHERE BL.Due_date < SYSDATE - 1;\"); //SQL
query to fetch book title and borrower name for whom due date was
yesterday
            while(rs.next())
   {
                System.out.println(rs.getString(1));
//Printing the book title
                System.out.println(rs.getString(2));
//Printing the borrower name
            }
            rs.close();
            con.close();
//Closing the connection with database
        }
  catch (ClassNotFoundException e)
  {
            System.err.print(\"SQLException:
\");
   e.printStackTrace();
        } catch
(SQLException e)
  {
            System.err.print(\"SQLException:
\");
   e.printStackTrace();
        }
    }
}