Sha256: f0c2f006917e33508610c52b7c46f1defb37f6b946d3549dcadccbfa8fc63395

Contents?: true

Size: 1.41 KB

Versions: 23

Compression:

Stored size: 1.41 KB

Contents

package org.embulk.output.oracle;

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

import org.embulk.output.jdbc.JdbcOutputConnector;

public class OracleOutputConnector
        implements JdbcOutputConnector
{
    private final String url;
    private final Properties properties;
    private final String schemaName;
    private final boolean direct;

    public OracleOutputConnector(String url, Properties properties, String schemaName, boolean direct)
    {
        try {
            Class.forName("oracle.jdbc.OracleDriver");
        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }
        this.url = url;
        this.properties = properties;
        this.schemaName = schemaName;
        this.direct = direct;
    }

    @Override
    public OracleOutputConnection connect(boolean autoCommit) throws SQLException
    {
        Connection c = DriverManager.getConnection(url, properties);
        if (c == null) {
            // driver.connect returns null when url is "jdbc:mysql://...".
            throw new SQLException("Invalid url : " + url);
        }

        try {
            OracleOutputConnection con = new OracleOutputConnection(c, schemaName, autoCommit, direct);
            c = null;
            return con;

        } finally {
            if (c != null) {
                c.close();
            }
        }
    }
}

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
embulk-output-oracle-0.8.2 src/main/java/org/embulk/output/oracle/OracleOutputConnector.java
embulk-output-oracle-0.8.1 src/main/java/org/embulk/output/oracle/OracleOutputConnector.java
embulk-output-oracle-0.8.0 src/main/java/org/embulk/output/oracle/OracleOutputConnector.java
embulk-output-oracle-0.7.13 src/main/java/org/embulk/output/oracle/OracleOutputConnector.java
embulk-output-oracle-0.7.12 src/main/java/org/embulk/output/oracle/OracleOutputConnector.java
embulk-output-oracle-0.7.11 src/main/java/org/embulk/output/oracle/OracleOutputConnector.java
embulk-output-oracle-0.7.10 src/main/java/org/embulk/output/oracle/OracleOutputConnector.java
embulk-output-oracle-0.7.9 src/main/java/org/embulk/output/oracle/OracleOutputConnector.java
embulk-output-oracle-0.7.8 src/main/java/org/embulk/output/oracle/OracleOutputConnector.java
embulk-output-oracle-0.7.7 src/main/java/org/embulk/output/oracle/OracleOutputConnector.java
embulk-output-oracle-0.7.6 src/main/java/org/embulk/output/oracle/OracleOutputConnector.java
embulk-output-oracle-0.7.5 src/main/java/org/embulk/output/oracle/OracleOutputConnector.java
embulk-output-oracle-0.7.3 src/main/java/org/embulk/output/oracle/OracleOutputConnector.java
embulk-output-oracle-0.7.2 src/main/java/org/embulk/output/oracle/OracleOutputConnector.java
embulk-output-oracle-0.7.1 src/main/java/org/embulk/output/oracle/OracleOutputConnector.java
embulk-output-oracle-0.7.0 src/main/java/org/embulk/output/oracle/OracleOutputConnector.java
embulk-output-oracle-0.6.5 src/main/java/org/embulk/output/oracle/OracleOutputConnector.java
embulk-output-oracle-0.6.4 src/main/java/org/embulk/output/oracle/OracleOutputConnector.java
embulk-output-oracle-0.6.3 src/main/java/org/embulk/output/oracle/OracleOutputConnector.java
embulk-output-oracle-0.6.2 src/main/java/org/embulk/output/oracle/OracleOutputConnector.java