Class JdbcBlob

JdbcBlob

A JDBC Blob. For documentation of this class, see java.sql.Blob.

Methods

MethodReturn typeBrief description
free()voidFor documentation of this method, see java.sql.Blob#free().
getAppsScriptBlob()BlobGets the content of this JdbcBlob as an Apps Script blob.
getAs(contentType)BlobReturn the data inside this object as a blob converted to the specified content type.
getBytes(position, length)Byte[]For documentation of this method, see java.sql.Blob#getBytes(long, int).
length()IntegerFor documentation of this method, see java.sql.Blob#length().
position(pattern, start)IntegerFor documentation of this method, see java.sql.Blob#position(byte[], long).
position(pattern, start)IntegerFor documentation of this method, see java.sql.Blob#position(java.sql.Blob, long).
setBytes(position, blobSource)IntegerConvenience method for BlobSources.
setBytes(position, blobSource, offset, length)IntegerConvenience method for BlobSources.
setBytes(position, bytes)IntegerFor documentation of this method, see java.sql.Blob#setBytes(long, byte[]).
setBytes(position, bytes, offset, length)IntegerFor documentation of this method, see java.sql.Blob#setBytes(long, byte[], int, int).
truncate(length)voidFor documentation of this method, see java.sql.Blob#truncate(long).

Detailed documentation

free()

For documentation of this method, see java.sql.Blob#free().


getAppsScriptBlob()

Gets the content of this JdbcBlob as an Apps Script blob.

Return

Blob — a Blob that can be used directly by other Apps Script APIs


getAs(contentType)

Return the data inside this object as a blob converted to the specified content type. This method adds the appropriate extension to the filename — for example, "myfile.pdf". However, it assumes that the part of the filename that follows the last period (if any) is an existing extension that should be replaced. Consequently, "ChristmasList.12.25.2014" will become "ChristmasList.12.25.pdf".

Parameters

NameTypeDescription
contentTypeStringthe MIME type to convert to. For most blobs, 'application/pdf' is the only valid option. For images in BMP, GIF, JPEG, or PNG format, any of 'image/bmp', 'image/gif', 'image/jpeg', or 'image/png' are also valid.

Return

Blob — the data as a blob


getBytes(position, length)

For documentation of this method, see java.sql.Blob#getBytes(long, int).

Parameters

NameTypeDescription
positionInteger
lengthInteger

Return

Byte[]


length()

For documentation of this method, see java.sql.Blob#length().

Return

Integer


position(pattern, start)

For documentation of this method, see java.sql.Blob#position(byte[], long).

Parameters

NameTypeDescription
patternByte[]
startInteger

Return

Integer


position(pattern, start)

For documentation of this method, see java.sql.Blob#position(java.sql.Blob, long).

Parameters

NameTypeDescription
patternJdbcBlob
startInteger

Return

Integer


setBytes(position, blobSource)

Convenience method for BlobSources.

Parameters

NameTypeDescription
positionInteger
blobSourceBlobSource

Return

Integer


setBytes(position, blobSource, offset, length)

Convenience method for BlobSources.

Parameters

NameTypeDescription
positionInteger
blobSourceBlobSource
offsetInteger
lengthInteger

Return

Integer


setBytes(position, bytes)

For documentation of this method, see java.sql.Blob#setBytes(long, byte[]).

Parameters

NameTypeDescription
positionInteger
bytesByte[]

Return

Integer


setBytes(position, bytes, offset, length)

For documentation of this method, see java.sql.Blob#setBytes(long, byte[], int, int).

Parameters

NameTypeDescription
positionInteger
bytesByte[]
offsetInteger
lengthInteger

Return

Integer


truncate(length)

For documentation of this method, see java.sql.Blob#truncate(long).

Parameters

NameTypeDescription
lengthInteger

Send feedback about...

Apps Script
Apps Script