After adding a step using [Other Transactions] - [SQL Database Execution (JDBC)], you can set a query in [SQL Database Execution (JDBC) - JDBC] - [SQL Statement].
Next, run the step using Interactive Test Run (ITR), and then result set will be stored to a property like <Step Name>.rsp as XML format.
Memorize the property name. In this case, the name is [lisa.JDBC.rsp].
Add a filter as [Utility] - [Save Property Value to File] to the step, and set the property name (memorized in previous step) and target file name.
After that, save the step.
As a result, the step will write a file with result set of the query.