How to use Gatling jdbc feeder for multiple post by populating template file and loop through the process for all data return from table

I am new to Gatling, Scala and load testing.

I need to use jdbc feeder to pull the N numbers of data from a table and store them on session or some variable so that I can assign them on template for different post call.

How do I repeat this process for all the rows return from the table?

import io.gatling.core.Predef._
import io.gatling.core.feeder.RecordSeqFeederBuilder
import io.gatling.core.structure.ScenarioBuilder
import io.gatling.http.Predef._
import io.gatling.http.protocol.HttpProtocolBuilder
import io.gatling.jdbc.Predef._

class GatlingTest extends Simulation {
private val dbConnectionString = “jdbc:mariadb://localhost:3306/”
private val sqlQuery = “SELECT Col1, Col2, Col3, Col4… FROM TestTable”
private val sqlUserName = “username”
private val sqlPassword = “password”

private val baseUrl = “http://baseurl…”
private val contentType = “application/json”

val sqlQueryFeeder: RecordSeqFeederBuilder[Any] = jdbcFeeder(dbConnectionString,

val httpProtocol: HttpProtocolBuilder = http

val scn: ScenarioBuilder = scenario(“Test Scenario”)
.exec(http(“first post call”)

.exec(http(“second post call”)

// Loop this steps for each rows return from the database and do the same process



and Template1.txt is