Service Virtualization

 View Only
  • 1.  Hi, I need to capture JDBC result set into variable

    Posted Dec 05, 2016 04:54 AM

    Hi, I need to capture JDBC result set into variable, is there any way that can be done. I have used other options like filters etc.. but the issue is i feed the JDBC step with dynamic queries and get dynamic result sets which give multiple rows and columns dynamically. so filters did not help me to retrieve data dynamically, Also am looking for some by which we can able to read the result set through groovy/javascript assertion. Kindly help if any. Thanks in advance.!!!  SRIRAM.MK



  • 2.  Re: Hi, I need to capture JDBC result set into variable
    Best Answer

    Posted Dec 05, 2016 09:33 AM

    Hi sriram.mk3, is it possible for you to implement the query as a JDBC dataset and then iterate over the rows?  The Read Rows from a JDBC Table dataset, returns your SQL query in a dataset which enables you to iterate over the rows one at a time until you have processed the data.  The DevTest framework provides all the heavy lifting and exposes the columns selected in your query.

    For example:

    And, then iterate over the resultset until you process the resultset.  At end, you can control branching to complete the process or end the test.

    The value in this approach is that you are not implementing custom logic to directly access and loop over the resultset stored in DevTest.  Since CA reserves the right to change how processing occurs in DevTest, implementing custom behavior opens the door to potential issues during an upgrade. Utilizing OOTB features as much as possible provides a path for obtaining assistance from our product support team for resolving product related issues, should they arise.



  • 3.  Re: Hi, I need to capture JDBC result set into variable

    Posted Dec 07, 2016 04:08 AM

    Thank you so much...