クラス org.objectweb.cjdbc.driver.Blob

すべてのメンバ一覧

説明

The representation (mapping) in the Java TM programming language of an SQL BLOB value. An SQL BLOB is a built-in type that stores a Binary Large Object as a column value in a row of a database table. By default drivers implement Blob using an SQL locator(BLOB), which means that a Blob object contains a logical pointer to the SQL BLOB data rather than the data itself. A Blob object is valid for the duration of the transaction in which is was created.

Methods in the interfaces DriverResultSet,CallableStatement, and PreparedStatement, such as getBlob and setBlob allow a programmer to access an SQL BLOB value. The Blob interface provides methods for getting the length of an SQL BLOB (Binary Large Object) value, for materializing a BLOB value on the client, and for determining the position of a pattern of bytes within a BLOB value. In addition, this interface has methods for updating a BLOB value.

作者:
Emmanuel Cecchet

Nicolas Modrzyk

から:
JDK 1.2

Blob.java55 行で定義されています。

Public メソッド

 Blob (byte[] data)
long length () throws SQLException
byte[] getBytes (long pos, int length) throws SQLException
java.io.InputStream getBinaryStream () throws SQLException
long position (byte pattern[], long start) throws SQLException
long position (java.sql.Blob pattern, long start) throws SQLException
int setBytes (long pos, byte[] bytes) throws SQLException
int setBytes (long pos, byte[] bytes, int offset, int len) throws SQLException
java.io.OutputStream setBinaryStream (long pos) throws SQLException
void truncate (long len) throws SQLException

変数

byte[] binaryData = null


コンストラクタとデストラクタ

org.objectweb.cjdbc.driver.Blob.Blob byte[]  data  ) 
 

Creates a new Blob instance.

引数:
data an byte array
Blob.java65 行で定義されています。

参照先 org.objectweb.cjdbc.driver.Blob.binaryData.

00066 { 00067 binaryData = data; 00068 }


メソッド

java.io.InputStream org.objectweb.cjdbc.driver.Blob.getBinaryStream  )  throws SQLException
 

Retrieves the BLOB value designated by this Blob instance as a stream.

戻り値:
a stream containing the BLOB data
例外:
SQLException if there is an error accessing the BLOB value
参照:
setBinaryStream
から:
JDK 1.2
Blob.java120 行で定義されています。

参照先 org.objectweb.cjdbc.driver.Blob.binaryData.

00121 { 00122 return new ByteArrayInputStream(binaryData); 00123 }

byte [] org.objectweb.cjdbc.driver.Blob.getBytes long  pos,
int  length
throws SQLException
 

Retrieves all or part of the BLOB value that this Blob object represents, as an array of bytes. This byte array contains up to length consecutive bytes starting at position pos.

引数:
pos the ordinal position of the first byte in the BLOB value to be extracted; the first byte is at position 1
length the number of consecutive bytes to be copied
戻り値:
a byte array containing up to length consecutive bytes from the BLOB value designated by this Blob object, starting with the byte at position pos
例外:
SQLException if there is an error accessing the BLOB value
参照:
setBytes
から:
JDK 1.2
Blob.java101 行で定義されています。

参照先 org.objectweb.cjdbc.driver.Blob.binaryData, と org.objectweb.cjdbc.driver.Blob.length().

00102 { 00103 byte[] newData = new byte[length]; 00104 00105 System.arraycopy(binaryData, (int) (pos - 1), newData, 0, length); 00106 00107 return newData; 00108 }

long org.objectweb.cjdbc.driver.Blob.length  )  throws SQLException
 

Returns the number of bytes in the BLOB value designated by this Blob object.

戻り値:
length of the BLOB in bytes
例外:
SQLException if there is an error accessing the length of the BLOB
から:
JDK 1.2
Blob.java79 行で定義されています。

参照先 org.objectweb.cjdbc.driver.Blob.binaryData.

参照元 org.objectweb.cjdbc.driver.Blob.getBytes().

00080 { 00081 return binaryData.length; 00082 }

long org.objectweb.cjdbc.driver.Blob.position java.sql.Blob  pattern,
long  start
throws SQLException
 

Retrieves the byte position in the BLOB value designated by this Blob object at which pattern begins. The search begins at position start.

