Class JdbcBlob

JdbcBlob

一个 JDBC Blob。如需查看此类的文档,请参阅 java.sql.Blob

方法

方法返回类型简介
free()void如需查看此方法的文档,请参阅 java.sql.Blob#free()
getAppsScriptBlob()Blob获取作为 Apps 脚本 blob 的此 JdbcBlob 的内容。
getAs(contentType)Blob返回此对象内的数据,并将其作为 blob 转换为指定内容类型。
getBytes(position, length)Byte[]如需查看此方法的文档,请参阅 java.sql.Blob#getBytes(long, int)
length()Integer如需查看此方法的文档,请参阅 java.sql.Blob#length()
position(pattern, start)Integer如需查看此方法的文档,请参阅 java.sql.Blob#position(byte[], long)
position(pattern, start)Integer如需查看此方法的文档,请参阅 java.sql.Blob#position(blob, long)
setBytes(position, blobSource)IntegerJdbcBlob 写入此 blob 的简便方法。
setBytes(position, blobSource, offset, length)IntegerJdbcBlob 写入此 blob 的简便方法。
setBytes(position, bytes)Integer如需查看此方法的文档,请参阅 java.sql.Blob#setBytes(long, byte[])
setBytes(position, bytes, offset, length)Integer如需查看此方法的文档,请参阅 java.sql.Blob#setBytes(long, byte[], int, int)
truncate(length)void如需查看此方法的文档,请参阅 java.sql.Blob#truncate(long)

详细文档

free()

如需查看此方法的文档,请参阅 java.sql.Blob#free()


getAppsScriptBlob()

获取作为 Apps 脚本 blob 的此 JdbcBlob 的内容。

弃踢回攻

Blob - 一个 Blob,可以直接由其他 Apps 脚本 API 使用。


getAs(contentType)

返回此对象内的数据,并将其作为 blob 转换为指定内容类型。此方法会为文件名添加适当的扩展名,例如“myfile.pdf”。不过,它假设最后一个英文句点后面的文件名部分(如果有)是应该替换的现有扩展名。因此,“ShoppingList.12.25.2014”将变为“ShoppingList.12.25.pdf”。

如需查看转化次数的每日配额,请参阅 Google 服务的配额。新创建的 Google Workspace 网域可能会暂时受到更严格的配额限制。

参数

名称类型说明
contentTypeString要转换为的 MIME 类型。对于大多数 blob,'application/pdf' 是唯一有效的选项。对于 BMP、GIF、JPEG 或 PNG 格式的图片,'image/bmp''image/gif''image/jpeg''image/png' 中的任何一个也都有效。

弃踢回攻

Blob - 作为 blob 的数据。


getBytes(position, length)

如需查看此方法的文档,请参阅 java.sql.Blob#getBytes(long, int)

参数

名称类型说明
positionInteger要提取的 blob 值中第一个字节的序数位置;第一个字节位于位置 1。
lengthInteger要复制的连续字节数;长度值必须等于或大于零。

弃踢回攻

Byte[] - 一个字节数组,最多可包含 blob 值中的指定连续字节数。


length()

如需查看此方法的文档,请参阅 java.sql.Blob#length()

弃踢回攻

Integer - 此 blob 中的字节数。


position(pattern, start)

如需查看此方法的文档,请参阅 java.sql.Blob#position(byte[], long)

参数

名称类型说明
patternByte[]要搜索的字节数组。
startInteger开始搜索的 blob 值中的位置;第一个位置为 1。

弃踢回攻

Integer - 指定模式开始的位置,如果未找到,则为 -1。


position(pattern, start)

如需查看此方法的文档,请参阅 java.sql.Blob#position(blob, long)

参数

名称类型说明
patternJdbcBlobJdbcBlob,表示要搜索的值,
startInteger开始搜索的 blob 值中的位置;第一个位置为 1。

弃踢回攻

Integer - 指定模式开始的位置,如果未找到,则为 -1。


setBytes(position, blobSource)

JdbcBlob 写入此 blob 的简便方法。

参数

名称类型说明
positionInteger在 blob 中开始写入的位置;第一个位置为 1。
blobSourceBlobSource要写入此 blob 的数据源。

弃踢回攻

Integer - 写入的字节数。


setBytes(position, blobSource, offset, length)

JdbcBlob 写入此 blob 的简便方法。

参数

名称类型说明
positionInteger在 blob 中开始写入的位置;第一个位置为 1。
blobSourceBlobSource要写入此 blob 的数据源。
offsetInteger所提供的字节数组的偏移量,从这里开始读取要设置的字节。
lengthInteger要写入 blob 的字节数。

弃踢回攻

Integer - 写入的字节数。


setBytes(position, bytes)

如需查看此方法的文档,请参阅 java.sql.Blob#setBytes(long, byte[])

参数

名称类型说明
positionInteger在 blob 中开始写入的位置;第一个位置为 1。
bytesByte[]要写入此 Blob 的字节数组。

弃踢回攻

Integer - 写入的字节数。


setBytes(position, bytes, offset, length)

如需查看此方法的文档,请参阅 java.sql.Blob#setBytes(long, byte[], int, int)

参数

名称类型说明
positionInteger在 blob 中开始写入的位置;第一个位置为 1。
bytesByte[]要写入此 Blob 的字节数组。
offsetInteger所提供的字节数组的偏移量,从这里开始读取要设置的字节。
lengthInteger要写入 blob 的字节数。

弃踢回攻

Integer - 写入的字节数。


truncate(length)

如需查看此方法的文档,请参阅 java.sql.Blob#truncate(long)

参数

名称类型说明
lengthInteger截断后此 blob 的大小(以字节为单位)。