Commander4j Interface Services Install

From Commander4j Wiki
Jump to: navigation, search

From version 4.21 the process for creating a Service for interfacing has become much easier to setup. If you have a prior version of Commander4j and you have already created a service you should use the "uninstall service" shortcut to remove it and then follow the instructions below to create a new service.


Although you can connect to more that one database with a single install of C4J, only one of those databases can be managed by a single service. If you want to operate more than one database on a single server it is recommended that you install the application into a unique folder for each database. For example you could use the following structure.

Service for Database 1 (Company 1)


Service for Database 2 (Company 2)


The physical database can reside anywhere on the network, you don't need to have the C4J Application/Service installed on the database server.


Service config.jpg

The above screen shows a config with multiple databases defined. As mentioned previously, in a situation like this you can only assign the service to manage one of these, so it might be better to install the application multiple times. However in this case I have selected the database that i want to configure for use with the service by selecting it, clicking on the assign button and then saving the config. You will notice that a field marked "Unique ID" is now populated with the word "service". This allows the service application to identify which database to connect to where there are more than one.


Open up a command window and change into the installation directory.

For example

CD \MyApps\Folder1\Commander4j

Now type this command to create the service

Service4j /install myservicename

On a computer that you only intend to have 1 service installed you can omit "my service" and it will use a default value. If you computer needs to have more than one service installed then you need to ensure that "myservice" is a unique identifier, without spaces and meaningful, for example :-

Service4j /install

Service4j /install Commander4j_Company1

Service4j /install Commander4j_Company2


Simply use the same command, but change the parameter /install to /uninstall

Service4j /uninstall

Service4j /uninstall Commander4j_Company1

Service4j /uninstall Commander4j_Company2