All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nutz.dao.impl.jdbc.BlobValueAdaptor2 Maven / Gradle / Ivy

Go to download

Nutz, which is a collections of lightweight frameworks, each of them can be used independently

There is a newer version: 1.r.72
Show newest version
package org.nutz.dao.impl.jdbc;

import java.sql.Blob;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Types;

import org.nutz.filepool.FilePool;

public class BlobValueAdaptor2 extends BlobValueAdaptor {

    public BlobValueAdaptor2(FilePool pool) {
        super(pool);
    }

    public void set(PreparedStatement stat, Object obj, int i) throws SQLException {
        if (null == obj) {
            stat.setNull(i, Types.BLOB);
        } else {
            Blob blob = (Blob) obj;
            stat.setBinaryStream(i, blob.getBinaryStream(), blob.length());
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy