KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > rmijdbc > RJBlobInterface


1
2 /**
3  * RmiJdbc client/server JDBC Driver
4  * (C) ExperLog 1999-2000
5  *
6  * @version 1.0
7  * @author Pierre-Yves Gibello (pierreyves.gibello@experlog.com)
8  */

9
10 package org.objectweb.rmijdbc;
11
12 import java.sql.*;
13 import java.rmi.RemoteException JavaDoc;
14
15 /**
16  * The representation (mapping) in the JavaTM programming language of an
17  * SQL BLOB. An SQL BLOB is
18  * a built-in type that stores a Binary Large Object as a column value in
19  * a row of a database table. The
20  * driver implements Blob using an SQL locator(BLOB), which means that
21  * a Blob object contains a logical pointer to the SQL BLOB data rather
22  * than the data itself. A Blob object is valid for
23  * the duration of the transaction in which is was created.
24  *
25  * Methods in the interfaces ResultSet, CallableStatement, and
26  * PreparedStatement, such as getBlob and setBlob allow a programmer
27  * to access the SQL BLOB. The Blob interface provides methods for getting
28  * the length of an SQL BLOB (Binary Large Object) value, for
29  * materializing a BLOB value on the client, and for determining the position
30  * of a pattern of bytes within a BLOB value.
31  */

32
33 public interface RJBlobInterface extends java.rmi.Remote JavaDoc {
34
35   long length() throws RemoteException JavaDoc, SQLException;
36
37   byte[] getBytes(long pos, int length) throws RemoteException JavaDoc, SQLException;
38
39 // TBD There's a hack there (InputStream not serializable)
40
byte[] getBinaryStream() throws RemoteException JavaDoc, SQLException;
41
42   long position(byte[] pattern, long start)
43   throws RemoteException JavaDoc, SQLException;
44
45   long position(Blob pattern, long start)
46   throws RemoteException JavaDoc, SQLException;
47
48 // -------------------------- JDBC 3.0 -----------------------------------
49

50     int setBytes(long pos, byte[] bytes) throws RemoteException JavaDoc, SQLException;
51  
52     int setBytes(long pos, byte[] bytes, int offset, int len) throws RemoteException JavaDoc, SQLException;
53  
54     java.io.OutputStream JavaDoc setBinaryStream(long pos) throws RemoteException JavaDoc, SQLException;
55  
56     void truncate(long len) throws RemoteException JavaDoc, SQLException;
57
58 };
59
60
Popular Tags