code: private String fixDatabaseName(String databaseName, Record record, Map<String,String> oldProperties)
      {
          if (databaseName.endsWith(BaseDatabase.SHARED_SUFFIX))
              databaseName = databaseName.substring(0, databaseName.length() - BaseDatabase.SHARED_SUFFIX.length());
          else if (databaseName.endsWith(BaseDatabase.USER_SUFFIX))
              databaseName = databaseName.substring(0, databaseName.length() - BaseDatabase.USER_SUFFIX.length());
          String recordDBName = record.getDatabaseName();
          if (record instanceof DatabaseInfo)
              recordDBName = DatabaseInfo.DATABASE_INFO_FILE;
          if (!databaseName.startsWith(recordDBName))
          { // Typically user name
              this.getTask().setProperty(DBConstants.DB_USER_PREFIX, databaseName.substring(0, databaseName.indexOf('_')));
              databaseName = databaseName.substring(databaseName.indexOf('_') + 1);
          }
          if (!databaseName.endsWith(recordDBName))
          {
              String suffix = databaseName.substring(databaseName.lastIndexOf('_') + 1);
              if (suffix.length() == 2)
              { // Typically language
                  this.getTask().setProperty(DBParams.LANGUAGE, suffix);
                  databaseName = databaseName.substring(0, databaseName.lastIndexOf('_'));
                  suffix = databaseName.substring(databaseName.lastIndexOf('_') + 1);             
              }
              if (!databaseName.endsWith(recordDBName))
              {
                  databaseName = databaseName.substring(0, databaseName.lastIndexOf('_'));
                  if ((record.getDatabaseType() & DBConstants.USER_DATA) != 0)
                      this.getTask().setProperty(record.getDatabaseName() + BaseDatabase.DBUSER_PARAM_SUFFIX, suffix);
                  else
                      this.getTask().setProperty(record.getDatabaseName() + BaseDatabase.DBSHARED_PARAM_SUFFIX, suffix);
                  suffix = databaseName.substring(databaseName.lastIndexOf('_') + 1); //?         
              }
              if (!databaseName.endsWith(recordDBName))
              {
                  this.getTask().setProperty(DBConstants.SYSTEM_NAME, suffix);
                  databaseName = databaseName.substring(0, databaseName.lastIndexOf('_'));
              }
          }
          return databaseName;
      }
docs: Clean up the database name;
  @param databaseName
  @return.