📄 oracleblob.java
字号:
package gov.gdlt.ssgly.taxcore.taxdao.gzda.persistence.blob;
import com.ibatis.sqlmap.client.extensions.*;
import oracle.sql.BLOB;
import java.sql.SQLException;
public class OracleBlob implements TypeHandlerCallback {
BLOB m_blob = null;
//weblogic.jdbc.vendor.oracle.OracleThinBlob m_blob=null;
public OracleBlob() { }
/**
* getResult
*
* @param resultGetter ResultGetter
* @return Object
* @throws SQLException
* @todo Implement this
* com.ibatis.sqlmap.client.extensions.TypeHandlerCallback method
*/
public Object getResult(ResultGetter resultGetter) throws SQLException {
m_blob = (BLOB) resultGetter.getBlob();
//m_blob = (weblogic.jdbc.vendor.oracle.OracleThinBlob) resultGetter.getBlob();
//if (m_blob == null || m_blob.length() == 0) {
// return null;
//} else {
//m_blob.getSubString((long) 1, (int) m_blob.length());
//System.out.println("--------------blob length:" + m_blob.length());
//m_blob.getBinaryOutputStream(1);
return m_blob;
//}
}
/**
* setParameter
*
* @param parameterSetter ParameterSetter
* @param object Object
* @throws SQLException
* @todo Implement this
* com.ibatis.sqlmap.client.extensions.TypeHandlerCallback method
*/
public void setParameter(ParameterSetter parameterSetter, Object object) throws
SQLException {
parameterSetter.setBlob((BLOB)object);
//parameterSetter.setBlob((weblogic.jdbc.vendor.oracle.OracleThinBlob)object);
}
/**
* valueOf
*
* @param string String
* @return Object
* @todo Implement this
* com.ibatis.sqlmap.client.extensions.TypeHandlerCallback method
*/
public Object valueOf(String string) {
byte[] in_b = string.getBytes();
try {
m_blob.putBytes(1,in_b);
//m_blob.setBytes(1, in_b);
} catch (SQLException se) {
se.printStackTrace();
}
//System.out.println("valueOf " + m_blob);
return m_blob;
}
public static void main(String[] args) {
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -