How do I switch DB for postgresql using ReadyApi?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2022
08:23 AM
04-13-2022
08:23 AM
How do I switch DB for postgresql using ReadyApi?
When I run command SELECT session_user, current_database(); , it shows a different db than what I would like to query. How do I switch to a different db ?
2 REPLIES 2
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2022
08:45 AM
04-13-2022
08:45 AM
Hey @indraniria,
Ok. Youre not talking about a jdbc test step here are you? This is java, right? So how are you running the command 'SELECT session_user, current_database();' in a groovyscript step? Event handler step? Startup/teardown steps?
If you post the relevant script we should be able to help out.
Im guessing your current_database() method is pointing at your postgresql db, so youd need to find where the parms are set and change them accordingly.
Depending on what version of ReadyAPI you have you should be able to see which database connections that have already been setup.
Gonna need more info i think to provide further help.
Cheers,
Rich
Ok. Youre not talking about a jdbc test step here are you? This is java, right? So how are you running the command 'SELECT session_user, current_database();' in a groovyscript step? Event handler step? Startup/teardown steps?
If you post the relevant script we should be able to help out.
Im guessing your current_database() method is pointing at your postgresql db, so youd need to find where the parms are set and change them accordingly.
Depending on what version of ReadyAPI you have you should be able to see which database connections that have already been setup.
Gonna need more info i think to provide further help.
Cheers,
Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2022
09:04 AM
04-14-2022
09:04 AM
I am talking about jdbc test step only. I am able to make successful connection to db using jdbc step.
Now if I run query SELECT session_user, current_database() , I see its pointing to default postgres db. My question is how I switch to some other db?
