You don't need any special connection to do this. Here is a sample code to shutdown a eway.
// Set the parameters. May be you can read them from database
String registryHost = "localhost";
String schema = "MyTestSchema";
String controlBroker = "localhost_cb";
String user = "Administrator";
String password = "STC";
// Here the command is shutdown. We can also get the eway name
// programmatically using EGate.getLogicalName() method.
String command = "shutdown ewShutDownTest_MM";
String exeCommand = "";
// Create the shell command to execute
exeCommand = "stccmd -rh " + registryHost + " -rs " + schema + " -cb "
+ controlBroker + " -un " + user + " -up " + password +
" -cmd \"" + command + "\"";
// log some information
EGate.traceln(EGate.TRACE_EVENT_PUTINLOGMASK,
EGate.TRACE_EVENT_INFORMATION, "Sending the shutdown
request to shutdown the eway"

;
EGate.traceln(EGate.TRACE_EVENT_PUTINLOGMASK,
EGate.TRACE_EVENT_INFORMATION, "Command being
executed = " + exeCommand);
// execute the shell command
Runtime.getRuntime().exec(exeCommand);-