So you just need help connecting to the database and getting a recordset back? It's quite easy;
try
{
//Create a connection to Oracle
Connection connection = DriverManager.getConnection("jdbc:oracle:kprb:");
//Create the statement, can scroll anyway and is updatable
Statement sel = connection.createStatement(ResultSet.TYPE_SCROLL_I NSENSITIVE, ResultSet.CONCUR_UPDATABLE);
//Execute a query and get a resultset.
resultSet = read.executeQuery("SELECT to_char(MIN("+cba_time+"), 'DD/MM/YYYY HH24:MI:SS') as x FROM " + final_table);
//loop while there's still records.
while (resultSet.next())
{
System.out.println(resultSet.getString(1));
}
}
catch (SQLException e)
{
//It all went wrong
System.out.println("Error! - " + e);
}