Package com.microsoft.sqlserver.jdbc
Class SQLServerBlob
java.lang.Object
com.microsoft.sqlserver.jdbc.SQLServerBlob
- All Implemented Interfaces:
java.io.Serializable,java.sql.Blob
public final class SQLServerBlob
extends java.lang.Object
implements java.sql.Blob, java.io.Serializable
Represents a binary LOB object and implements a java.sql.Blob.
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description SQLServerBlob(SQLServerConnection connection, byte[] data)Deprecated.UseSQLServerConnection.createBlob()instead. -
Method Summary
Modifier and Type Method Description voidfree()java.io.InputStreamgetBinaryStream()java.io.InputStreamgetBinaryStream(long pos, long length)byte[]getBytes(long pos, int length)longlength()longposition(byte[] bPattern, long start)longposition(java.sql.Blob pattern, long start)java.io.OutputStreamsetBinaryStream(long pos)intsetBytes(long pos, byte[] bytes)intsetBytes(long pos, byte[] bytes, int offset, int len)java.lang.StringtoString()voidtruncate(long len)
-
Constructor Details
-
SQLServerBlob
Deprecated.UseSQLServerConnection.createBlob()instead.Create a new BLOB- Parameters:
connection- the database connection this blob is implemented ondata- the BLOB's data
-
-
Method Details
-
toString
public final java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
free
public void free() throws java.sql.SQLException- Specified by:
freein interfacejava.sql.Blob- Throws:
java.sql.SQLException
-
getBinaryStream
public java.io.InputStream getBinaryStream() throws java.sql.SQLException- Specified by:
getBinaryStreamin interfacejava.sql.Blob- Throws:
java.sql.SQLException
-
getBinaryStream
public java.io.InputStream getBinaryStream(long pos, long length) throws java.sql.SQLException- Specified by:
getBinaryStreamin interfacejava.sql.Blob- Throws:
java.sql.SQLException
-
getBytes
public byte[] getBytes(long pos, int length) throws java.sql.SQLException- Specified by:
getBytesin interfacejava.sql.Blob- Throws:
java.sql.SQLException
-
length
public long length() throws java.sql.SQLException- Specified by:
lengthin interfacejava.sql.Blob- Throws:
java.sql.SQLException
-
position
public long position(java.sql.Blob pattern, long start) throws java.sql.SQLException- Specified by:
positionin interfacejava.sql.Blob- Throws:
java.sql.SQLException
-
position
public long position(byte[] bPattern, long start) throws java.sql.SQLException- Specified by:
positionin interfacejava.sql.Blob- Throws:
java.sql.SQLException
-
truncate
public void truncate(long len) throws java.sql.SQLException- Specified by:
truncatein interfacejava.sql.Blob- Throws:
java.sql.SQLException
-
setBinaryStream
public java.io.OutputStream setBinaryStream(long pos) throws java.sql.SQLException- Specified by:
setBinaryStreamin interfacejava.sql.Blob- Throws:
java.sql.SQLException
-
setBytes
public int setBytes(long pos, byte[] bytes) throws java.sql.SQLException- Specified by:
setBytesin interfacejava.sql.Blob- Throws:
java.sql.SQLException
-
setBytes
public int setBytes(long pos, byte[] bytes, int offset, int len) throws java.sql.SQLException- Specified by:
setBytesin interfacejava.sql.Blob- Throws:
java.sql.SQLException
-