引数:
pattern the Blob object designating the BLOB value for which to search
start the position in the BLOB value at which to begin searching; the first position is 1
戻り値:
the position at which the pattern begins, else -1
例外:
SQLException if there is an error accessing the BLOB value
から:
JDK 1.2
Blob.java157 行で定義されています。

参照先 org.objectweb.cjdbc.driver.Blob.position().

00158 { 00159 return position(pattern.getBytes(0, (int) pattern.length()), start); 00160 }

long org.objectweb.cjdbc.driver.Blob.position byte  pattern[],
long  start
throws SQLException
 

Retrieves the byte position at which the specified byte array pattern begins within the BLOB value that this Blob object represents. The search for pattern begins at position start.

引数:
pattern the byte array for which to search
start the position at which to begin searching; the first position is 1
戻り値:
the position at which the pattern appears, else -1
例外:
SQLException if there is an error accessing the BLOB
から:
JDK 1.2
Blob.java138 行で定義されています。

参照先 org.objectweb.cjdbc.driver.Blob.binaryData.

参照元 org.objectweb.cjdbc.driver.Blob.position().

00139 { 00140 return (new String(binaryData)).indexOf(new String(pattern), (int) start); 00141 }

java.io.OutputStream org.objectweb.cjdbc.driver.Blob.setBinaryStream long  pos  )  throws SQLException
 

Retrieves a stream that can be used to write to the BLOB value that this Blob object represents. The stream begins at position pos.

引数:
pos the position in the BLOB value at which to start writing
戻り値:
a java.io.OutputStream object to which data can be written
例外:
SQLException if there is an error accessing the BLOB value
参照:
getBinaryStream
から:
JDK 1.4
Blob.java225 行で定義されています。
00226 { 00227 throw new NotImplementedException("setBinaryStream"); 00228 }

int org.objectweb.cjdbc.driver.Blob.setBytes long  pos,
byte[]  bytes,
int  offset,
int  len
throws SQLException
 

Writes all or part of the given byte array to the BLOB value that this Blob object represents and returns the number of bytes written. Writing starts at position pos in the BLOB value; len bytes from the given byte array are written.

引数:
pos the position in the BLOB object at which to start writing
bytes the array of bytes to be written to this BLOB object
offset the offset into the array bytes at which to start reading the bytes to be set
len the number of bytes to be written to the BLOB value from the array of bytes bytes
戻り値:
the number of bytes written
例外:
SQLException if there is an error accessing the BLOB value
参照:
getBytes
から:
JDK 1.4
Blob.java205 行で定義されています。
00207 { 00208 throw new NotImplementedException("setBytes"); 00209 }

int org.objectweb.cjdbc.driver.Blob.setBytes long  pos,
byte[]  bytes
throws SQLException
 

Writes the given array of bytes to the BLOB value that this Blob object represents, starting at position pos, and returns the number of bytes written.

引数:
pos the position in the BLOB object at which to start writing
bytes the array of bytes to be written to the BLOB value that this Blob object represents
戻り値:
the number of bytes written
例外:
SQLException if there is an error accessing the BLOB value
参照:
getBytes
から:
JDK 1.4
Blob.java179 行で定義されています。
00180 { 00181 throw new NotImplementedException("setBytes"); 00182 }

void org.objectweb.cjdbc.driver.Blob.truncate long  len  )  throws SQLException
 

Truncates the BLOB value that this Blob object represents to be len bytes in length.

引数:
len the length, in bytes, to which the BLOB value that this Blob object represents should be truncated
例外:
SQLException if there is an error accessing the BLOB value
から:
JDK 1.4
Blob.java241 行で定義されています。
00242 { 00243 throw new NotImplementedException("truncate"); 00244 }


変数

byte [] org.objectweb.cjdbc.driver.Blob.binaryData = null [package]
 

The binary data that makes up this BLOB. Blob.java58 行で定義されています。

参照元 org.objectweb.cjdbc.driver.Blob.Blob(), org.objectweb.cjdbc.driver.Blob.getBinaryStream(), org.objectweb.cjdbc.driver.Blob.getBytes(), org.objectweb.cjdbc.driver.Blob.length(), と org.objectweb.cjdbc.driver.Blob.position().


このクラスの説明は次のファイルから生成されました:
CJDBCversion1.0.1に対してWed Aug 18 09:20:30 2004に生成されました。 doxygen 1.3.8