Lottery match exercise
<p>I have been busy with a exercise where I need to compare a winning lottery number(which is generated) with existing lottery numbers in a database table. </p>

<p>I manage to loop through all the numbers in the database and subsequently find matches with the winning set of numbers but am struggling to pinpoint in which set of lottery numbers the match was found.<br>
The numbers were placed individually in each database column.
Here I retrieve the values in each row.</p>

<pre><code>ResultSet set = state.executeQuery("SELECT * FROM numberLotto");
    while(set.next())
    {
                String[]row = new String[7]; 
                row[0] = set.getString(1);                   
                row[1] = set.getString(2);
                row[2] = set.getString(3);
                row[3] = set.getString(4);
                row[4] = set.getString(5);
                row[5] = set.getString(6);
                row[6] = set.getString(7);
                entries.add(row);
            }
String[][]listOfNumbers = entries.toArray(new String[entries.size()][7]);
</code></pre>

<p>I then loop through listOfNumbers and compare all the values with the values of winningNumber.</p>

<pre><code>Object[]winningNumber = lottoDrawString.toArray();   

        for (int i=0; i &lt; listOfNumbers.length; i++)
        {
            for (int j=0; j &lt; listOfNumbers[i].length; j++)
            {
                for(int k = 0; k &lt; winningNumber.length; k++)
                {
                    System.out.println(listOfNumbers[i][j]);

                    if(listOfNumbers[i][j].equals(winningNumber[k]))
                    {
                        System.out.println("There is a match " + listOfNumbers[i][j] + " and " + winningNumber[k]);
                    }
                }

            }
        }
</code></pre>

<p>How can I retrieve the row where the match(es) were found?</p>

<p>kind regards</p>
