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.Clob ; 29 30 35 public class ClobDataType extends StringDataType 36 { 37 public ClobDataType() 38 { 39 super("CLOB", Types.CLOB); 40 } 41 42 public Object getSqlValue(int column, ResultSet resultSet) throws SQLException , TypeCastException 43 { 44 Clob value = resultSet.getClob(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.LONGVARCHAR.getSqlType()); 56 } 57 } 58 | Popular Tags |