Sha256: 5fcdcc95392a185bf92d9988bad49bf88749c643d3034cd6098674693ddfc089

Contents?: true

Size: 1.07 KB

Versions: 25

Compression:

Stored size: 1.07 KB

Contents

package org.embulk.output.postgresql;

import java.util.Properties;
import java.sql.Driver;
import java.sql.Connection;
import java.sql.SQLException;
import org.embulk.output.jdbc.JdbcOutputConnector;

public class PostgreSQLOutputConnector
        implements JdbcOutputConnector
{
    private static final Driver driver = new org.postgresql.Driver();

    private final String url;
    private final Properties properties;
    private final String schemaName;

    public PostgreSQLOutputConnector(String url, Properties properties, String schemaName)
    {
        this.url = url;
        this.properties = properties;
        this.schemaName = schemaName;
    }

    @Override
    public PostgreSQLOutputConnection connect(boolean autoCommit) throws SQLException
    {
        Connection c = driver.connect(url, properties);
        try {
            PostgreSQLOutputConnection con = new PostgreSQLOutputConnection(c, schemaName, autoCommit);
            c = null;
            return con;
        } finally {
            if (c != null) {
                c.close();
            }
        }
    }
}

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
embulk-output-postgresql-0.7.12 src/main/java/org/embulk/output/postgresql/PostgreSQLOutputConnector.java
embulk-output-postgresql-0.7.11 src/main/java/org/embulk/output/postgresql/PostgreSQLOutputConnector.java
embulk-output-postgresql-0.7.10 src/main/java/org/embulk/output/postgresql/PostgreSQLOutputConnector.java
embulk-output-postgresql-0.7.9 src/main/java/org/embulk/output/postgresql/PostgreSQLOutputConnector.java
embulk-output-postgresql-0.7.8 src/main/java/org/embulk/output/postgresql/PostgreSQLOutputConnector.java
embulk-output-postgresql-0.7.7 src/main/java/org/embulk/output/postgresql/PostgreSQLOutputConnector.java
embulk-output-postgresql-0.7.6 src/main/java/org/embulk/output/postgresql/PostgreSQLOutputConnector.java
embulk-output-postgresql-0.7.5 src/main/java/org/embulk/output/postgresql/PostgreSQLOutputConnector.java
embulk-output-postgresql-0.7.4 src/main/java/org/embulk/output/postgresql/PostgreSQLOutputConnector.java
embulk-output-postgresql-0.7.3 src/main/java/org/embulk/output/postgresql/PostgreSQLOutputConnector.java
embulk-output-postgresql-0.7.2 src/main/java/org/embulk/output/postgresql/PostgreSQLOutputConnector.java
embulk-output-postgresql-0.7.1 src/main/java/org/embulk/output/postgresql/PostgreSQLOutputConnector.java
embulk-output-postgresql-0.7.0 src/main/java/org/embulk/output/postgresql/PostgreSQLOutputConnector.java
embulk-output-postgresql-0.6.5 src/main/java/org/embulk/output/postgresql/PostgreSQLOutputConnector.java
embulk-output-postgresql-0.6.4 src/main/java/org/embulk/output/postgresql/PostgreSQLOutputConnector.java
embulk-output-postgresql-0.6.3 src/main/java/org/embulk/output/postgresql/PostgreSQLOutputConnector.java
embulk-output-postgresql-0.6.2 src/main/java/org/embulk/output/postgresql/PostgreSQLOutputConnector.java
embulk-output-postgresql-0.6.1 src/main/java/org/embulk/output/postgresql/PostgreSQLOutputConnector.java
embulk-output-postgresql-0.6.0 src/main/java/org/embulk/output/postgresql/PostgreSQLOutputConnector.java
embulk-output-postgresql-0.5.1 src/main/java/org/embulk/output/postgresql/PostgreSQLOutputConnector.java