package com.zkqy.system.entity;

import org.apache.ibatis.type.BaseTypeHandler;
import org.apache.ibatis.type.JdbcType;

import java.sql.*;

public class BlobTypeHandler extends BaseTypeHandler<Blob> {  
  
    @Override  
    public void setNonNullParameter(PreparedStatement ps, int i, Blob parameter, JdbcType jdbcType) throws SQLException {  
        ps.setBlob(i, parameter);  
    }  
  
    @Override  
    public Blob getNullableResult(ResultSet rs, String columnName) throws SQLException {  
        Blob blob = rs.getBlob(columnName);
        return blob;  
    }  
  
    @Override  
    public Blob getNullableResult(ResultSet rs, int columnIndex) throws SQLException {  
        Blob blob = rs.getBlob(columnIndex);  
        return blob;  
    }  
  
    @Override  
    public Blob getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {  
        Blob blob = cs.getBlob(columnIndex);  
        return blob;  
    }  
}