1*b1cdbd2cSJim Jagielski/************************************************************** 2*b1cdbd2cSJim Jagielski * 3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one 4*b1cdbd2cSJim Jagielski * or more contributor license agreements. See the NOTICE file 5*b1cdbd2cSJim Jagielski * distributed with this work for additional information 6*b1cdbd2cSJim Jagielski * regarding copyright ownership. The ASF licenses this file 7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the 8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance 9*b1cdbd2cSJim Jagielski * with the License. You may obtain a copy of the License at 10*b1cdbd2cSJim Jagielski * 11*b1cdbd2cSJim Jagielski * http://www.apache.org/licenses/LICENSE-2.0 12*b1cdbd2cSJim Jagielski * 13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing, 14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an 15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*b1cdbd2cSJim Jagielski * KIND, either express or implied. See the License for the 17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations 18*b1cdbd2cSJim Jagielski * under the License. 19*b1cdbd2cSJim Jagielski * 20*b1cdbd2cSJim Jagielski *************************************************************/ 21*b1cdbd2cSJim Jagielski 22*b1cdbd2cSJim Jagielski 23*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_sdbc_XSQLInput_idl__ 24*b1cdbd2cSJim Jagielski#define __com_sun_star_sdbc_XSQLInput_idl__ 25*b1cdbd2cSJim Jagielski 26*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_uno_XInterface_idl__ 27*b1cdbd2cSJim Jagielski#include <com/sun/star/uno/XInterface.idl> 28*b1cdbd2cSJim Jagielski#endif 29*b1cdbd2cSJim Jagielski 30*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_util_Date_idl__ 31*b1cdbd2cSJim Jagielski#include <com/sun/star/util/Date.idl> 32*b1cdbd2cSJim Jagielski#endif 33*b1cdbd2cSJim Jagielski 34*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_util_DateTime_idl__ 35*b1cdbd2cSJim Jagielski#include <com/sun/star/util/DateTime.idl> 36*b1cdbd2cSJim Jagielski#endif 37*b1cdbd2cSJim Jagielski 38*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_util_Time_idl__ 39*b1cdbd2cSJim Jagielski#include <com/sun/star/util/Time.idl> 40*b1cdbd2cSJim Jagielski#endif 41*b1cdbd2cSJim Jagielski 42*b1cdbd2cSJim Jagielski module com { module sun { module star { module io { 43*b1cdbd2cSJim Jagielski published interface XInputStream; 44*b1cdbd2cSJim Jagielski};};};}; 45*b1cdbd2cSJim Jagielski 46*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_sdbc_SQLException_idl__ 47*b1cdbd2cSJim Jagielski#include <com/sun/star/sdbc/SQLException.idl> 48*b1cdbd2cSJim Jagielski#endif 49*b1cdbd2cSJim Jagielski 50*b1cdbd2cSJim Jagielski module com { module sun { module star { module sdbc { 51*b1cdbd2cSJim Jagielski 52*b1cdbd2cSJim Jagielski published interface XRef; 53*b1cdbd2cSJim Jagielski published interface XArray; 54*b1cdbd2cSJim Jagielski published interface XBlob; 55*b1cdbd2cSJim Jagielski published interface XClob; 56*b1cdbd2cSJim Jagielski 57*b1cdbd2cSJim Jagielski 58*b1cdbd2cSJim Jagielski/** represents an input stream that contains a stream of values representing an 59*b1cdbd2cSJim Jagielski instance of a SQL structured or distinct type. 60*b1cdbd2cSJim Jagielski 61*b1cdbd2cSJim Jagielski 62*b1cdbd2cSJim Jagielski <p> 63*b1cdbd2cSJim Jagielski This interface, used only for custom mapping, is used by the driver 64*b1cdbd2cSJim Jagielski behind the scenes, and a programmer never directly invokes 65*b1cdbd2cSJim Jagielski <code>SQLInput</code> 66*b1cdbd2cSJim Jagielski methods. 67*b1cdbd2cSJim Jagielski </p> 68*b1cdbd2cSJim Jagielski <p> 69*b1cdbd2cSJim Jagielski When the method 70*b1cdbd2cSJim Jagielski <code>getObject</code> 71*b1cdbd2cSJim Jagielski is called with an object of a service implementing the interface 72*b1cdbd2cSJim Jagielski <code>SQLData</code> 73*b1cdbd2cSJim Jagielski , the SDBC driver calls the method 74*b1cdbd2cSJim Jagielski <member scope="com::sun::star::sdbc">XSQLData::getSQLType()</member> 75*b1cdbd2cSJim Jagielski to determine the SQL type of the user-defined type (UDT) being custom mapped. 76*b1cdbd2cSJim Jagielski The driver creates an instance of 77*b1cdbd2cSJim Jagielski <type scope="com::sun::star::sdbc">XSQLInput</type> 78*b1cdbd2cSJim Jagielski , 79*b1cdbd2cSJim Jagielski populating it with the attributes of the UDT. The driver then passes the input 80*b1cdbd2cSJim Jagielski stream to the method 81*b1cdbd2cSJim Jagielski <member scope="com::sun::star::sdbc">XSQLData::readSQL()</member> 82*b1cdbd2cSJim Jagielski , which in turn calls the 83*b1cdbd2cSJim Jagielski <code>XSQLInput.readXXX</code> 84*b1cdbd2cSJim Jagielski methods in its implementation for reading the attributes from the input stream. 85*b1cdbd2cSJim Jagielski </p> 86*b1cdbd2cSJim Jagielski */ 87*b1cdbd2cSJim Jagielskipublished interface XSQLInput: com::sun::star::uno::XInterface 88*b1cdbd2cSJim Jagielski{ 89*b1cdbd2cSJim Jagielski 90*b1cdbd2cSJim Jagielski /** reads the next attribute in the stream as string. 91*b1cdbd2cSJim Jagielski @returns 92*b1cdbd2cSJim Jagielski the attribute; if the value is SQL NULL, return null. 93*b1cdbd2cSJim Jagielski @throws SQLException 94*b1cdbd2cSJim Jagielski if a database access error occurs. 95*b1cdbd2cSJim Jagielski */ 96*b1cdbd2cSJim Jagielski string readString() raises (SQLException); 97*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 98*b1cdbd2cSJim Jagielski 99*b1cdbd2cSJim Jagielski /** reads the next attribute in the stream as boolean. 100*b1cdbd2cSJim Jagielski @returns 101*b1cdbd2cSJim Jagielski the attribute; if the value is SQL NULL, return null. 102*b1cdbd2cSJim Jagielski @throws SQLException 103*b1cdbd2cSJim Jagielski if a database access error occurs. 104*b1cdbd2cSJim Jagielski */ 105*b1cdbd2cSJim Jagielski boolean readBoolean() raises (SQLException); 106*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 107*b1cdbd2cSJim Jagielski 108*b1cdbd2cSJim Jagielski /** reads the next attribute in the stream as byte. 109*b1cdbd2cSJim Jagielski @returns 110*b1cdbd2cSJim Jagielski the attribute; if the value is SQL NULL, return null. 111*b1cdbd2cSJim Jagielski @throws SQLException 112*b1cdbd2cSJim Jagielski if a database access error occurs. 113*b1cdbd2cSJim Jagielski */ 114*b1cdbd2cSJim Jagielski byte readByte() raises (SQLException); 115*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 116*b1cdbd2cSJim Jagielski 117*b1cdbd2cSJim Jagielski /** reads the next attribute in the stream as short. 118*b1cdbd2cSJim Jagielski @returns 119*b1cdbd2cSJim Jagielski the attribute; if the value is SQL NULL, return null. 120*b1cdbd2cSJim Jagielski @throws SQLException 121*b1cdbd2cSJim Jagielski if a database access error occurs. 122*b1cdbd2cSJim Jagielski */ 123*b1cdbd2cSJim Jagielski short readShort() raises (SQLException); 124*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 125*b1cdbd2cSJim Jagielski 126*b1cdbd2cSJim Jagielski /** reads the next attribute in the stream as long. 127*b1cdbd2cSJim Jagielski @returns 128*b1cdbd2cSJim Jagielski the attribute; if the value is SQL NULL, return null. 129*b1cdbd2cSJim Jagielski @throws SQLException 130*b1cdbd2cSJim Jagielski if a database access error occurs. 131*b1cdbd2cSJim Jagielski */ 132*b1cdbd2cSJim Jagielski long readInt() raises (SQLException); 133*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 134*b1cdbd2cSJim Jagielski 135*b1cdbd2cSJim Jagielski /** reads the next attribute in the stream as hyper. 136*b1cdbd2cSJim Jagielski @returns 137*b1cdbd2cSJim Jagielski the attribute; if the value is SQL NULL, return null. 138*b1cdbd2cSJim Jagielski @throws SQLException 139*b1cdbd2cSJim Jagielski if a database access error occurs. 140*b1cdbd2cSJim Jagielski */ 141*b1cdbd2cSJim Jagielski hyper readLong() raises (SQLException); 142*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 143*b1cdbd2cSJim Jagielski 144*b1cdbd2cSJim Jagielski /** reads the next attribute in the stream as float. 145*b1cdbd2cSJim Jagielski @returns 146*b1cdbd2cSJim Jagielski the attribute; if the value is SQL NULL, return null. 147*b1cdbd2cSJim Jagielski @throws SQLException 148*b1cdbd2cSJim Jagielski if a database access error occurs. 149*b1cdbd2cSJim Jagielski */ 150*b1cdbd2cSJim Jagielski float readFloat() raises (SQLException); 151*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 152*b1cdbd2cSJim Jagielski 153*b1cdbd2cSJim Jagielski /** reads the next attribute in the stream as double. 154*b1cdbd2cSJim Jagielski @returns 155*b1cdbd2cSJim Jagielski the attribute; if the value is SQL NULL, return null. 156*b1cdbd2cSJim Jagielski @throws SQLException 157*b1cdbd2cSJim Jagielski if a database access error occurs. 158*b1cdbd2cSJim Jagielski */ 159*b1cdbd2cSJim Jagielski double readDouble() raises (SQLException); 160*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 161*b1cdbd2cSJim Jagielski 162*b1cdbd2cSJim Jagielski /** reads the next attribute in the stream as sequence of bytes. 163*b1cdbd2cSJim Jagielski @returns 164*b1cdbd2cSJim Jagielski the attribute; if the value is SQL NULL, return null. 165*b1cdbd2cSJim Jagielski @throws SQLException 166*b1cdbd2cSJim Jagielski if a database access error occurs. 167*b1cdbd2cSJim Jagielski */ 168*b1cdbd2cSJim Jagielski sequence<byte> readBytes() raises (SQLException); 169*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 170*b1cdbd2cSJim Jagielski 171*b1cdbd2cSJim Jagielski /** reads the next attribute in the stream as date. 172*b1cdbd2cSJim Jagielski @returns 173*b1cdbd2cSJim Jagielski the attribute; if the value is SQL NULL, return null. 174*b1cdbd2cSJim Jagielski @throws SQLException 175*b1cdbd2cSJim Jagielski if a database access error occurs. 176*b1cdbd2cSJim Jagielski */ 177*b1cdbd2cSJim Jagielski com::sun::star::util::Date readDate() raises (SQLException); 178*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 179*b1cdbd2cSJim Jagielski 180*b1cdbd2cSJim Jagielski /** reads the next attribute in the stream as time. 181*b1cdbd2cSJim Jagielski @returns 182*b1cdbd2cSJim Jagielski the attribute; if the value is SQL NULL, return null. 183*b1cdbd2cSJim Jagielski @throws SQLException 184*b1cdbd2cSJim Jagielski if a database access error occurs. 185*b1cdbd2cSJim Jagielski */ 186*b1cdbd2cSJim Jagielski com::sun::star::util::Time readTime() raises (SQLException); 187*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 188*b1cdbd2cSJim Jagielski 189*b1cdbd2cSJim Jagielski /** reads the next attribute in the stream as datetime. 190*b1cdbd2cSJim Jagielski @returns 191*b1cdbd2cSJim Jagielski the attribute; if the value is SQL NULL, return null. 192*b1cdbd2cSJim Jagielski @throws SQLException 193*b1cdbd2cSJim Jagielski if a database access error occurs. 194*b1cdbd2cSJim Jagielski */ 195*b1cdbd2cSJim Jagielski com::sun::star::util::DateTime readTimestamp() raises (SQLException); 196*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 197*b1cdbd2cSJim Jagielski 198*b1cdbd2cSJim Jagielski /** reads the next attribute in the stream as sequence of bytes. 199*b1cdbd2cSJim Jagielski @returns 200*b1cdbd2cSJim Jagielski the attribute; if the value is SQL NULL, return null. 201*b1cdbd2cSJim Jagielski @throws SQLException 202*b1cdbd2cSJim Jagielski if a database access error occurs. 203*b1cdbd2cSJim Jagielski */ 204*b1cdbd2cSJim Jagielski com::sun::star::io::XInputStream readBinaryStream() raises (SQLException); 205*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 206*b1cdbd2cSJim Jagielski 207*b1cdbd2cSJim Jagielski /** reads the next attribute in the stream as a unicode string. 208*b1cdbd2cSJim Jagielski @returns 209*b1cdbd2cSJim Jagielski the attribute; if the value is SQL NULL, return null. 210*b1cdbd2cSJim Jagielski @throws SQLException 211*b1cdbd2cSJim Jagielski if a database access error occurs. 212*b1cdbd2cSJim Jagielski */ 213*b1cdbd2cSJim Jagielski com::sun::star::io::XInputStream readCharacterStream() raises (SQLException); 214*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 215*b1cdbd2cSJim Jagielski 216*b1cdbd2cSJim Jagielski /** returns the datum at the head of the stream as an any. 217*b1cdbd2cSJim Jagielski 218*b1cdbd2cSJim Jagielski 219*b1cdbd2cSJim Jagielski <p> 220*b1cdbd2cSJim Jagielski The actual type of the any returned is determined by the default 221*b1cdbd2cSJim Jagielski type mapping, and any customizations present in this stream's type map. 222*b1cdbd2cSJim Jagielski 223*b1cdbd2cSJim Jagielski <br/> 224*b1cdbd2cSJim Jagielski A type map is registered with the stream by the SDBC driver before the 225*b1cdbd2cSJim Jagielski stream is passed to the application. 226*b1cdbd2cSJim Jagielski 227*b1cdbd2cSJim Jagielski <br/> 228*b1cdbd2cSJim Jagielski When the datum at the head of the stream is a SQL NULL, 229*b1cdbd2cSJim Jagielski the method returns <void/>. If the datum is a SQL structured or distinct 230*b1cdbd2cSJim Jagielski type, it determines the SQL type of the datum at the head of the stream, 231*b1cdbd2cSJim Jagielski constructs an object of the appropriate service, and calls the method 232*b1cdbd2cSJim Jagielski <member scope="com::sun::star::sdbc">XSQLData::readSQL()</member> 233*b1cdbd2cSJim Jagielski on that object, which reads additional data 234*b1cdbd2cSJim Jagielski from the stream using the protocol described for that method. 235*b1cdbd2cSJim Jagielski 236*b1cdbd2cSJim Jagielski </p> 237*b1cdbd2cSJim Jagielski @returns 238*b1cdbd2cSJim Jagielski the attribute; if the value is SQL NULL, return null. 239*b1cdbd2cSJim Jagielski @throws SQLException 240*b1cdbd2cSJim Jagielski if a database access error occurs. 241*b1cdbd2cSJim Jagielski */ 242*b1cdbd2cSJim Jagielski any readObject() raises (SQLException); 243*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 244*b1cdbd2cSJim Jagielski 245*b1cdbd2cSJim Jagielski /** reads a REF(&lt;structured-type&gt;) from the stream. 246*b1cdbd2cSJim Jagielski @returns 247*b1cdbd2cSJim Jagielski the attribute; if the value is SQL NULL, return null. 248*b1cdbd2cSJim Jagielski @throws SQLException 249*b1cdbd2cSJim Jagielski if a database access error occurs. 250*b1cdbd2cSJim Jagielski */ 251*b1cdbd2cSJim Jagielski XRef readRef() raises (SQLException); 252*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 253*b1cdbd2cSJim Jagielski 254*b1cdbd2cSJim Jagielski /** reads a BLOB from the stream. 255*b1cdbd2cSJim Jagielski @returns 256*b1cdbd2cSJim Jagielski the attribute; if the value is SQL NULL, return null. 257*b1cdbd2cSJim Jagielski @throws SQLException 258*b1cdbd2cSJim Jagielski if a database access error occurs. 259*b1cdbd2cSJim Jagielski */ 260*b1cdbd2cSJim Jagielski XBlob readBlob() raises (SQLException); 261*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 262*b1cdbd2cSJim Jagielski 263*b1cdbd2cSJim Jagielski /** reads a CLOB from the stream. 264*b1cdbd2cSJim Jagielski @returns 265*b1cdbd2cSJim Jagielski the attribute; if the value is SQL NULL, return null. 266*b1cdbd2cSJim Jagielski @throws SQLException 267*b1cdbd2cSJim Jagielski if a database access error occurs. 268*b1cdbd2cSJim Jagielski */ 269*b1cdbd2cSJim Jagielski XClob readClob() raises (SQLException); 270*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 271*b1cdbd2cSJim Jagielski 272*b1cdbd2cSJim Jagielski /** reads an array from the stream. 273*b1cdbd2cSJim Jagielski @returns 274*b1cdbd2cSJim Jagielski the attribute; if the value is SQL NULL, return null. 275*b1cdbd2cSJim Jagielski @throws SQLException 276*b1cdbd2cSJim Jagielski if a database access error occurs. 277*b1cdbd2cSJim Jagielski */ 278*b1cdbd2cSJim Jagielski XArray readArray() raises (SQLException); 279*b1cdbd2cSJim Jagielski //------------------------------------------------------------------------- 280*b1cdbd2cSJim Jagielski 281*b1cdbd2cSJim Jagielski /** determines whether the last value read was null. 282*b1cdbd2cSJim Jagielski @returns 283*b1cdbd2cSJim Jagielski <TRUE/> if the most recently gotten SQL value was null; otherwise, <FALSE/> 284*b1cdbd2cSJim Jagielski @throws SQLException 285*b1cdbd2cSJim Jagielski if a database access error occurs. 286*b1cdbd2cSJim Jagielski */ 287*b1cdbd2cSJim Jagielski boolean wasNull() raises (SQLException); 288*b1cdbd2cSJim Jagielski}; 289*b1cdbd2cSJim Jagielski 290*b1cdbd2cSJim Jagielski//============================================================================= 291*b1cdbd2cSJim Jagielski 292*b1cdbd2cSJim Jagielski}; }; }; }; 293*b1cdbd2cSJim Jagielski 294*b1cdbd2cSJim Jagielski/*=========================================================================== 295*b1cdbd2cSJim Jagielski===========================================================================*/ 296*b1cdbd2cSJim Jagielski#endif 297