I am fetching data from database, now I need to get each by value.
If I take get(0)– it is printing first column data for every row…

 [[Field Goal Missed, Jump Shot, 0 Drew Gooden,   ,   , 12.5, N, 3, 3, 0, 2, null]]
    [Field Goal Missed, Jump Shot, 0 Drew Gooden,   ,   , 12.5, N, 3, 3, 0, 2, null]
    [[Offensive Rebound, null, 0 Drew Gooden,   ,   , 12.5, N, 4, 4, 0, null, null]]
[[Field Goal Made, Jump Shot, 7 Mahmoud Abdul-Rauf, 6 Qyntel Woods,   , 72, N, 21, 21, 0, 3, null]]
[Field Goal Made, Jump Shot, 7 Mahmoud Abdul-Rauf, 6 Qyntel Woods,   , 72, N, 21, 21, 0, 3, null]
[[Field Goal Made, Layup Shot, 2 Andre Emmett,   ,   , 85, N, 22, 22, 0, 2, null]]
[Field Goal Made, Layup Shot, 2 Andre Emmett,   ,   , 85, N, 22, 22, 0, 2, null]

this is my code ::

  .sql.Statement stm1 = con.createStatement();
     .sql.ResultSet result2 = stm1.executeQuery(PBP_query);//pbp query
    while(result2.next())
    {

    String EVENT_DESC=result2.getString(1);
    String DETAIL_DESC=result2.getString(2);
    String OFF_PLAYER1=result2.getString(3);
    String OFF_PLAYER2=result2.getString(4);
    String DEF_PLAYER=result2.getString(5);
    String TIME_REMAINING=result2.getString(6);
    String RECORD_EDITED=result2.getString(7);
    String SEQUENCE_NUMBER=result2.getString(8);
    String UNIQUE_ID=result2.getString(9);
    String EDIT_UID=result2.getString(10);
    String POINTS=result2.getString(11);
    String JB_WIN_PLAYER=result2.getString(12);

   List<ArrayList<String>> a = new ArrayList<>();

    ArrayList<String> a1 = new ArrayList<String>();

    a1.add(EVENT_DESC);//adding event class object
    a1.add(DETAIL_DESC);
    a1.add(OFF_PLAYER1);
    a1.add(OFF_PLAYER2);
    a1.add(DEF_PLAYER);
    a1.add(TIME_REMAINING);
    a1.add(RECORD_EDITED);
    a1.add(SEQUENCE_NUMBER);
    a1.add(UNIQUE_ID);
    a1.add(EDIT_UID);
    a1.add(POINTS);
    a1.add(JB_WIN_PLAYER);

    a.add(a1);

     for(ArrayList obj:a)
     { 
        System.out.println(obj);

     }   
    }

I fetched data from database and put into arraylist. Here each row is each event. Like For example Field goal made , it contains type of shot , player names and position of x, y co ordinates-from where the ball is throw. so Here I need to take first row and get all values of the first row (first event) and pass in to my GUI automation script…How do i take each row and each row value ?

Here Field goal missed, field goal made are events…one events contain event name, type of shot, players names, x,y coordinates…..



Source link https://sqa.stackexchange.com/questions/35290/how-do-i-get-the-each-row-of-each-value

LEAVE A REPLY

Please enter your comment!
Please enter your name here