oracle.sql.BLOB.length()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(160)

本文整理了Java中oracle.sql.BLOB.length()方法的一些代码示例,展示了BLOB.length()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BLOB.length()方法的具体详情如下:
包路径:oracle.sql.BLOB
类名称:BLOB
方法名:length

BLOB.length介绍

暂无

代码示例

代码示例来源:origin: com.bbossgroups/bboss-persistent

/**
 * Returns the bytes from a result set
 * 
 * @param res
 *            The ResultSet to read from
 * @param columnName
 *            The name of the column to read from
 * 
 * @return The byte value from the column
 */
public byte[] getBytesFromResultset(ResultSet res, String columnName)
    throws SQLException {
  // read the bytes from an oracle blob
  oracle.sql.BLOB blob = ((OracleResultSet) res).getBLOB(columnName);
  byte[] content = new byte[(int) blob.length()];
  content = blob.getBytes(1, (int) blob.length());
  return content;
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * Write LOB value - only on Oracle8 and up
 */
@SuppressWarnings("deprecation")
public void writeLOB(DatabaseField field, Object value, ResultSet resultSet, AbstractSession session) throws SQLException {
  if (isBlob(field.getType())) {
    //change for 338585 to use getName instead of getNameDelimited
    oracle.sql.BLOB blob = (oracle.sql.BLOB)resultSet.getObject(field.getName());
    //we could use the jdk 1.4 java.nio package and use channel/buffer for the writing 
    //for the time being, simply use Oracle api.
    blob.putBytes(1, (byte[])value);
    //impose the locallization
    session.log(SessionLog.FINEST, SessionLog.SQL, "write_BLOB", Long.valueOf(blob.length()), field.getName());
  } else if (isClob(field.getType())) {
    //change for 338585 to use getName instead of getNameDelimited
    oracle.sql.CLOB clob = (oracle.sql.CLOB)resultSet.getObject(field.getName());
    //we could use the jdk 1.4 java.nio package and use channel/buffer for the writing
    //for the time being, simply use Oracle api.
    clob.putString(1, (String)value);
    //impose the locallization
    session.log(SessionLog.FINEST, SessionLog.SQL, "write_CLOB", Long.valueOf(clob.length()), field.getName());
  } else {
    //do nothing for now, open to BFILE or NCLOB types
  }
}

代码示例来源:origin: io.snappydata/gemfire-hydra-tests

BLOB blob = (BLOB)((OracleResultSet) rs).getBlob(1);
int len = (int) blob.length();
data = blob.getBytes(1,len);
if (DBParms.getDriverLogging()) {

相关文章