I'd suggest splitting your test logic into 2 separate pieces:
- Load information from CSV and store it as JMeter variables
- Execute SQL code against Oracle using variables from point 1
In regards to implementation I'd suggest to use 2 separate Thread Groups, the first one will be loading stuff from CSV, the second one will be doing actual testing.
Important: don't forget to check "Run Thread Groups Consecutively" box at TestPlan level to assure that second thread group runs after first one.
Example configuration of 1st thread group:
Counter
- Start - 1
- Increment - 1
- Reference name - counter
CSV Data Set Config
- Filename - path to your csv file
- Variable names - name, email
- Delimiter - if you're using TAB - "\t", if comma - "," without quotes
- Allow quoted data - False
- Recycle on EOF - False
- Stop thread on EOF - True
- Sharing mode - All Threads
Beanshell Sampler (this one is optional, JMeter 2.10 is smart enough to store variables for you but I prefer to control everything myself)
Code for Beanshell sampler shoud look as follows:
props.put("name" + vars.get("counter"), vars.get("name"));
props.put("email" + vars.get("counter"), vars.get("email"));
It fetches current "name" variable and stores it as name + counter property.
So given 3 lines is CSV file you'll have following properties:
name1=Justin
[email protected]
name2=George
[email protected]
name3=Micheal
[email protected]
You can use Debug Sampler to see JMeter Variables and Properties values
After that in second thread group you can refer stored properties as:
${__P(name1,)}
or
${__property(name1,,)}
in your JDBC Request Sampler.
Both should work.