I need to make sure,whether table has data or not ,based on the environment,say for example i have two two database,one is development another one is production like given below.
Production
host1
dbuser1
dbpassword1
dburl
Tablename : studentinfo
Development
dbuser2
dbpassword2
dburl2
Tablename : studentinfo
FYI : studentinfo has same structure in both environment .
In Jmeter ,User Defined Variable( UDV), I have configured two set of database information. Using BeanShell Processor I have trying to change the database connectivity information, Is there any way to change the Db Config dynamically ?
Given below is my Jmeter UDV
env : prod
prod_db_url: dburl
prod_db_user:usr
prod_db_password:password
dev_db_url: dburl
dev_db_user:usr
dev_db_password:password
In My Beanshell Preprocessor
String env=vars.get("env");
if(env.equlas("prod")){
// Load the Prod db into vars
} else if (env.equals("dev")){
// Load the Dev db into vars
}
Here ,I am setting the values in vars, and trying to get the information from DB Configuration variables. but i am not able get values the in DB config.
Can anyone explain ? what went wrong or what is the approach to get connection?