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,
sqlUserName,
sqlPassword,
sqlQuery
)

val httpProtocol: HttpProtocolBuilder = http
.baseURL(baseUrl)
.acceptHeader("/")
.contentTypeHeader(contentType)

val scn: ScenarioBuilder = scenario(“Test Scenario”)
.feed(sqlQueryFeeder)
.exec(http(“first post call”)
.post(endpoint1)
.body(ELFileBody(“Template1.txt”))
.check(status.is(200)))

.exec(http(“second post call”)
.post(endpoint2)
.body(ELFileBody(“Template2.txt”))
.check(status.is(200)))

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

setUp(scn.inject(atOnceUsers(1))).protocols(httpProtocol)

}
`

and Template1.txt is