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