Storing rows from a MySQL table into an array in Java -


I'm trying to be stored in an array of rows from a table. I can get the first result and store it, but I can not be able to store any other data.

This I have written code

  try {test = "Select 'arsenal' match 'number' ASC '; Rs = st.executeQuery (test); while (rsnext ()) {// it receives each row of the table arsenal team adds an array results in class Matchno = rs.getString ( "MatchNumber"); Homtem = Arkjest string ( "Homtam" ), reaching = Arkjest string ( "Aevetem"); Homgal = R KgetString ( "Grihsod"); long-term = Arkjest results string ( "Avegols"); = Rsgetstring ( "Results"); teams = (Macno + "," + Homtek + "," + distances + "," + Homgois + "," + Ovrsoyl + "," + result); // all customers Takes the variable associated with the same information and puts it into a string, separated by commas. TeamResults.add (matchno, Hometeam, farteam, homegoals, awaygoals, results);}}  

Any ideas where I am being wrong?

When changing - to hasNext () and the transfer of further database coat cursor Use the next inside the loop to populate.


Comments