Search in sources :

Example 1 with FBBlob

use of org.firebirdsql.jdbc.FBBlob in project jaybird by FirebirdSQL.

the class FBBlobField method copyBinaryStream.

private void copyBinaryStream(InputStream in, long length) throws SQLException {
    FBBlob blob = new FBBlob(gdsHelper);
    blob.copyStream(in, length);
    setFieldData(getDatatypeCoder().encodeLong(blob.getBlobId()));
    blobExplicitNull = false;
}
Also used : FBBlob(org.firebirdsql.jdbc.FBBlob)

Example 2 with FBBlob

use of org.firebirdsql.jdbc.FBBlob in project jaybird by FirebirdSQL.

the class FBBlobField method setClob.

@Override
public void setClob(FBClob clob) throws SQLException {
    FBBlob blob = clob.getWrappedBlob();
    setBlob(blob);
}
Also used : FBBlob(org.firebirdsql.jdbc.FBBlob)

Example 3 with FBBlob

use of org.firebirdsql.jdbc.FBBlob in project jaybird by FirebirdSQL.

the class FBLongVarCharField method copyBytes.

private void copyBytes(byte[] bytes, int length) throws SQLException {
    FBBlob blob = new FBBlob(gdsHelper);
    blob.copyBytes(bytes, 0, length);
    setFieldData(getDatatypeCoder().encodeLong(blob.getBlobId()));
    blobExplicitNull = false;
}
Also used : FBBlob(org.firebirdsql.jdbc.FBBlob)

Example 4 with FBBlob

use of org.firebirdsql.jdbc.FBBlob in project jaybird by FirebirdSQL.

the class FBBlobField method getBlob.

@Override
public Blob getBlob() throws SQLException {
    if (blob != null)
        return blob;
    final byte[] bytes = getFieldData();
    if (bytes == null)
        return null;
    /*@todo convert this into a method of FirebirdConnection */
    blob = new FBBlob(gdsHelper, getDatatypeCoder().decodeLong(bytes));
    return blob;
}
Also used : FBBlob(org.firebirdsql.jdbc.FBBlob)

Example 5 with FBBlob

use of org.firebirdsql.jdbc.FBBlob in project jaybird by FirebirdSQL.

the class FBBlobField method copyCharacterStream.

private void copyCharacterStream(Reader in, long length, Encoding encoding) throws SQLException {
    FBBlob blob = new FBBlob(gdsHelper);
    blob.copyCharacterStream(in, length, encoding);
    setFieldData(getDatatypeCoder().encodeLong(blob.getBlobId()));
    blobExplicitNull = false;
}
Also used : FBBlob(org.firebirdsql.jdbc.FBBlob)

Aggregations

FBBlob (org.firebirdsql.jdbc.FBBlob)10 Encoding (org.firebirdsql.encodings.Encoding)1