I will try and explain this the best i can

Above is a screenshot of what i have done. The user chooses an event from the combobox on the left. Events are 100, 200, 400 and 800M run.
Then the user chooses a round. Rounds are round 1, 2, 3 and final.
Once these have been choosen, r.g. 100M run, round 1, the user enters the information into the JTable and clicks save. This is then saved in my database via JDBC.
Now lets say the user enters the information for 100M run, rounds 1, 2, and 3. The final is determined by the 3 fastest from each round.
I ahve done the following query and resultset to return the 3 fastest into a list.
CODE
public List<Integer> getFastest(String eveType, String roundType)
{
String roundType2 = roundType;
String eveType2 = eveType;
String SELECT_TOP_TIMES =
"select TOP 3 r.result " +
"from tblResults as r " +
"where r.Event_ID = " +
"(select e.ID " +
"from tblEvent as e " +
"where e.Event_Name = ?) " +
"and r.Round_ID = " +
"(select ro.ID " +
"from tblRound as ro " +
"where ro.Round_Number = ?) " +
"order by r.result";
PreparedStatement ps = null;
ResultSet rs = null;
List<Integer> topTimes = new ArrayList<Integer>();
try
{
con = DatabaseUtils.connect(DRIVER, URL);
ps = con.prepareStatement(SELECT_TOP_TIMES);
for(int i = 0; i <= 2; i++)
{
ps.setString(1, eveType2);
ps.setString(2, roundType2);
}
rs = ps.executeQuery();
while (rs.next())
{
int result = rs.getInt(1);
topTimes.add(result);
}
//System.out.println(topTimes);
}
catch(Exception e)
{
System.out.println(e);
DatabaseUtils.rollback(con);
e.printStackTrace();
}
finally
{
DatabaseUtils.close(rs);
DatabaseUtils.close(ps);
DatabaseUtils.close(con);
}
return topTimes;
}
This might need to change however because i need more than the 3 fastest times returned, i need their name etc. I can just change this to an object i create.
Now in another class, i am testing out this method just by doing
CODE
List<Integer> bestTimes = sql.getFastest(sType, sType2);
System.out.println(bestTimes);
Where sType and sType2 are parameters for eventName and RoundNumber. This works fine and returns the 3 fastest times for whatever event/round i choose.
What i need to do now though is somehow create a method that will return the three fastest for each event/round into an object or somthing, so i can then load the names and nationalities into the JTable for final.
So my whole goal is if the user chooses final from the JCombo box, the 3 fastest from each round should be in there...apart from the times.
Just lemme know if you wanna see my classes so far.
cheers