Starting a Network Server

Clients can connect to a NetworkInterface using the SQLFire JDBC client driver (URL of the form 'jdbc:sqlfire://<host>:<port>'). A network listener can be acquired by invoking the startNetworkServer method on a FabricServer instance. SQLFire uses the Distributed Relational Database Architecture (DRDA) protocol for client-server communication.

Network Server Properties

Specify network server properties when starting a network server on a SQLFire member. You must specify these properties as system properties:
  • When using the sqlf utility, specify network server properties at the command line when you boot a SQLFire server.
  • When using the embedded JDBC driver, specify all network server properties in the first JDBC connection to the SQLFire member.
  • When using the FabricServer API, you can start the FabricServer instance and NetworkListener independently of one another. For example you can start a FabricServer instance, populate tables with initial or default data, and then start a Network Listener at a later time to enable client connections. Include all Network Server properties in the Properties object when you execute the FabricService.startNetworkServer() method.

The FabricServer API promotes properties in the configuration parameter to an equivalent system property if the application does not override them.

Network server startup properties use the prefix 'sqlfire.drda.' The following properties are available:

sqlfire.drda.host

sqlfire.drda.keepAlive

sqlfire.drda.logConnections

sqlfire.drda.maxThreads

sqlfire.drda.minThreads

sqlfire.drda.portNumber

sqlfire.drda.securityMechanism

sqlfire.drda.sslMode

sqlfire.drda.streamOutBufferSize

sqlfire.drda.timeSlice

sqlfire.drda.trace

sqlfire.drda.traceAll

sqlfire.drda.traceDirectory

Example

The following sample code shows how to start a Network Listener after specifying several properties.

   import com.vmware.sqlfire.*; 

  // start a fabricserver if not running already.
   FabricServer fserver = FabricServiceManager.getFabricServerInstance(); 
   if (fserver.status() != FabricService.State.RUNNING) { 
     Properties props = new Properties(); 
     props.setProperty("mcast-port", "23342"); 
     props.setProperty("conserve-sockets", "false"); 
     props.setProperty("log-level", "fine"); 
     props.setProperty("host-data", "true"); 

     fserver.start(props); 
   } 

  // commonly used network server  properties
   Properties netprops = new Properties(); 
   netprops.setProperty("sqlfire.drda.minThreads", "10"); 
   netprops.setProperty("sqlfire.drda.maxThreads", "100"); 
   netprops.setProperty("sqlfire.drda.keepAlive", "1000"); 
   netprops.setProperty("sqlfire.drda.sslMode" , "off"); // Other possible values 
                                                         // are "basic" for encryption
                                                         // only with no client
                                                         // authentication, and 
                                                         // "peerAuthentication"
                                                         // for encryption with
                                                         // SSL clients.

   // now start a network server listening on port 4343.
   NetworkInterface netserver = fserver.startNetworkServer("localhost", 4343, netprops); 
 
   System.out.println("started network server properties with \n" +
       netserver.getSysinfo());