Pass connectionstring Parameter to DatabaseConnection_SetConnectionStringForSession.

 Pass connectionstring Parameter to DatabaseConnection_SetConnectionStringForSession.

  

Hi,

   I am using PlatformRuntime_Api to switch the database dynamically. and  passing the connectionstring parameter like,

"Data Source=MyOracleDB;User Id=Username;Password=myPassword;
Integrated Security=no;"

Is it the right format to pass?




Thanks

Rajendra singh

Hi Rajendra

If the database you are connecting is Oracle and the stack is .NET then yes. Otherwise you have to pass a valid connection string for the Stack (.NET or Java) and DBMS.

Thanks João Amorim, Due to some security reasons we are not able to get the credentials,is there any way to switch  database using data source?


Thanks 

Rajendra Singh

Hi Rajendra

Can you tell me if you are changing the connection string to the platform database or an external database?

Either way, as long as the the DBMS is same (Oracle) and the tables exists in the other database, you should be able to switch by changing the "Data Source" parameter in the connection string.

thanks  João Amorim,  

I am changing the connection string to an  external database.

you mean  i can pass only the datasource name in connectionstring parameter.

 even if i am passing the wrong connectionname and connectionstring, not able to get any error, its just ignoring the api action.


Thanks 

Rajendra Singh

Hi Rajendra

Some things to be aware:

  1. You have to pass the complete connection string, not just the "DataSource=xxx" part
  2. The actions sets the connection string for the session, make sure that you aren't using an old connection string
  3. Even if you change the connection string, you have to make sure that the database identifier isn't causing conflicts with your intended change (see the attached image)

Thanks João Amorim,

From some other source i got to know that

1: we can not change the platform database connection, we can only use this action to switch from one external connection to other.

2:-This action will never through the exception even if you are providing the wrong parameters.

 is it? 


Thanks 

Rajendra Singh



Solution

Hi Rajendra


Regarding #1, I thought you said before you trying to change a connection to an external database.

Regarding #2, the action doesn't throw an exception because it only sets the value of the connection string. The error will only occur when you try to access the database (via aggregate/entity action).


Cheers

Solution

Thanks João Amorim,  

I mean i was trying to change the platform database connection to an external database connection.

Thanks for your great help..