1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23#ifndef __com_sun_star_sdbc_XSQLOutput_idl__ 24#define __com_sun_star_sdbc_XSQLOutput_idl__ 25 26#ifndef __com_sun_star_uno_XInterface_idl__ 27#include <com/sun/star/uno/XInterface.idl> 28#endif 29 30#ifndef __com_sun_star_util_Date_idl__ 31#include <com/sun/star/util/Date.idl> 32#endif 33 34#ifndef __com_sun_star_util_DateTime_idl__ 35#include <com/sun/star/util/DateTime.idl> 36#endif 37 38#ifndef __com_sun_star_util_Time_idl__ 39#include <com/sun/star/util/Time.idl> 40#endif 41 42 module com { module sun { module star { module io { 43 published interface XInputStream; 44};};};}; 45 46#ifndef __com_sun_star_sdbc_SQLException_idl__ 47#include <com/sun/star/sdbc/SQLException.idl> 48#endif 49 50 module com { module sun { module star { module sdbc { 51 52 published interface XRef; 53 published interface XArray; 54 published interface XBlob; 55 published interface XClob; 56 published interface XStruct; 57 published interface XSQLData; 58 59 60/** is used as an output stream for writing the attributes of a user-defined 61 type back to the database. This interface, used only for custom mapping, 62 is used by the driver, and its methods are never directly invoked 63 by a programmer. 64 65 66 <p> 67 When an object of a class implementing interface 68 <type scope="com::sun::star::sdbc">XSQLData</type> 69 is passed as an argument to a SQL statement, the JDBC driver calls 70 <method scope="com::sun::star::sdbc">SQLData::getSQLType</method> 71 to determine the kind of SQL datum being passed to the database. 72 <br/> 73 The driver then creates an instance of 74 <code>XSQLOutput</code> 75 and passes it to the method 76 <method scope="com::sun::star::sdbc">XSQLData::writeSQL</method> 77 . The method 78 <code>writeSQL</code> 79 in turn calls the appropriate 80 <code>XSQLOutput.writeXXX</code> 81 methods to write data from the 82 <type scope="com::sun::star::sdbc">XSQLData</type> 83 object to the 84 <code>XSQLOutput</code> 85 output stream as the representation of a SQL user-defined type.</p> 86 */ 87published interface XSQLOutput: com::sun::star::uno::XInterface 88{ 89 90 /** writes the next attribute to the stream as a string. 91 @param x 92 the value to pass to the database. 93 @throws SQLException 94 if a database access error occurs. 95 */ 96 void writeString([in]string x) raises (SQLException); 97 //------------------------------------------------------------------------- 98 99 /** writes the next attribute to the stream as boolean. 100 @param x 101 the value to pass to the database. 102 @throws SQLException 103 if a database access error occurs. 104 */ 105 void writeBoolean([in]boolean x) raises (SQLException); 106 //------------------------------------------------------------------------- 107 108 /** writes the next attribute to the stream as byte. 109 @param x 110 the value to pass to the database. 111 @throws SQLException 112 if a database access error occurs. 113 */ 114 void writeByte([in]byte x) raises (SQLException); 115 //------------------------------------------------------------------------- 116 117 /** writes the next attribute to the stream as short. 118 @param x 119 the value to pass to the database. 120 @throws SQLException 121 if a database access error occurs. 122 */ 123 void writeShort([in]short x) raises (SQLException); 124 //------------------------------------------------------------------------- 125 126 /** writes the next attribute to the stream as long. 127 @param x 128 the value to pass to the database. 129 @throws SQLException 130 if a database access error occurs. 131 */ 132 void writeInt([in]long x) raises (SQLException); 133 //------------------------------------------------------------------------- 134 135 /** writes the next attribute to the stream as hyper. 136 @param x 137 the value to pass to the database. 138 @throws SQLException 139 if a database access error occurs. 140 */ 141 void writeLong([in]hyper x) raises (SQLException); 142 //------------------------------------------------------------------------- 143 144 /** writes the next attribute to the stream as float. 145 @param x 146 the value to pass to the database. 147 @throws SQLException 148 if a database access error occurs. 149 */ 150 void writeFloat([in]float x) raises (SQLException); 151 //------------------------------------------------------------------------- 152 153 /** writes the next attribute to the stream as double. 154 @param x 155 the value to pass to the database. 156 @throws SQLException 157 if a database access error occurs. 158 */ 159 void writeDouble([in]double x) raises (SQLException); 160 //------------------------------------------------------------------------- 161 162 /** writes the next attribute to the stream as byte sequence. 163 @param x 164 the value to pass to the database. 165 @throws SQLException 166 if a database access error occurs. 167 */ 168 void writeBytes([in]sequence<byte> x) raises (SQLException); 169 //------------------------------------------------------------------------- 170 171 /** writes the next attribute to the stream as a date. 172 @param x 173 the value to pass to the database. 174 @throws SQLException 175 if a database access error occurs. 176 */ 177 void writeDate([in]com::sun::star::util::Date x) raises (SQLException); 178 //------------------------------------------------------------------------- 179 180 /** writes the next attribute to the stream as a time. 181 @param x 182 the value to pass to the database. 183 @throws SQLException 184 if a database access error occurs. 185 */ 186 void writeTime([in]com::sun::star::util::Time x) raises (SQLException); 187 //------------------------------------------------------------------------- 188 189 /** writes the next attribute to the stream as a datetime. 190 @param x 191 the value to pass to the database. 192 @throws SQLException 193 if a database access error occurs. 194 */ 195 void writeTimestamp([in]com::sun::star::util::DateTime x) 196 raises (SQLException); 197 //------------------------------------------------------------------------- 198 199 /** writes the next attribute to the stream as a stream of uninterpreted 200 bytes. 201 @param x 202 the value to pass to the database. 203 @throws SQLException 204 if a database access error occurs. 205 */ 206 void writeBinaryStream([in]com::sun::star::io::XInputStream x) 207 raises (SQLException); 208 //------------------------------------------------------------------------- 209 210 /** writes the next attribute to the stream as a stream of unicode string. 211 @param x 212 the value to pass to the database. 213 @throws SQLException 214 if a database access error occurs. 215 */ 216 void writeCharacterStream([in]com::sun::star::io::XInputStream x) 217 raises (SQLException); 218 //------------------------------------------------------------------------- 219 220 /** writes to the stream the data contained in the given 221 <code>XSQLData</code> object. 222 223 224 <p 225 >When the 226 <code>XSQLData</code> 227 object is 228 <NULL/> 229 , this method writes an SQL NULL to the stream. 230 Otherwise, it calls the 231 <member scope="com::sun::star::sdbc">XSQLData::writeSQL()</member> 232 method of the given object, which 233 writes the object's attributes to the stream. 234 The implementation of the method 235 <code>XSQLData::writeSQL()</code> 236 calls the appropriate 237 <code>XSQLOutput.writeXXX</code> 238 method(s) for writing each of the object's attributes in order. 239 <br/> 240 The attributes must be read from an 241 <type scope="com::sun::star::sdbc">XSQLInput</type> 242 input stream and written to an 243 <code>XSQLOutput</code> 244 output stream in the same order in which they were 245 listed in the SQL definition of the user-defined type. 246 </p> 247 @param x 248 the value to pass to the database. 249 @throws SQLException 250 if a database access error occurs. 251 */ 252 void writeObject([in]XSQLData x) raises (SQLException); 253 //------------------------------------------------------------------------- 254 255 /** writes a REF(&lt;structured-type&gt;) to the stream. 256 @param x 257 the value to pass to the database. 258 @throws SQLException 259 if a database access error occurs. 260 */ 261 void writeRef([in]XRef x) raises (SQLException); 262 //------------------------------------------------------------------------- 263 264 /** writes a BLOB to the stream. 265 @param x 266 the value to pass to the database. 267 @throws SQLException 268 if a database access error occurs. 269 */ 270 void writeBlob([in]XBlob x) raises (SQLException); 271 //------------------------------------------------------------------------- 272 273 /** writes a CLOB to the stream. 274 @param x 275 the value to pass to the database. 276 @throws SQLException 277 if a database access error occurs. 278 */ 279 void writeClob([in]XClob x) raises (SQLException); 280 //------------------------------------------------------------------------- 281 282 /** writes a structured-type to the stream. 283 @param x 284 the value to pass to the database. 285 @throws SQLException 286 if a database access error occurs. 287 */ 288 void writeStruct([in]XStruct x) raises (SQLException); 289 //------------------------------------------------------------------------- 290 291 /** writes an array to the stream. 292 @param x 293 the value to pass to the database. 294 @throws SQLException 295 if a database access error occurs. 296 */ 297 void writeArray([in]XArray x) raises (SQLException); 298}; 299 300//============================================================================= 301 302}; }; }; }; 303 304/*=========================================================================== 305===========================================================================*/ 306#endif 307