1 16 17 package org.springframework.orm.ibatis.support; 18 19 import java.sql.PreparedStatement ; 20 import java.sql.ResultSet ; 21 import java.sql.SQLException ; 22 23 import org.springframework.jdbc.support.lob.LobCreator; 24 import org.springframework.jdbc.support.lob.LobHandler; 25 26 39 public class BlobByteArrayTypeHandler extends AbstractLobTypeHandler { 40 41 46 public BlobByteArrayTypeHandler() { 47 super(); 48 } 49 50 53 protected BlobByteArrayTypeHandler(LobHandler lobHandler) { 54 super(lobHandler); 55 } 56 57 protected void setParameterInternal( 58 PreparedStatement ps, int index, Object value, String jdbcType, LobCreator lobCreator) 59 throws SQLException { 60 lobCreator.setBlobAsBytes(ps, index, (byte[]) value); 61 } 62 63 protected Object getResultInternal(ResultSet rs, int index, LobHandler lobHandler) 64 throws SQLException { 65 return lobHandler.getBlobAsBytes(rs, index); 66 } 67 68 public Object valueOf(String s) { 69 return s.getBytes(); 70 } 71 72 } 73 | Popular Tags |