I am automating my gui app. I am fetching the from and now I need to store all the data into
I need to store all the data and into arraylist..

.sql.Statement stm1 = con.createStatement();
     .sql.ResultSet result1 = stm1.executeQuery(player_name_pos_query);//lineup query

     List<String> al1=new ArrayList<String>();
         while(result1.next())
         {
                // System.out.println(2);
                 lineup_player_name=result1.getString(1);
                 pos=result1.getString(2);

                 al1.add(lineup_player_name);
                 al1.add(pos);



        System.out.println(al1);//  [Mahmood, F]




         }



Source link https://sqa.stackexchange.com/questions/35269/-data-from-database-and-put-into-arraylist

LEAVE A REPLY

Please enter your comment!
Please enter your name here