I have a cursor returned from Database executes in 31ms (milliseconds) .

But when I use this cursor having more than 1500 rows for fetching rows

  ResultSet rs = (ResultSet)cstm.getObject(6);

  while(rs.next()){
     system.out.println("...");
  }

Just simple transversing through each row of cursor it's taking more than 40 seconds (40000 ms)

What can be done?

Edit
Report