Ask a Question

How do I switch DB for postgresql using ReadyApi?

indraniria
Contributor

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
richie
Community Hero

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
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
indraniria
Contributor

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?Capture.PNG

cancel
Showing results for 
Search instead for 
Did you mean: