# JDBCFeeder setup question

**URL:** <https://community.gatling.io/t/jdbcfeeder-setup-question/2949>\
**Category:** Gatling (Open-Source)\
**Created:** [April 22, 2016, 12:08pm UTC](https://community.gatling.io/t/jdbcfeeder-setup-question/2949 "2016-04-22T12:08:21Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![aravind.arumugam](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@aravind.arumugam](https://community.gatling.io/u/aravind.arumugam)\
**Post date:** [April 22, 2016, 12:08pm UTC](https://community.gatling.io/t/jdbcfeeder-setup-question/2949/1 "2016-04-22T12:08:21Z")

</div>

Hi there,

Just wondering if anyone experienced issues setting up ojdbc.jar file for using oracle JDBC feeder?

I’m getting the following error when attempting to use JDBC feeder,

Caused by: java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@//xxxxxxxxxxxxxx  
at java.sql.DriverManager.getConnection(DriverManager.java:689)  
at java.sql.DriverManager.getConnection(DriverManager.java:247)  
at io.gatling.jdbc.feeder.JdbcFeederSource$.apply(JdbcFeederSource.scala:29

I’m currently using the maven plugin in my pom file and have the following dependency for ojdbc

com.oracle ojdbc14 10.2.0.3.0

I have added the jar into a local repository manually and the jar is present in the local repository that I can see.

Not sure why it is not picking up the jar? or is the jar not compatible? Or am I missing something obvious here?

Has anyone successfully used oracle JDBC feeder using maven plugin?  
Any suggestions would be greatly appreciated.

Ta

---

<div class="post-metadata">

**Author:** ![aravind.arumugam](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@aravind.arumugam](https://community.gatling.io/u/aravind.arumugam)\
**Post date:** [April 25, 2016, 8:44am UTC](https://community.gatling.io/t/jdbcfeeder-setup-question/2949/2 "2016-04-25T08:44:50Z")

</div>

Any help please?

---

<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:** [April 26, 2016, 8:55pm UTC](https://community.gatling.io/t/jdbcfeeder-setup-question/2949/3 "2016-04-26T20:55:03Z")

</div>

JDBC drivers automatically register themselves against the DriverManager only since JDBC4.  
You’re using a JDBC3 so you have to trigger the registration manually, which is done by convention by loading the driver class. Add a Class.forName("") in your simulation.

---

<div class="post-metadata">

**Author:** ![Niko\_Kovac](https://avatars.discourse-cdn.com/v4/letter/n/ecae2f/32.png) [@Niko\_Kovac](https://community.gatling.io/u/Niko_Kovac)\
**Post date:** [May 30, 2018, 6:17am UTC](https://community.gatling.io/t/jdbcfeeder-setup-question/2949/4 "2018-05-30T06:17:59Z")

</div>

I’m trying to use jdbc feeder to connect to oracle db.

I have the following:

`val oracleFeeder= jdbcFeeder("jdbc:oracle:thin:@//my_db_host:1521/scheme", "user", "pass","select name from USER")`

`val session = feed(oracleFeeder) .exec(http("/session") .post("/session") .body(ElFileBody("session.json"))`

My maven pom has dependency:

`  
  
com.oracle  
ojdbc8  
12.2.0.1

`

When I launch my script I get an error:

`

Exception in thread “main” java.lang.NullPointerException  
at io.gatling.core.action.builder.FeedBuilder.newSingletonFeed(FeedBuilder.scala:38)  
at io.gatling.core.action.builder.FeedBuilder.$anonfun$build$1(FeedBuilder.scala:43)  
at scala.collection.mutable.HashMap.getOrElseUpdate(HashMap.scala:82)  
at io.gatling.core.action.builder.FeedBuilder.build(FeedBuilder.scala:43)  
at io.gatling.core.structure.StructureBuilder.$anonfun$build$1(StructureBuilder.scala:34)  
at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:122)  
at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:118)  
at scala.collection.immutable.List.foldLeft(List.scala:86)  
at io.gatling.core.structure.StructureBuilder.build(StructureBuilder.scala:33)  
at io.gatling.core.structure.StructureBuilder.build$(StructureBuilder.scala:32)  
at io.gatling.core.structure.ScenarioBuilder.build(ScenarioBuilder.scala:38)  
at io.gatling.core.structure.PopulationBuilder.build(ScenarioBuilder.scala:98)  
at io.gatling.core.scenario.SimulationParams.$anonfun$scenarios$1(Simulation.scala:188)  
at scala.collection.immutable.List.map(List.scala:283)  
at io.gatling.core.scenario.SimulationParams.scenarios(Simulation.scala:188)  
at io.gatling.app.Runner.run0(Runner.scala:95)  
at io.gatling.app.Runner.run(Runner.scala:64)  
at io.gatling.app.Gatling$.start(Gatling.scala:63)  
at io.gatling.app.Gatling$.fromMap(Gatling.scala:40)  
at Engine$.delayedEndpoint$Engine$1(Engine.scala:12)  
at Engine$delayedInit$body.apply(Engine.scala:4)  
at scala.Function0.apply$mcV$sp(Function0.scala:34)  
at scala.Function0.apply$mcV$sp$(Function0.scala:34)  
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)  
at scala.App.$anonfun$main$1$adapted(App.scala:76)  
at scala.collection.immutable.List.foreach(List.scala:389)  
at scala.App.main(App.scala:76)  
at scala.App.main$(App.scala:74)  
at Engine$.main(Engine.scala:4)  
at Engine.main(Engine.scala)  
`

Tell me please, what I’m doing wrong? Error is not informative for me.

---

<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:** [May 30, 2018, 6:26am UTC](https://community.gatling.io/t/jdbcfeeder-setup-question/2949/5 "2018-05-30T06:26:33Z")

</div>

My2cents: you’re instanciating oracleFeeder AFTER trying to pass this reference to feed.

---

<div class="post-metadata">

**Author:** ![Niko\_Kovac](https://avatars.discourse-cdn.com/v4/letter/n/ecae2f/32.png) [@Niko\_Kovac](https://community.gatling.io/u/Niko_Kovac)\
**Post date:** [May 30, 2018, 7:21am UTC](https://community.gatling.io/t/jdbcfeeder-setup-question/2949/6 "2018-05-30T07:21:02Z")

</div>

Stephane, thank you, you are absolutely right! One more question - is this possible to use in a query a ${var} variable, from another feeder? Something like:  
`

val oracleFeeder= jdbcFeeder(“jdbc:oracle:thin:@//my\_db\_host:1521/scheme”, “user”, “pass”,“select name from USER where SURNAME = ${SRNM}”)  
`

This will make a query dynamic.

---

<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:** [May 30, 2018, 7:26am UTC](https://community.gatling.io/t/jdbcfeeder-setup-question/2949/7 "2018-05-30T07:26:24Z")

</div>

No

---

<div class="post-metadata">

**Author:** ![Niko\_Kovac](https://avatars.discourse-cdn.com/v4/letter/n/ecae2f/32.png) [@Niko\_Kovac](https://community.gatling.io/u/Niko_Kovac)\
**Post date:** [May 30, 2018, 7:52am UTC](https://community.gatling.io/t/jdbcfeeder-setup-question/2949/8 "2018-05-30T07:52:27Z")

</div>

And is it possible at all, to customize a feeder query? I’ve tried to use a scala variable instead of gatling, but not succeed with it. Tell me please, should I try more, or there is no way to select data in a query according to some dynamic value?

---

<div class="post-metadata">

**Author:** ![Niko\_Kovac](https://avatars.discourse-cdn.com/v4/letter/n/ecae2f/32.png) [@Niko\_Kovac](https://community.gatling.io/u/Niko_Kovac)\
**Post date:** [May 31, 2018, 9:51am UTC](https://community.gatling.io/t/jdbcfeeder-setup-question/2949/9 "2018-05-31T09:51:12Z")

</div>

I’ve found a suitable solution here - [https://groups.google.com/forum/#!topic/gatling/STlb\_ihkzIo](https://groups.google.com/forum/#!topic/gatling/STlb_ihkzIo)

---

<div class="post-metadata">

**Author:** ![mayankcha](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@mayankcha](https://community.gatling.io/u/mayankcha)\
**Post date:** [August 31, 2022, 1:44pm UTC](https://community.gatling.io/t/jdbcfeeder-setup-question/2949/10 "2022-08-31T13:44:24Z")

</div>

after adding Class.forName(“”) getting classNotFoundException

---

<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:** [August 31, 2022, 9:04pm UTC](https://community.gatling.io/t/jdbcfeeder-setup-question/2949/11 "2022-08-31T21:04:16Z")

</div>

`Class.forName(“THE_FQCN_OF_YOUR_JDBC3_DRIVER_HERE”)` !
