//Iterate through rows in reverse direction,
//again displaying contents of each row…
"* Error retrieving data! *");
"* Unable to disconnect! *");
public static void showRow() throws SQLException
System.out.println("Account no. "
System.out.println("Account holder: "
+ " " + results.getString(2));
System.out.printf("Balance: %.2f %n%n",
The output from this program is shown in Fig. 7.5 . For some reason, the initial
ordering of rows when using the second version of method createStatement differs
from that which occurs with the original version of createStatement (even though
exactly the same query is used and movement through the data rows is in the
forward direction in both cases). However, it can clearly be seen that the order of
output when previous is used is the reverse of that which occurs in this program
when next is used.