1 21 22 package org.dbunit.dataset.datatype; 23 24 import java.sql.PreparedStatement ; 25 import java.sql.ResultSet ; 26 import java.sql.SQLException ; 27 import java.sql.Types ; 28 import java.sql.Blob ; 29 30 35 public class BlobDataType extends BytesDataType 36 { 37 public BlobDataType() 38 { 39 super("BLOB", Types.BLOB); 40 } 41 42 public Object getSqlValue(int column, ResultSet resultSet) throws SQLException , TypeCastException 43 { 44 Blob value = resultSet.getBlob(column); 45 if (value == null || resultSet.wasNull()) 46 { 47 return null; 48 } 49 return typeCast(value); 50 } 51 52 public void setSqlValue(Object value, int column, PreparedStatement statement) throws SQLException , TypeCastException 53 { 54 statement.setObject(column, typeCast(value), 55 DataType.LONGVARBINARY.getSqlType()); 56 } 57 } 58 | Popular Tags |