Sha256: 65ac608958bbb0eae002141d8b31aee9c2a6cbde58995a7f52b42a40ae02758c

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

package org.embulk.output.mysql;

import java.util.List;
import java.io.IOException;
import java.sql.Types;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import com.google.common.base.Optional;
import org.embulk.output.jdbc.StandardBatchInsert;

public class MySQLBatchInsert
        extends StandardBatchInsert
{
    public MySQLBatchInsert(MySQLOutputConnector connector, Optional<List<String>> mergeKeys) throws IOException, SQLException
    {
        super(connector, mergeKeys);
    }

    @Override
    public void setFloat(float v) throws IOException, SQLException
    {
        if (Float.isNaN(v) || Float.isInfinite(v)) {
            setNull(Types.REAL);  // TODO get through argument
        } else {
            super.setFloat(v);
        }
    }

    @Override
    public void setDouble(double v) throws IOException, SQLException
    {
        if (Double.isNaN(v) || Double.isInfinite(v)) {
            setNull(Types.DOUBLE);  // TODO get through argument
        } else {
            super.setDouble(v);
        }
    }
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
embulk-output-mysql-0.4.1 src/main/java/org/embulk/output/mysql/MySQLBatchInsert.java