code: protected void writeDatabasePropertiesFile(String host, String port,
      String database, String user, String password, boolean useSSL, String schema)
    {
      File file = new File(System.getProperty("annis.home") + "/conf",
        "database.properties");
      try (BufferedWriter writer = new BufferedWriter(new FileWriterWithEncoding(
        file, "UTF-8"));)
      {
  
        writer.write("# database configuration\n");
        writer.write("datasource.driver=org.postgresql.Driver\n");
        writer.write("datasource.url=jdbc:postgresql://" + host + ":" + port + "/"
          + database + "\n");
        writer.write("datasource.username=" + user + "\n");
        writer.write("datasource.password=" + password + "\n");
        writer.write("datasource.ssl=" + (useSSL ? "true" : "false") + "\n");
        if (schema != null)
        {
          writer.write("datasource.schema=" + schema + "\n");
        }
      }
      catch (IOException e)
      {
        log.error("Couldn't write database properties file", e);
        throw new FileAccessException(e);
      }
      log.info("Wrote database configuration to " + file.getAbsolutePath());
    }
docs: /// Helper