private static String establishConnectionString(CommandLineWrapper pCommandLine){
    
    String lConnectionString;
    String lCmdLineJDBC = pCommandLine.getOption(CommandLineOption.JDBC_CONNECT_STRING);
    if(!XFUtil.isNull(lCmdLineJDBC)){
      //1) if specified in full, use that
      lConnectionString = lCmdLineJDBC;
    }
    else {
      //2) if not specified, look for individual arguments
      String lHostName = pCommandLine.getOption(CommandLineOption.DB_HOST);
      String lPort = pCommandLine.getOption(CommandLineOption.DB_PORT);
      String lSID = pCommandLine.getOption(CommandLineOption.DB_SID);
      String lServiceName = pCommandLine.getOption(CommandLineOption.DB_SERVICE_NAME);
      
      //3) If still not specified, prompt user
      if(XFUtil.isNull(lHostName)){
        lHostName = CommandLineWrapper.readArg("Enter database hostname", false);
      }
      
      if(XFUtil.isNull(lPort)){
        lPort = CommandLineWrapper.readArg("Enter database port", false);
      }
      
      if(XFUtil.isNull(lSID) && XFUtil.isNull(lServiceName)){
        lSID = CommandLineWrapper.readArg("Enter database SID (for service name, specify -service argument)", false);
      }      
      
      if(!XFUtil.isNull(lSID)){
        //Construct SID connect syntax if a SID was specified
        lConnectionString = JDBC_PREFIX + lHostName + ":" + lPort + ":" + lSID;
      }
      else {
        //Otherwise construct service name connect syntax
        lConnectionString = JDBC_PREFIX + "//" + lHostName + ":" + lPort + "/" + lServiceName;
      }
      
    }   
    
    return lConnectionString;
  }