# Gatling Java - JDBC Builder - Dynamic Query

**URL:** <https://community.gatling.io/t/gatling-java-jdbc-builder-dynamic-query/7699>\
**Category:** Gatling (Open-Source)\
**Created:** [March 8, 2023, 9:13pm UTC](https://community.gatling.io/t/gatling-java-jdbc-builder-dynamic-query/7699 "2023-03-08T21:13:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![manien94](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@manien94](https://community.gatling.io/u/manien94)\
**Post date:** [March 8, 2023, 9:13pm UTC](https://community.gatling.io/t/gatling-java-jdbc-builder-dynamic-query/7699/1 "2023-03-08T21:13:34Z")

</div>

can we get data using data base builder during the runtime of a gatling script by changing the DB SQL query dynamically every iteration

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [March 8, 2023, 9:46pm UTC](https://community.gatling.io/t/gatling-java-jdbc-builder-dynamic-query/7699/2 "2023-03-08T21:46:51Z")

</div>

No you can’t:

- feeders are **shared** datasources, they are not scoped per virtual user and hence can’t access Session data
- JDBC is a blocking API, not something you want to use during the test and blocking the threads

If you want to perform individual data fetching for each virtual user, I recommend that you implement an HTTP API for this, instead of directly connecting to the underlying database over JDBC, so:

- you can use Gatling HTTP support for this
- benefit from Gatling HTTP engine being non blocking

---

<div class="post-metadata">

**Author:** ![manien94](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@manien94](https://community.gatling.io/u/manien94)\
**Post date:** [March 9, 2023, 9:45pm UTC](https://community.gatling.io/t/gatling-java-jdbc-builder-dynamic-query/7699/3 "2023-03-09T21:45:33Z")

</div>

Thanks, I read the same just wanted to be sure 🙂

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [March 9, 2023, 9:58pm UTC](https://community.gatling.io/t/gatling-java-jdbc-builder-dynamic-query/7699/4 "2023-03-09T21:58:23Z")

</div>

Closed on March 9, 2023, 9:58pm UTC


