public static Blob toBlob(Connection conn,Object value) throws PageException, SQLException {
  if (value instanceof Blob)   return (Blob)value;
  if (SystemUtil.JAVA_VERSION >= SystemUtil.JAVA_VERSION_1_6) {
    try {
      Blob blob=conn.createBlob();
      blob.setBytes(1,Caster.toBinary(value));
      return blob;
    }
 catch (    Throwable t) {
      return BlobImpl.toBlob(value);
    }
  }
  if (isOracle(conn)) {
    Blob blob=OracleBlob.createBlob(conn,Caster.toBinary(value),null);
    if (blob != null)     return blob;
  }
  return BlobImpl.toBlob(value);
}

public static Blob toBlob ( Connection conn , Object value ) throws PageException , SQLException { if ( value instanceof Blob ) return ( Blob ) value ; if ( SystemUtil . JAVA_VERSION >= SystemUtil . JAVA_VERSION_1_6 ) { try { Blob blob = conn . createBlob ( ) ; blob . setBytes ( 1 , Caster . toBinary ( value ) ) ; return blob ; } catch ( Throwable t ) { return BlobImpl . toBlob ( value ) ; } } if ( isOracle ( conn ) ) { Blob blob = OracleBlob . createBlob ( conn , Caster . toBinary ( value ) , null ) ; if ( blob != null ) return blob ; } return BlobImpl . toBlob ( value ) ; }
create a blog object
