Hi All,
In the servoy-admin page we can see all db server names along with its configuration details.
Is it possible to get all the db server names in a solution.
so that I can select any dbserver name and then according to selected db server name a value list of all table will be generate. and after selecting the table name , table records will display just like in crm ad hoc sql .
We can get the server names that are related to the solutions .
but I need to find out all db server names.
Thanks Patric,
Plugin means…
I need to read the properties of server.
Can anyone suggest me what are the classes or related interfaces I need to use because there are number of classes and interfaces in the java servoy API
As the Servoy-admin page is showing all the db server names that implies
there is some class or interface is available.
You need to create a client / server plugin (see Servoy’s mail plugin on how to do that). Then on the server side it’s easy. Just do something like this:
Properties props = server.getSettings();
// where server is an IServerAccess object
// then loop over the properties or call
// String propName = props.getProperty(“server.” + x + “.serverName”);
// where x is a counter starting from 0
I suppose your server variable is null. You have to register a RMI service for your server plugin. Again, look at Servoy’s mail plugin to see how that is done. Especially, look at the initialize method.
Of course, you can also consider to ask someone to create a plugin for you. I could do that, for example .
With that piece of code you are looping through all properties.
I am sure you will see more null pointers than actual server connections.
You will have to code ‘cleaner’…
If a property is not found, it should not throw an exception, should it? So the loop should not be the problem. My guess is that the IServerAccess object is null, so it fails when actually getting the properties.