xref: /aoo41x/main/offapi/com/sun/star/sdbc/XBlob.idl (revision cdf0e10c)
1*cdf0e10cSrcweir/*************************************************************************
2*cdf0e10cSrcweir *
3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir *
5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir *
7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir *
9*cdf0e10cSrcweir * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir *
11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir *
15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir *
21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir *
26*cdf0e10cSrcweir ************************************************************************/
27*cdf0e10cSrcweir#ifndef __com_sun_star_sdbc_XBlob_idl__
28*cdf0e10cSrcweir#define __com_sun_star_sdbc_XBlob_idl__
29*cdf0e10cSrcweir
30*cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__
31*cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
32*cdf0e10cSrcweir#endif
33*cdf0e10cSrcweir
34*cdf0e10cSrcweir module com {  module sun {  module star {  module io {
35*cdf0e10cSrcweir published interface XInputStream;
36*cdf0e10cSrcweir};};};};
37*cdf0e10cSrcweir
38*cdf0e10cSrcweir#ifndef __com_sun_star_sdbc_SQLException_idl__
39*cdf0e10cSrcweir#include <com/sun/star/sdbc/SQLException.idl>
40*cdf0e10cSrcweir#endif
41*cdf0e10cSrcweir
42*cdf0e10cSrcweir module com {  module sun {  module star {  module sdbc {
43*cdf0e10cSrcweir
44*cdf0e10cSrcweir
45*cdf0e10cSrcweir/** is the representation (mapping) of an SQL
46*cdf0e10cSrcweir	<i>
47*cdf0e10cSrcweir	BLOB
48*cdf0e10cSrcweir	</i>
49*cdf0e10cSrcweir	.
50*cdf0e10cSrcweir
51*cdf0e10cSrcweir	<p>
52*cdf0e10cSrcweir	A SQL
53*cdf0e10cSrcweir	<i>
54*cdf0e10cSrcweir	BLOB
55*cdf0e10cSrcweir	</i>
56*cdf0e10cSrcweir	is a built-in type that stores a
57*cdf0e10cSrcweir	Binary Large Object as a column value in a row of a database table.
58*cdf0e10cSrcweir	The driver implements
59*cdf0e10cSrcweir	<i>
60*cdf0e10cSrcweir	BLOB
61*cdf0e10cSrcweir	</i>
62*cdf0e10cSrcweir	using a
63*cdf0e10cSrcweir	SQL
64*cdf0e10cSrcweir	<code>locator(BLOB)</code>
65*cdf0e10cSrcweir	, which means that a
66*cdf0e10cSrcweir	<code>Blob</code>
67*cdf0e10cSrcweir	object contains a logical pointer to the SQL
68*cdf0e10cSrcweir	<i>
69*cdf0e10cSrcweir	BLOB
70*cdf0e10cSrcweir	</i>
71*cdf0e10cSrcweir	data rather than the data itself.
72*cdf0e10cSrcweir	<br/>
73*cdf0e10cSrcweir	A
74*cdf0e10cSrcweir	<code>Blob</code>
75*cdf0e10cSrcweir	object is valid for the duration of the transaction in which is was created.
76*cdf0e10cSrcweir
77*cdf0e10cSrcweir	</p>
78*cdf0e10cSrcweir	<p>
79*cdf0e10cSrcweir	Methods in the interfaces
80*cdf0e10cSrcweir	<type scope="com::sun::star::sdbc">XResultSet</type>
81*cdf0e10cSrcweir	,
82*cdf0e10cSrcweir	and
83*cdf0e10cSrcweir	<type scope="com::sun::star::sdbc">XPreparedStatement</type>
84*cdf0e10cSrcweir	, such as
85*cdf0e10cSrcweir	<code>getBlob</code>
86*cdf0e10cSrcweir	and
87*cdf0e10cSrcweir	<code>setBlob</code>
88*cdf0e10cSrcweir	allow a programmer to access the SQL
89*cdf0e10cSrcweir	<i>
90*cdf0e10cSrcweir	BLOB
91*cdf0e10cSrcweir	</i>
92*cdf0e10cSrcweir	.
93*cdf0e10cSrcweir	<br/>
94*cdf0e10cSrcweir	The
95*cdf0e10cSrcweir	<code>Blob</code>
96*cdf0e10cSrcweir	interface provides methods for getting the length of a SQL
97*cdf0e10cSrcweir	<i>
98*cdf0e10cSrcweir	BLOB
99*cdf0e10cSrcweir	</i>
100*cdf0e10cSrcweir	(Binary Large Object) value, for materializing a
101*cdf0e10cSrcweir	<i>
102*cdf0e10cSrcweir	BLOB
103*cdf0e10cSrcweir	</i>
104*cdf0e10cSrcweir	value on the client and for determining the position of a pattern of bytes within a
105*cdf0e10cSrcweir	<i>
106*cdf0e10cSrcweir	BLOB
107*cdf0e10cSrcweir	</i>
108*cdf0e10cSrcweir	value.
109*cdf0e10cSrcweir	</p>
110*cdf0e10cSrcweir */
111*cdf0e10cSrcweirpublished interface XBlob: com::sun::star::uno::XInterface
112*cdf0e10cSrcweir{
113*cdf0e10cSrcweir	//-------------------------------------------------------------------------
114*cdf0e10cSrcweir
115*cdf0e10cSrcweir	/** returns the number of bytes in the
116*cdf0e10cSrcweir		<i>
117*cdf0e10cSrcweir		BLOB
118*cdf0e10cSrcweir		</i>
119*cdf0e10cSrcweir		value
120*cdf0e10cSrcweir		designated by this
121*cdf0e10cSrcweir		<code>Blob</code>
122*cdf0e10cSrcweir		object.
123*cdf0e10cSrcweir		@returns
124*cdf0e10cSrcweir			the length
125*cdf0e10cSrcweir		@throws SQLException
126*cdf0e10cSrcweir			if a database access error occurs.
127*cdf0e10cSrcweir	 */
128*cdf0e10cSrcweir	hyper length() raises (SQLException);
129*cdf0e10cSrcweir
130*cdf0e10cSrcweir  	//-------------------------------------------------------------------------
131*cdf0e10cSrcweir
132*cdf0e10cSrcweir	/** returns as an array of bytes part or all of the
133*cdf0e10cSrcweir			<i>
134*cdf0e10cSrcweir			BLOB
135*cdf0e10cSrcweir			</i>
136*cdf0e10cSrcweir		     value that this
137*cdf0e10cSrcweir			 <code>Blob</code>
138*cdf0e10cSrcweir			 object designates.  The byte
139*cdf0e10cSrcweir		     array contains up to
140*cdf0e10cSrcweir			 <code>length</code>
141*cdf0e10cSrcweir			 consecutive bytes
142*cdf0e10cSrcweir		     starting at position
143*cdf0e10cSrcweir			 <code>pos</code>.
144*cdf0e10cSrcweir		     @param pos
145*cdf0e10cSrcweir				is the ordinal position of the first byte in the
146*cdf0e10cSrcweir		   	 	<i>
147*cdf0e10cSrcweir				BLOB
148*cdf0e10cSrcweir				</i>
149*cdf0e10cSrcweir				value to be extracted; the first byte is at
150*cdf0e10cSrcweir		   	 	position 1.
151*cdf0e10cSrcweir		     @param length
152*cdf0e10cSrcweir				is the number of consecutive bytes to be copied.
153*cdf0e10cSrcweir		     @returns
154*cdf0e10cSrcweir				a byte array containing up to
155*cdf0e10cSrcweir				<code>length</code>
156*cdf0e10cSrcweir		   	 	consecutive bytes from the
157*cdf0e10cSrcweir				<i>
158*cdf0e10cSrcweir				BLOB
159*cdf0e10cSrcweir				</i>
160*cdf0e10cSrcweir				value designated
161*cdf0e10cSrcweir		     	by this
162*cdf0e10cSrcweir				<code>Blob</code>
163*cdf0e10cSrcweir				object, starting with the byte at position
164*cdf0e10cSrcweir				<code>pos</code>
165*cdf0e10cSrcweir				.
166*cdf0e10cSrcweir			 @throws SQLException
167*cdf0e10cSrcweir				if there is an error accessing the
168*cdf0e10cSrcweir				<i>
169*cdf0e10cSrcweir				BLOB
170*cdf0e10cSrcweir				</i>
171*cdf0e10cSrcweir				.
172*cdf0e10cSrcweir	 */
173*cdf0e10cSrcweir	sequence<byte> getBytes([in]hyper pos, [in]long length)
174*cdf0e10cSrcweir		raises (SQLException);
175*cdf0e10cSrcweir
176*cdf0e10cSrcweir  	//-------------------------------------------------------------------------
177*cdf0e10cSrcweir
178*cdf0e10cSrcweir	/** retrieves the
179*cdf0e10cSrcweir		<i>
180*cdf0e10cSrcweir		BLOB
181*cdf0e10cSrcweir		</i>
182*cdf0e10cSrcweir		designated by this
183*cdf0e10cSrcweir		<code>Blob</code>
184*cdf0e10cSrcweir		instance as a stream.
185*cdf0e10cSrcweir		@returns
186*cdf0e10cSrcweir			the stream
187*cdf0e10cSrcweir		@throws SQLException
188*cdf0e10cSrcweir			if a database access error occurs.
189*cdf0e10cSrcweir	 */
190*cdf0e10cSrcweir	com::sun::star::io::XInputStream getBinaryStream()
191*cdf0e10cSrcweir		raises (SQLException);
192*cdf0e10cSrcweir  	//-------------------------------------------------------------------------
193*cdf0e10cSrcweir
194*cdf0e10cSrcweir	/** determines the byte position at which the specified byte
195*cdf0e10cSrcweir		<code>pattern</code>
196*cdf0e10cSrcweir		begins within the
197*cdf0e10cSrcweir		<i>
198*cdf0e10cSrcweir		BLOB
199*cdf0e10cSrcweir		</i>
200*cdf0e10cSrcweir		value that this
201*cdf0e10cSrcweir		<code>Blob</code>
202*cdf0e10cSrcweir		object represents.  The
203*cdf0e10cSrcweir		search for
204*cdf0e10cSrcweir		<code>pattern</code>
205*cdf0e10cSrcweir		begins at position
206*cdf0e10cSrcweir		<code>start</code>
207*cdf0e10cSrcweir		.
208*cdf0e10cSrcweir		@param pattern
209*cdf0e10cSrcweir			the pattern to search
210*cdf0e10cSrcweir		@returns
211*cdf0e10cSrcweir			the position
212*cdf0e10cSrcweir		@throws SQLException
213*cdf0e10cSrcweir			if a database access error occurs.
214*cdf0e10cSrcweir	 */
215*cdf0e10cSrcweir	hyper position([in]sequence<byte> pattern, [in]hyper start)
216*cdf0e10cSrcweir		raises (SQLException);
217*cdf0e10cSrcweir
218*cdf0e10cSrcweir  	//-------------------------------------------------------------------------
219*cdf0e10cSrcweir
220*cdf0e10cSrcweir	/** determines the byte position in the
221*cdf0e10cSrcweir		<i>
222*cdf0e10cSrcweir		BLOB
223*cdf0e10cSrcweir		</i>
224*cdf0e10cSrcweir		value
225*cdf0e10cSrcweir		designated by this
226*cdf0e10cSrcweir		<code>Blob</code>
227*cdf0e10cSrcweir		object at which
228*cdf0e10cSrcweir		<code>pattern</code>
229*cdf0e10cSrcweir		begins. The search begins at position
230*cdf0e10cSrcweir		<code>start</code>
231*cdf0e10cSrcweir		.
232*cdf0e10cSrcweir		@param pattern
233*cdf0e10cSrcweir			the pattern to search
234*cdf0e10cSrcweir		@param start
235*cdf0e10cSrcweir			position to start
236*cdf0e10cSrcweir		@returns
237*cdf0e10cSrcweir			the position
238*cdf0e10cSrcweir		@throws SQLException
239*cdf0e10cSrcweir			if a database access error occurs.
240*cdf0e10cSrcweir	 */
241*cdf0e10cSrcweir	hyper positionOfBlob([in]XBlob pattern,[in] hyper start)
242*cdf0e10cSrcweir	 	raises (SQLException);
243*cdf0e10cSrcweir};
244*cdf0e10cSrcweir
245*cdf0e10cSrcweir//=============================================================================
246*cdf0e10cSrcweir
247*cdf0e10cSrcweir}; }; }; };
248*cdf0e10cSrcweir
249*cdf0e10cSrcweir/*===========================================================================
250*cdf0e10cSrcweir===========================================================================*/
251*cdf0e10cSrcweir#endif
252