get Server URL

Can I get the URL of a server connection?

I’d like to show that information in a form, but I have only found the getDatabaseProductName in the Database Manager node :(

why are you looking for a server url in the database manager node?

look under “application”

In Application node I’ve found getServerURL: shows the URL of the Application Server (i.e.: http://192.168.0.1:8080). But I don’t need it.

In the Database Servers node you configure the connections to the DBs; one of their properties is URL (i.e. for MySQL: jdbc:mysql://localhost/dbname). This is the URL that I want (or the connection string).

Thanks

Hi Log-Out,

Just curious. Why do you need to know the database connection URL in your solution ?

While we develop our solution, sometimes we use the DB Production Server to show data and sometimes we use the Backup server. It’s important for us to know which server we are connected to. It would be easier for me to show the connection string in a form that to watch in the DB Servers node.

Just for it.

I would create 2 server connections: 1 Production server (let’s call it ‘prod_server’), and 1 Backup server (let’s call it ‘backup_server’)

Then I would create a global variable (a constant really) in the solution globals:

var SERVER_TO_USE = 'prod_server';

and edit it to

var SERVER_TO_USE = 'backup_server'; 

when I need to use the Backup server.

and finally in the solution’s onOpen() I would put that code:

databaseManager.switchServer('prod_server', globals.SERVER_TO_USE);

This way, I know what server I use from the content of that global and I can even display it somewhere on a form if needed.

Hope this helps,

It’s a good solutions. Thanks!