xref: /aoo41x/main/offapi/com/sun/star/sdbc/XBlob.idl (revision d1766043)
1*d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*d1766043SAndrew Rist * distributed with this work for additional information
6*d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9*d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10*d1766043SAndrew Rist *
11*d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12*d1766043SAndrew Rist *
13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*d1766043SAndrew Rist * software distributed under the License is distributed on an
15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17*d1766043SAndrew Rist * specific language governing permissions and limitations
18*d1766043SAndrew Rist * under the License.
19*d1766043SAndrew Rist *
20*d1766043SAndrew Rist *************************************************************/
21*d1766043SAndrew Rist
22*d1766043SAndrew Rist
23cdf0e10cSrcweir#ifndef __com_sun_star_sdbc_XBlob_idl__
24cdf0e10cSrcweir#define __com_sun_star_sdbc_XBlob_idl__
25cdf0e10cSrcweir
26cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__
27cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
28cdf0e10cSrcweir#endif
29cdf0e10cSrcweir
30cdf0e10cSrcweir module com {  module sun {  module star {  module io {
31cdf0e10cSrcweir published interface XInputStream;
32cdf0e10cSrcweir};};};};
33cdf0e10cSrcweir
34cdf0e10cSrcweir#ifndef __com_sun_star_sdbc_SQLException_idl__
35cdf0e10cSrcweir#include <com/sun/star/sdbc/SQLException.idl>
36cdf0e10cSrcweir#endif
37cdf0e10cSrcweir
38cdf0e10cSrcweir module com {  module sun {  module star {  module sdbc {
39cdf0e10cSrcweir
40cdf0e10cSrcweir
41cdf0e10cSrcweir/** is the representation (mapping) of an SQL
42cdf0e10cSrcweir	<i>
43cdf0e10cSrcweir	BLOB
44cdf0e10cSrcweir	</i>
45cdf0e10cSrcweir	.
46cdf0e10cSrcweir
47cdf0e10cSrcweir	<p>
48cdf0e10cSrcweir	A SQL
49cdf0e10cSrcweir	<i>
50cdf0e10cSrcweir	BLOB
51cdf0e10cSrcweir	</i>
52cdf0e10cSrcweir	is a built-in type that stores a
53cdf0e10cSrcweir	Binary Large Object as a column value in a row of a database table.
54cdf0e10cSrcweir	The driver implements
55cdf0e10cSrcweir	<i>
56cdf0e10cSrcweir	BLOB
57cdf0e10cSrcweir	</i>
58cdf0e10cSrcweir	using a
59cdf0e10cSrcweir	SQL
60cdf0e10cSrcweir	<code>locator(BLOB)</code>
61cdf0e10cSrcweir	, which means that a
62cdf0e10cSrcweir	<code>Blob</code>
63cdf0e10cSrcweir	object contains a logical pointer to the SQL
64cdf0e10cSrcweir	<i>
65cdf0e10cSrcweir	BLOB
66cdf0e10cSrcweir	</i>
67cdf0e10cSrcweir	data rather than the data itself.
68cdf0e10cSrcweir	<br/>
69cdf0e10cSrcweir	A
70cdf0e10cSrcweir	<code>Blob</code>
71cdf0e10cSrcweir	object is valid for the duration of the transaction in which is was created.
72cdf0e10cSrcweir
73cdf0e10cSrcweir	</p>
74cdf0e10cSrcweir	<p>
75cdf0e10cSrcweir	Methods in the interfaces
76cdf0e10cSrcweir	<type scope="com::sun::star::sdbc">XResultSet</type>
77cdf0e10cSrcweir	,
78cdf0e10cSrcweir	and
79cdf0e10cSrcweir	<type scope="com::sun::star::sdbc">XPreparedStatement</type>
80cdf0e10cSrcweir	, such as
81cdf0e10cSrcweir	<code>getBlob</code>
82cdf0e10cSrcweir	and
83cdf0e10cSrcweir	<code>setBlob</code>
84cdf0e10cSrcweir	allow a programmer to access the SQL
85cdf0e10cSrcweir	<i>
86cdf0e10cSrcweir	BLOB
87cdf0e10cSrcweir	</i>
88cdf0e10cSrcweir	.
89cdf0e10cSrcweir	<br/>
90cdf0e10cSrcweir	The
91cdf0e10cSrcweir	<code>Blob</code>
92cdf0e10cSrcweir	interface provides methods for getting the length of a SQL
93cdf0e10cSrcweir	<i>
94cdf0e10cSrcweir	BLOB
95cdf0e10cSrcweir	</i>
96cdf0e10cSrcweir	(Binary Large Object) value, for materializing a
97cdf0e10cSrcweir	<i>
98cdf0e10cSrcweir	BLOB
99cdf0e10cSrcweir	</i>
100cdf0e10cSrcweir	value on the client and for determining the position of a pattern of bytes within a
101cdf0e10cSrcweir	<i>
102cdf0e10cSrcweir	BLOB
103cdf0e10cSrcweir	</i>
104cdf0e10cSrcweir	value.
105cdf0e10cSrcweir	</p>
106cdf0e10cSrcweir */
107cdf0e10cSrcweirpublished interface XBlob: com::sun::star::uno::XInterface
108cdf0e10cSrcweir{
109cdf0e10cSrcweir	//-------------------------------------------------------------------------
110cdf0e10cSrcweir
111cdf0e10cSrcweir	/** returns the number of bytes in the
112cdf0e10cSrcweir		<i>
113cdf0e10cSrcweir		BLOB
114cdf0e10cSrcweir		</i>
115cdf0e10cSrcweir		value
116cdf0e10cSrcweir		designated by this
117cdf0e10cSrcweir		<code>Blob</code>
118cdf0e10cSrcweir		object.
119cdf0e10cSrcweir		@returns
120cdf0e10cSrcweir			the length
121cdf0e10cSrcweir		@throws SQLException
122cdf0e10cSrcweir			if a database access error occurs.
123cdf0e10cSrcweir	 */
124cdf0e10cSrcweir	hyper length() raises (SQLException);
125cdf0e10cSrcweir
126cdf0e10cSrcweir  	//-------------------------------------------------------------------------
127cdf0e10cSrcweir
128cdf0e10cSrcweir	/** returns as an array of bytes part or all of the
129cdf0e10cSrcweir			<i>
130cdf0e10cSrcweir			BLOB
131cdf0e10cSrcweir			</i>
132cdf0e10cSrcweir		     value that this
133cdf0e10cSrcweir			 <code>Blob</code>
134cdf0e10cSrcweir			 object designates.  The byte
135cdf0e10cSrcweir		     array contains up to
136cdf0e10cSrcweir			 <code>length</code>
137cdf0e10cSrcweir			 consecutive bytes
138cdf0e10cSrcweir		     starting at position
139cdf0e10cSrcweir			 <code>pos</code>.
140cdf0e10cSrcweir		     @param pos
141cdf0e10cSrcweir				is the ordinal position of the first byte in the
142cdf0e10cSrcweir		   	 	<i>
143cdf0e10cSrcweir				BLOB
144cdf0e10cSrcweir				</i>
145cdf0e10cSrcweir				value to be extracted; the first byte is at
146cdf0e10cSrcweir		   	 	position 1.
147cdf0e10cSrcweir		     @param length
148cdf0e10cSrcweir				is the number of consecutive bytes to be copied.
149cdf0e10cSrcweir		     @returns
150cdf0e10cSrcweir				a byte array containing up to
151cdf0e10cSrcweir				<code>length</code>
152cdf0e10cSrcweir		   	 	consecutive bytes from the
153cdf0e10cSrcweir				<i>
154cdf0e10cSrcweir				BLOB
155cdf0e10cSrcweir				</i>
156cdf0e10cSrcweir				value designated
157cdf0e10cSrcweir		     	by this
158cdf0e10cSrcweir				<code>Blob</code>
159cdf0e10cSrcweir				object, starting with the byte at position
160cdf0e10cSrcweir				<code>pos</code>
161cdf0e10cSrcweir				.
162cdf0e10cSrcweir			 @throws SQLException
163cdf0e10cSrcweir				if there is an error accessing the
164cdf0e10cSrcweir				<i>
165cdf0e10cSrcweir				BLOB
166cdf0e10cSrcweir				</i>
167cdf0e10cSrcweir				.
168cdf0e10cSrcweir	 */
169cdf0e10cSrcweir	sequence<byte> getBytes([in]hyper pos, [in]long length)
170cdf0e10cSrcweir		raises (SQLException);
171cdf0e10cSrcweir
172cdf0e10cSrcweir  	//-------------------------------------------------------------------------
173cdf0e10cSrcweir
174cdf0e10cSrcweir	/** retrieves the
175cdf0e10cSrcweir		<i>
176cdf0e10cSrcweir		BLOB
177cdf0e10cSrcweir		</i>
178cdf0e10cSrcweir		designated by this
179cdf0e10cSrcweir		<code>Blob</code>
180cdf0e10cSrcweir		instance as a stream.
181cdf0e10cSrcweir		@returns
182cdf0e10cSrcweir			the stream
183cdf0e10cSrcweir		@throws SQLException
184cdf0e10cSrcweir			if a database access error occurs.
185cdf0e10cSrcweir	 */
186cdf0e10cSrcweir	com::sun::star::io::XInputStream getBinaryStream()
187cdf0e10cSrcweir		raises (SQLException);
188cdf0e10cSrcweir  	//-------------------------------------------------------------------------
189cdf0e10cSrcweir
190cdf0e10cSrcweir	/** determines the byte position at which the specified byte
191cdf0e10cSrcweir		<code>pattern</code>
192cdf0e10cSrcweir		begins within the
193cdf0e10cSrcweir		<i>
194cdf0e10cSrcweir		BLOB
195cdf0e10cSrcweir		</i>
196cdf0e10cSrcweir		value that this
197cdf0e10cSrcweir		<code>Blob</code>
198cdf0e10cSrcweir		object represents.  The
199cdf0e10cSrcweir		search for
200cdf0e10cSrcweir		<code>pattern</code>
201cdf0e10cSrcweir		begins at position
202cdf0e10cSrcweir		<code>start</code>
203cdf0e10cSrcweir		.
204cdf0e10cSrcweir		@param pattern
205cdf0e10cSrcweir			the pattern to search
206cdf0e10cSrcweir		@returns
207cdf0e10cSrcweir			the position
208cdf0e10cSrcweir		@throws SQLException
209cdf0e10cSrcweir			if a database access error occurs.
210cdf0e10cSrcweir	 */
211cdf0e10cSrcweir	hyper position([in]sequence<byte> pattern, [in]hyper start)
212cdf0e10cSrcweir		raises (SQLException);
213cdf0e10cSrcweir
214cdf0e10cSrcweir  	//-------------------------------------------------------------------------
215cdf0e10cSrcweir
216cdf0e10cSrcweir	/** determines the byte position in the
217cdf0e10cSrcweir		<i>
218cdf0e10cSrcweir		BLOB
219cdf0e10cSrcweir		</i>
220cdf0e10cSrcweir		value
221cdf0e10cSrcweir		designated by this
222cdf0e10cSrcweir		<code>Blob</code>
223cdf0e10cSrcweir		object at which
224cdf0e10cSrcweir		<code>pattern</code>
225cdf0e10cSrcweir		begins. The search begins at position
226cdf0e10cSrcweir		<code>start</code>
227cdf0e10cSrcweir		.
228cdf0e10cSrcweir		@param pattern
229cdf0e10cSrcweir			the pattern to search
230cdf0e10cSrcweir		@param start
231cdf0e10cSrcweir			position to start
232cdf0e10cSrcweir		@returns
233cdf0e10cSrcweir			the position
234cdf0e10cSrcweir		@throws SQLException
235cdf0e10cSrcweir			if a database access error occurs.
236cdf0e10cSrcweir	 */
237cdf0e10cSrcweir	hyper positionOfBlob([in]XBlob pattern,[in] hyper start)
238cdf0e10cSrcweir	 	raises (SQLException);
239cdf0e10cSrcweir};
240cdf0e10cSrcweir
241cdf0e10cSrcweir//=============================================================================
242cdf0e10cSrcweir
243cdf0e10cSrcweir}; }; }; };
244cdf0e10cSrcweir
245cdf0e10cSrcweir/*===========================================================================
246cdf0e10cSrcweir===========================================================================*/
247cdf0e10cSrcweir#endif
248