Gatling- How to insert the datas into db.

how to insert the datas into db from excel sheet using scala file.

Thanks,
Mohanapriya

How is this relevant in a gatlling forum?

I have the recorded scala file. I want to insert the data’s into db from excel sheet using jdbc feeder.can anyone help how to achieve this.

The JDBC feeder fetches data from the database, not write to it.
Gatling won’t help you much for that…

Small tip: export your Excel sheet to a CSV file, then read your CSV file to get all the records you’ll need to insert in the database, then insert them using plain JDBC.
You’ll find plenty of resources on how to achieve that on Google/StackOverflow.

Cheers,

Pierre

can you give some examples how to do this? I am new to gatling

I am able to insert the datas manually.

val testData2 = jdbcFeeder(“jdbc:oracle:thin:@10.87.54.8:1521:wahipaD”, “myHPHB_MI_SYSTS”, “myHPHB_MI_SYST”, “”“insert into TRN_USER_ACCOUNT(USER_ACCT_SID,LOGIN_ID,PWD,ACNT_TYPE_LKPCD,TENANT_CID,OPRTNL_FLAG,CREATED_BY,CREATED_DATE,MODIFIED_BY,MODIFIED_DATE) VALUES (2525,‘user2’,‘pwd’,‘NORMAL’,26,‘A’,‘1’,sysdate,1026,sysdate)”"")

As you said , first i need to export my excel sheet using csv file. I have done this. then how to read csv file and how to insert into db. I got struck with this. please help.

PFA

Thanks ,
Mohanpriya

This has absolutely nothing to do with Gatling here…
This kind of task could be achieved with any tool or programming language of your liking.
Again, you’ll find plenty of resources on how to do that anywhere on the Web.

Please remember this is the Gatling mailing list, not StackOverflow.
We’ll be glad to help you develop your Gatling simulations but here, but the means to setup your test environment has really nothing to do with Gatling itself.

Cheers,

Pierre