Sha256: 7972efa275ceba700e310538fc97639fb70d5a2f52c0577f04992772711f1aa9

Contents?: true

Size: 1.35 KB

Versions: 1

Compression:

Stored size: 1.35 KB

Contents

package org.embulk.output.snowflake;

import com.google.common.base.Optional;
import net.snowflake.client.jdbc.SnowflakeSQLException;
import net.snowflake.client.jdbc.SnowflakeType;
import org.embulk.output.jdbc.AbstractJdbcOutputConnector;
import org.embulk.output.jdbc.JdbcColumn;
import org.embulk.output.jdbc.JdbcOutputConnection;
import org.embulk.output.jdbc.TransactionIsolation;

import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Enumeration;
import java.util.Properties;

public class SnowflakeOutputConnector extends AbstractJdbcOutputConnector
{
    private final String url;
    private final Properties properties;

    public SnowflakeOutputConnector(String url, Properties properties,
                                     Optional<TransactionIsolation> transactionIsolation)
    {
        super(transactionIsolation);

        this.url = url;
        this.properties = properties;
    }

    @Override
    protected JdbcOutputConnection connect() throws SQLException
    {
        Connection c = DriverManager.getConnection(url, properties);
        try {
            SnowflakeOutputConnection con = new SnowflakeOutputConnection(c);
            c = null;
            return con;
        } finally {
            if (c != null) {
                c.close();
            }
        }
    }

}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
embulk-output-snowflake-0.2.0 src/main/java/org/embulk/output/snowflake/SnowflakeOutputConnector.java