Service Virtualization

Expand all | Collapse all

Reading data from Data base - difference

Jump to Best Answer
  • 1.  Reading data from Data base - difference

    Posted 11-20-2017 07:27 AM

    # monika , # vijay , # noel

     

    In devtest 8.2

    Please clarify the difference in reading data from a SQL data base using  "Read Rows from a JDBC Table Data Set"  and SQL Database execution step  . Both looks similar for me . 



  • 2.  Re: Reading data from Data base - difference
    Best Answer

    Posted 11-21-2017 09:31 AM

    SQL Database Execution (JDBC) - DevTest Solutions - 10.1 - CA Technologies Documentation  

    Read Rows from a JDBC Table Data Set - DevTest Solutions - 10.1 - CA Technologies Documentation  

    The two steps are similar.

    The subtle difference is that the Read Rows from JDBC Dataset is typically used when a test case needs to loop over the result set returned by the query. The Read Rows from JDBC takes each column value in the result set and places the value in a property equivalent to the column name specified in the query. The result can be processed one row at a time.

    The SQL Database Execution step can also return a result set; however, the Test Case must implement filters to extract the data from the result set. It is also not as easy to loop over the result set, if that is a requirement.



  • 3.  Re: Reading data from Data base - difference

    Posted 12-20-2017 06:25 PM

    Hi Joel,

     

    I am able to create Read Rows from a JDBC Table Data Set step and on clicking "Test and Keep" I am able to see first set of data.

     

    How do now I iterate over this in my virtual service response. Could you please give me pointers to any resource/reference.

     

    This will be very helpful



  • 4.  Re: Reading data from Data base - difference

    Posted 12-22-2017 07:56 AM

    Read Rows from JDBC works like any dataset. One row at a time is read.

    The test contains a loop to the step to indicate that the next row should be read.

    Configurations within the step indicate what to do when the end of data is reached.

    In the example below, a dataset is read. The "More Steps" step loops back to the dataset indicating read the next row.

    At end of dataset, the logic branches to "Last Step if Necessary" to perform an action and the test case ends.