package do_postgres;

import data_objects.drivers.AbstractDriverDefinition;
import java.util.Properties;

public class PostgresDriverDefinition extends AbstractDriverDefinition {

    public final static String URI_SCHEME = "postgresql";
    public final static String JDBC_URI_SCHEME = "postgresql";
    public final static String RUBY_MODULE_NAME = "Postgres";

    public PostgresDriverDefinition() {
        super(URI_SCHEME, RUBY_MODULE_NAME);
    }

    @Override
    protected void verifyScheme(String scheme) {
        if (!"postgres".equals(scheme)) {
            throw new RuntimeException(
                    "scheme mismatch, expected: postgres but got: " + scheme);
        }
    }

    @Override
    public boolean supportsJdbcGeneratedKeys()
    {
        return false;
    }

    @Override
    public boolean supportsJdbcScrollableResultSets() {
        return true;
    }

    @Override
    public boolean supportsConnectionEncodings()
    {
        return true;
    }

    @Override
    public void setEncodingProperty(Properties props, String encodingName) {
        // this is redundant as of Postgres 8.0, according to the JDBC documentation:
        // http://jdbc.postgresql.org/documentation/80/connect.html
        props.put("charSet", encodingName);
    }

}

package do_postgres;

import data_objects.drivers.AbstractDriverDefinition;
import java.util.Properties;

public class PostgresDriverDefinition extends AbstractDriverDefinition {

    public final static String URI_SCHEME = "postgres";
    public final static String JDBC_URI_SCHEME = "postgresql";
    public final static String RUBY_MODULE_NAME = "Postgres";

    public PostgresDriverDefinition() {
        super(URI_SCHEME, JDBC_URI_SCHEME, RUBY_MODULE_NAME);
    }

    @Override
    public boolean supportsJdbcGeneratedKeys()
    {
        return false;
    }

    @Override
    public boolean supportsJdbcScrollableResultSets() {
        return true;
    }

    @Override
    public boolean supportsConnectionEncodings()
    {
        return true;
    }

    @Override
    public void setEncodingProperty(Properties props, String encodingName) {
        // this is redundant as of Postgres 8.0, according to the JDBC documentation:
        // http://jdbc.postgresql.org/documentation/80/connect.html
        props.put("charSet", encodingName);
    }

}

Fix omission in previous commit 490d652
[do_jdbc] Fix omission in previous commit 490d652

* PostgresDriverDefinition should have been updated to
  use overloaded constructor in AbstractDriverDefinition.

Signed-off-by: Alex Coles <60c6d277a8bd81de7fdde19201bf9c58a3df08f4@alexcolesportfolio.com>
