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 28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 29*cdf0e10cSrcweir #include "precompiled_ucb.hxx" 30*cdf0e10cSrcweir #include "filrow.hxx" 31*cdf0e10cSrcweir #include "shell.hxx" 32*cdf0e10cSrcweir #include "prov.hxx" 33*cdf0e10cSrcweir 34*cdf0e10cSrcweir using namespace fileaccess; 35*cdf0e10cSrcweir using namespace com::sun::star; 36*cdf0e10cSrcweir using namespace com::sun::star::uno; 37*cdf0e10cSrcweir //using namespace com::sun::star::ucb; 38*cdf0e10cSrcweir 39*cdf0e10cSrcweir 40*cdf0e10cSrcweir // Funktion for TypeConverting 41*cdf0e10cSrcweir 42*cdf0e10cSrcweir 43*cdf0e10cSrcweir template< class _type_ > 44*cdf0e10cSrcweir sal_Bool convert( shell* pShell, 45*cdf0e10cSrcweir uno::Reference< script::XTypeConverter >& xConverter, 46*cdf0e10cSrcweir uno::Any& rValue, 47*cdf0e10cSrcweir _type_& aReturn ) 48*cdf0e10cSrcweir { 49*cdf0e10cSrcweir // Try first without converting 50*cdf0e10cSrcweir sal_Bool no_success = ! ( rValue >>= aReturn ); 51*cdf0e10cSrcweir 52*cdf0e10cSrcweir if ( no_success ) 53*cdf0e10cSrcweir { 54*cdf0e10cSrcweir if( ! xConverter.is() ) 55*cdf0e10cSrcweir { 56*cdf0e10cSrcweir xConverter = uno::Reference< script::XTypeConverter >( 57*cdf0e10cSrcweir pShell->m_xMultiServiceFactory->createInstance( 58*cdf0e10cSrcweir rtl::OUString::createFromAscii( "com.sun.star.script.Converter" ) ),uno::UNO_QUERY ); 59*cdf0e10cSrcweir 60*cdf0e10cSrcweir /* DBG_ASSERT( m_xTypeConverter.is(), 61*cdf0e10cSrcweir "PropertyValueSet::getTypeConverter() - " 62*cdf0e10cSrcweir "Service 'com.sun.star.script.Converter' n/a!" );*/ 63*cdf0e10cSrcweir } 64*cdf0e10cSrcweir 65*cdf0e10cSrcweir try 66*cdf0e10cSrcweir { 67*cdf0e10cSrcweir if( rValue.hasValue() ) 68*cdf0e10cSrcweir { 69*cdf0e10cSrcweir uno::Any aConvertedValue 70*cdf0e10cSrcweir = xConverter->convertTo( rValue,getCppuType( static_cast< const _type_* >(0) ) ); 71*cdf0e10cSrcweir no_success = ! ( aConvertedValue >>= aReturn ); 72*cdf0e10cSrcweir } 73*cdf0e10cSrcweir else 74*cdf0e10cSrcweir no_success = sal_True; 75*cdf0e10cSrcweir } 76*cdf0e10cSrcweir catch ( lang::IllegalArgumentException ) 77*cdf0e10cSrcweir { 78*cdf0e10cSrcweir no_success = sal_True; 79*cdf0e10cSrcweir } 80*cdf0e10cSrcweir catch ( script::CannotConvertException ) 81*cdf0e10cSrcweir { 82*cdf0e10cSrcweir no_success = sal_True; 83*cdf0e10cSrcweir } 84*cdf0e10cSrcweir } 85*cdf0e10cSrcweir return no_success; 86*cdf0e10cSrcweir } 87*cdf0e10cSrcweir 88*cdf0e10cSrcweir 89*cdf0e10cSrcweir XRow_impl::XRow_impl( shell* pMyShell,const uno::Sequence< uno::Any >& seq ) 90*cdf0e10cSrcweir : m_aValueMap( seq ), 91*cdf0e10cSrcweir m_pMyShell( pMyShell ), 92*cdf0e10cSrcweir m_xProvider( pMyShell->m_pProvider ), 93*cdf0e10cSrcweir m_xTypeConverter( 0 ) 94*cdf0e10cSrcweir { 95*cdf0e10cSrcweir } 96*cdf0e10cSrcweir 97*cdf0e10cSrcweir XRow_impl::~XRow_impl() 98*cdf0e10cSrcweir { 99*cdf0e10cSrcweir } 100*cdf0e10cSrcweir 101*cdf0e10cSrcweir 102*cdf0e10cSrcweir void SAL_CALL 103*cdf0e10cSrcweir XRow_impl::acquire( 104*cdf0e10cSrcweir void ) 105*cdf0e10cSrcweir throw() 106*cdf0e10cSrcweir { 107*cdf0e10cSrcweir OWeakObject::acquire(); 108*cdf0e10cSrcweir } 109*cdf0e10cSrcweir 110*cdf0e10cSrcweir void SAL_CALL 111*cdf0e10cSrcweir XRow_impl::release( 112*cdf0e10cSrcweir void ) 113*cdf0e10cSrcweir throw() 114*cdf0e10cSrcweir { 115*cdf0e10cSrcweir OWeakObject::release(); 116*cdf0e10cSrcweir } 117*cdf0e10cSrcweir 118*cdf0e10cSrcweir 119*cdf0e10cSrcweir uno::Any SAL_CALL 120*cdf0e10cSrcweir XRow_impl::queryInterface( 121*cdf0e10cSrcweir const uno::Type& rType ) 122*cdf0e10cSrcweir throw( uno::RuntimeException ) 123*cdf0e10cSrcweir { 124*cdf0e10cSrcweir uno::Any aRet = cppu::queryInterface( rType, 125*cdf0e10cSrcweir SAL_STATIC_CAST( lang::XTypeProvider*,this), 126*cdf0e10cSrcweir SAL_STATIC_CAST( sdbc::XRow*,this) ); 127*cdf0e10cSrcweir return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ); 128*cdf0e10cSrcweir } 129*cdf0e10cSrcweir 130*cdf0e10cSrcweir 131*cdf0e10cSrcweir XTYPEPROVIDER_IMPL_2( XRow_impl, 132*cdf0e10cSrcweir lang::XTypeProvider, 133*cdf0e10cSrcweir sdbc::XRow ) 134*cdf0e10cSrcweir 135*cdf0e10cSrcweir 136*cdf0e10cSrcweir sal_Bool SAL_CALL 137*cdf0e10cSrcweir XRow_impl::wasNull( 138*cdf0e10cSrcweir void ) 139*cdf0e10cSrcweir throw( sdbc::SQLException, 140*cdf0e10cSrcweir uno::RuntimeException) 141*cdf0e10cSrcweir { 142*cdf0e10cSrcweir return m_nWasNull; 143*cdf0e10cSrcweir } 144*cdf0e10cSrcweir 145*cdf0e10cSrcweir 146*cdf0e10cSrcweir rtl::OUString SAL_CALL 147*cdf0e10cSrcweir XRow_impl::getString( 148*cdf0e10cSrcweir sal_Int32 columnIndex ) 149*cdf0e10cSrcweir throw( sdbc::SQLException, 150*cdf0e10cSrcweir uno::RuntimeException) 151*cdf0e10cSrcweir { 152*cdf0e10cSrcweir if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) 153*cdf0e10cSrcweir throw sdbc::SQLException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), ::rtl::OUString(), 0, uno::Any() ); 154*cdf0e10cSrcweir rtl::OUString Value; 155*cdf0e10cSrcweir osl::MutexGuard aGuard( m_aMutex ); 156*cdf0e10cSrcweir m_nWasNull = ::convert<rtl::OUString>( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value ); 157*cdf0e10cSrcweir return Value; 158*cdf0e10cSrcweir } 159*cdf0e10cSrcweir 160*cdf0e10cSrcweir sal_Bool SAL_CALL 161*cdf0e10cSrcweir XRow_impl::getBoolean( 162*cdf0e10cSrcweir sal_Int32 columnIndex ) 163*cdf0e10cSrcweir throw( sdbc::SQLException, 164*cdf0e10cSrcweir uno::RuntimeException) 165*cdf0e10cSrcweir { 166*cdf0e10cSrcweir if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) 167*cdf0e10cSrcweir throw sdbc::SQLException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), ::rtl::OUString(), 0, uno::Any() ); 168*cdf0e10cSrcweir sal_Bool Value( false ); 169*cdf0e10cSrcweir osl::MutexGuard aGuard( m_aMutex ); 170*cdf0e10cSrcweir m_nWasNull = ::convert<sal_Bool>( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value ); 171*cdf0e10cSrcweir return Value; 172*cdf0e10cSrcweir } 173*cdf0e10cSrcweir 174*cdf0e10cSrcweir 175*cdf0e10cSrcweir sal_Int8 SAL_CALL 176*cdf0e10cSrcweir XRow_impl::getByte( 177*cdf0e10cSrcweir sal_Int32 columnIndex ) 178*cdf0e10cSrcweir throw( sdbc::SQLException, 179*cdf0e10cSrcweir uno::RuntimeException) 180*cdf0e10cSrcweir { 181*cdf0e10cSrcweir if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) 182*cdf0e10cSrcweir throw sdbc::SQLException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), ::rtl::OUString(), 0, uno::Any() ); 183*cdf0e10cSrcweir sal_Int8 Value( 0 ); 184*cdf0e10cSrcweir osl::MutexGuard aGuard( m_aMutex ); 185*cdf0e10cSrcweir m_nWasNull = ::convert<sal_Int8>( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value ); 186*cdf0e10cSrcweir return Value; 187*cdf0e10cSrcweir } 188*cdf0e10cSrcweir 189*cdf0e10cSrcweir sal_Int16 SAL_CALL 190*cdf0e10cSrcweir XRow_impl::getShort( 191*cdf0e10cSrcweir sal_Int32 columnIndex ) 192*cdf0e10cSrcweir throw( sdbc::SQLException, 193*cdf0e10cSrcweir uno::RuntimeException) 194*cdf0e10cSrcweir { 195*cdf0e10cSrcweir if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) 196*cdf0e10cSrcweir throw sdbc::SQLException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), ::rtl::OUString(), 0, uno::Any() ); 197*cdf0e10cSrcweir sal_Int16 Value( 0 ); 198*cdf0e10cSrcweir osl::MutexGuard aGuard( m_aMutex ); 199*cdf0e10cSrcweir m_nWasNull = ::convert<sal_Int16>( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value ); 200*cdf0e10cSrcweir return Value; 201*cdf0e10cSrcweir } 202*cdf0e10cSrcweir 203*cdf0e10cSrcweir 204*cdf0e10cSrcweir sal_Int32 SAL_CALL 205*cdf0e10cSrcweir XRow_impl::getInt( 206*cdf0e10cSrcweir sal_Int32 columnIndex ) 207*cdf0e10cSrcweir throw( sdbc::SQLException, 208*cdf0e10cSrcweir uno::RuntimeException) 209*cdf0e10cSrcweir { 210*cdf0e10cSrcweir if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) 211*cdf0e10cSrcweir throw sdbc::SQLException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), ::rtl::OUString(), 0, uno::Any() ); 212*cdf0e10cSrcweir sal_Int32 Value( 0 ); 213*cdf0e10cSrcweir osl::MutexGuard aGuard( m_aMutex ); 214*cdf0e10cSrcweir m_nWasNull = ::convert<sal_Int32>( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value ); 215*cdf0e10cSrcweir return Value; 216*cdf0e10cSrcweir } 217*cdf0e10cSrcweir 218*cdf0e10cSrcweir sal_Int64 SAL_CALL 219*cdf0e10cSrcweir XRow_impl::getLong( 220*cdf0e10cSrcweir sal_Int32 columnIndex ) 221*cdf0e10cSrcweir throw( sdbc::SQLException, 222*cdf0e10cSrcweir uno::RuntimeException) 223*cdf0e10cSrcweir { 224*cdf0e10cSrcweir if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) 225*cdf0e10cSrcweir throw sdbc::SQLException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), ::rtl::OUString(), 0, uno::Any() ); 226*cdf0e10cSrcweir sal_Int64 Value( 0 ); 227*cdf0e10cSrcweir osl::MutexGuard aGuard( m_aMutex ); 228*cdf0e10cSrcweir m_nWasNull = ::convert<sal_Int64>( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value ); 229*cdf0e10cSrcweir return Value; 230*cdf0e10cSrcweir } 231*cdf0e10cSrcweir 232*cdf0e10cSrcweir float SAL_CALL 233*cdf0e10cSrcweir XRow_impl::getFloat( 234*cdf0e10cSrcweir sal_Int32 columnIndex ) 235*cdf0e10cSrcweir throw( sdbc::SQLException, 236*cdf0e10cSrcweir uno::RuntimeException) 237*cdf0e10cSrcweir { 238*cdf0e10cSrcweir if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) 239*cdf0e10cSrcweir throw sdbc::SQLException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), ::rtl::OUString(), 0, uno::Any() ); 240*cdf0e10cSrcweir float Value( 0 ); 241*cdf0e10cSrcweir osl::MutexGuard aGuard( m_aMutex ); 242*cdf0e10cSrcweir m_nWasNull = ::convert<float>( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value ); 243*cdf0e10cSrcweir return Value; 244*cdf0e10cSrcweir } 245*cdf0e10cSrcweir 246*cdf0e10cSrcweir double SAL_CALL 247*cdf0e10cSrcweir XRow_impl::getDouble( 248*cdf0e10cSrcweir sal_Int32 columnIndex ) 249*cdf0e10cSrcweir throw( sdbc::SQLException, 250*cdf0e10cSrcweir uno::RuntimeException) 251*cdf0e10cSrcweir { 252*cdf0e10cSrcweir if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) 253*cdf0e10cSrcweir throw sdbc::SQLException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), ::rtl::OUString(), 0, uno::Any() ); 254*cdf0e10cSrcweir double Value( 0 ); 255*cdf0e10cSrcweir osl::MutexGuard aGuard( m_aMutex ); 256*cdf0e10cSrcweir m_nWasNull = ::convert<double>( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value ); 257*cdf0e10cSrcweir return Value; 258*cdf0e10cSrcweir } 259*cdf0e10cSrcweir 260*cdf0e10cSrcweir uno::Sequence< sal_Int8 > SAL_CALL 261*cdf0e10cSrcweir XRow_impl::getBytes( 262*cdf0e10cSrcweir sal_Int32 columnIndex ) 263*cdf0e10cSrcweir throw( sdbc::SQLException, 264*cdf0e10cSrcweir uno::RuntimeException) 265*cdf0e10cSrcweir { 266*cdf0e10cSrcweir if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) 267*cdf0e10cSrcweir throw sdbc::SQLException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), ::rtl::OUString(), 0, uno::Any() ); 268*cdf0e10cSrcweir uno::Sequence< sal_Int8 > Value(0); 269*cdf0e10cSrcweir osl::MutexGuard aGuard( m_aMutex ); 270*cdf0e10cSrcweir m_nWasNull = ::convert<uno::Sequence< sal_Int8 > >( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value ); 271*cdf0e10cSrcweir return Value; 272*cdf0e10cSrcweir } 273*cdf0e10cSrcweir 274*cdf0e10cSrcweir util::Date SAL_CALL 275*cdf0e10cSrcweir XRow_impl::getDate( 276*cdf0e10cSrcweir sal_Int32 columnIndex ) 277*cdf0e10cSrcweir throw( sdbc::SQLException, 278*cdf0e10cSrcweir uno::RuntimeException) 279*cdf0e10cSrcweir { 280*cdf0e10cSrcweir if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) 281*cdf0e10cSrcweir throw sdbc::SQLException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), ::rtl::OUString(), 0, uno::Any() ); 282*cdf0e10cSrcweir util::Date Value; 283*cdf0e10cSrcweir osl::MutexGuard aGuard( m_aMutex ); 284*cdf0e10cSrcweir m_nWasNull = ::convert<util::Date>( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value ); 285*cdf0e10cSrcweir return Value; 286*cdf0e10cSrcweir } 287*cdf0e10cSrcweir 288*cdf0e10cSrcweir util::Time SAL_CALL 289*cdf0e10cSrcweir XRow_impl::getTime( 290*cdf0e10cSrcweir sal_Int32 columnIndex ) 291*cdf0e10cSrcweir throw( sdbc::SQLException, 292*cdf0e10cSrcweir uno::RuntimeException) 293*cdf0e10cSrcweir { 294*cdf0e10cSrcweir if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) 295*cdf0e10cSrcweir throw sdbc::SQLException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), ::rtl::OUString(), 0, uno::Any() ); 296*cdf0e10cSrcweir util::Time Value; 297*cdf0e10cSrcweir osl::MutexGuard aGuard( m_aMutex ); 298*cdf0e10cSrcweir m_nWasNull = ::convert<util::Time>( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value ); 299*cdf0e10cSrcweir return Value; 300*cdf0e10cSrcweir } 301*cdf0e10cSrcweir 302*cdf0e10cSrcweir util::DateTime SAL_CALL 303*cdf0e10cSrcweir XRow_impl::getTimestamp( 304*cdf0e10cSrcweir sal_Int32 columnIndex ) 305*cdf0e10cSrcweir throw( sdbc::SQLException, 306*cdf0e10cSrcweir uno::RuntimeException) 307*cdf0e10cSrcweir { 308*cdf0e10cSrcweir if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) 309*cdf0e10cSrcweir throw sdbc::SQLException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), ::rtl::OUString(), 0, uno::Any() ); 310*cdf0e10cSrcweir util::DateTime Value; 311*cdf0e10cSrcweir osl::MutexGuard aGuard( m_aMutex ); 312*cdf0e10cSrcweir m_nWasNull = ::convert<util::DateTime>( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value ); 313*cdf0e10cSrcweir return Value; 314*cdf0e10cSrcweir } 315*cdf0e10cSrcweir 316*cdf0e10cSrcweir 317*cdf0e10cSrcweir uno::Reference< io::XInputStream > SAL_CALL 318*cdf0e10cSrcweir XRow_impl::getBinaryStream( 319*cdf0e10cSrcweir sal_Int32 columnIndex ) 320*cdf0e10cSrcweir throw( sdbc::SQLException, 321*cdf0e10cSrcweir uno::RuntimeException) 322*cdf0e10cSrcweir { 323*cdf0e10cSrcweir if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) 324*cdf0e10cSrcweir throw sdbc::SQLException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), ::rtl::OUString(), 0, uno::Any() ); 325*cdf0e10cSrcweir uno::Reference< io::XInputStream > Value; 326*cdf0e10cSrcweir osl::MutexGuard aGuard( m_aMutex ); 327*cdf0e10cSrcweir m_nWasNull = ::convert<uno::Reference< io::XInputStream > >( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value ); 328*cdf0e10cSrcweir return Value; 329*cdf0e10cSrcweir } 330*cdf0e10cSrcweir 331*cdf0e10cSrcweir 332*cdf0e10cSrcweir uno::Reference< io::XInputStream > SAL_CALL 333*cdf0e10cSrcweir XRow_impl::getCharacterStream( 334*cdf0e10cSrcweir sal_Int32 columnIndex ) 335*cdf0e10cSrcweir throw( sdbc::SQLException, 336*cdf0e10cSrcweir uno::RuntimeException) 337*cdf0e10cSrcweir { 338*cdf0e10cSrcweir if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) 339*cdf0e10cSrcweir throw sdbc::SQLException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), ::rtl::OUString(), 0, uno::Any() ); 340*cdf0e10cSrcweir uno::Reference< io::XInputStream > Value; 341*cdf0e10cSrcweir osl::MutexGuard aGuard( m_aMutex ); 342*cdf0e10cSrcweir m_nWasNull = ::convert< uno::Reference< io::XInputStream> >( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value ); 343*cdf0e10cSrcweir return Value; 344*cdf0e10cSrcweir } 345*cdf0e10cSrcweir 346*cdf0e10cSrcweir 347*cdf0e10cSrcweir uno::Any SAL_CALL 348*cdf0e10cSrcweir XRow_impl::getObject( 349*cdf0e10cSrcweir sal_Int32 columnIndex, 350*cdf0e10cSrcweir const uno::Reference< container::XNameAccess >& ) 351*cdf0e10cSrcweir throw( sdbc::SQLException, 352*cdf0e10cSrcweir uno::RuntimeException) 353*cdf0e10cSrcweir { 354*cdf0e10cSrcweir if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) 355*cdf0e10cSrcweir throw sdbc::SQLException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), ::rtl::OUString(), 0, uno::Any() ); 356*cdf0e10cSrcweir uno::Any Value; 357*cdf0e10cSrcweir osl::MutexGuard aGuard( m_aMutex ); 358*cdf0e10cSrcweir m_nWasNull = ::convert<uno::Any>( m_pMyShell,m_xTypeConverter,m_aValueMap[ --columnIndex ],Value ); 359*cdf0e10cSrcweir return Value; 360*cdf0e10cSrcweir } 361*cdf0e10cSrcweir 362*cdf0e10cSrcweir uno::Reference< sdbc::XRef > SAL_CALL 363*cdf0e10cSrcweir XRow_impl::getRef( 364*cdf0e10cSrcweir sal_Int32 columnIndex ) 365*cdf0e10cSrcweir throw( sdbc::SQLException, 366*cdf0e10cSrcweir uno::RuntimeException) 367*cdf0e10cSrcweir { 368*cdf0e10cSrcweir if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) 369*cdf0e10cSrcweir throw sdbc::SQLException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), ::rtl::OUString(), 0, uno::Any() ); 370*cdf0e10cSrcweir uno::Reference< sdbc::XRef > Value; 371*cdf0e10cSrcweir osl::MutexGuard aGuard( m_aMutex ); 372*cdf0e10cSrcweir m_nWasNull = ::convert<uno::Reference< sdbc::XRef> >( m_pMyShell, 373*cdf0e10cSrcweir m_xTypeConverter, 374*cdf0e10cSrcweir m_aValueMap[ --columnIndex ], 375*cdf0e10cSrcweir Value ); 376*cdf0e10cSrcweir return Value; 377*cdf0e10cSrcweir } 378*cdf0e10cSrcweir 379*cdf0e10cSrcweir uno::Reference< sdbc::XBlob > SAL_CALL 380*cdf0e10cSrcweir XRow_impl::getBlob( 381*cdf0e10cSrcweir sal_Int32 columnIndex ) 382*cdf0e10cSrcweir throw( sdbc::SQLException, 383*cdf0e10cSrcweir uno::RuntimeException) 384*cdf0e10cSrcweir { 385*cdf0e10cSrcweir if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) 386*cdf0e10cSrcweir throw sdbc::SQLException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), ::rtl::OUString(), 0, uno::Any() ); 387*cdf0e10cSrcweir uno::Reference< sdbc::XBlob > Value; 388*cdf0e10cSrcweir osl::MutexGuard aGuard( m_aMutex ); 389*cdf0e10cSrcweir m_nWasNull = ::convert<uno::Reference< sdbc::XBlob> >( m_pMyShell, 390*cdf0e10cSrcweir m_xTypeConverter, 391*cdf0e10cSrcweir m_aValueMap[ --columnIndex ], 392*cdf0e10cSrcweir Value ); 393*cdf0e10cSrcweir return Value; 394*cdf0e10cSrcweir } 395*cdf0e10cSrcweir 396*cdf0e10cSrcweir uno::Reference< sdbc::XClob > SAL_CALL 397*cdf0e10cSrcweir XRow_impl::getClob( 398*cdf0e10cSrcweir sal_Int32 columnIndex ) 399*cdf0e10cSrcweir throw( sdbc::SQLException, 400*cdf0e10cSrcweir uno::RuntimeException) 401*cdf0e10cSrcweir { 402*cdf0e10cSrcweir if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) 403*cdf0e10cSrcweir throw sdbc::SQLException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), ::rtl::OUString(), 0, uno::Any() ); 404*cdf0e10cSrcweir uno::Reference< sdbc::XClob > Value; 405*cdf0e10cSrcweir osl::MutexGuard aGuard( m_aMutex ); 406*cdf0e10cSrcweir m_nWasNull = ::convert<uno::Reference< sdbc::XClob> >( m_pMyShell, 407*cdf0e10cSrcweir m_xTypeConverter, 408*cdf0e10cSrcweir m_aValueMap[ --columnIndex ], 409*cdf0e10cSrcweir Value ); 410*cdf0e10cSrcweir return Value; 411*cdf0e10cSrcweir } 412*cdf0e10cSrcweir 413*cdf0e10cSrcweir 414*cdf0e10cSrcweir uno::Reference< sdbc::XArray > SAL_CALL 415*cdf0e10cSrcweir XRow_impl::getArray( 416*cdf0e10cSrcweir sal_Int32 columnIndex ) 417*cdf0e10cSrcweir throw( sdbc::SQLException, 418*cdf0e10cSrcweir uno::RuntimeException) 419*cdf0e10cSrcweir { 420*cdf0e10cSrcweir if( columnIndex < 1 || columnIndex > m_aValueMap.getLength() ) 421*cdf0e10cSrcweir throw sdbc::SQLException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), ::rtl::OUString(), 0, uno::Any() ); 422*cdf0e10cSrcweir uno::Reference< sdbc::XArray > Value; 423*cdf0e10cSrcweir osl::MutexGuard aGuard( m_aMutex ); 424*cdf0e10cSrcweir m_nWasNull = ::convert<uno::Reference< sdbc::XArray> >( m_pMyShell, 425*cdf0e10cSrcweir m_xTypeConverter, 426*cdf0e10cSrcweir m_aValueMap[ --columnIndex ], 427*cdf0e10cSrcweir Value ); 428*cdf0e10cSrcweir return Value; 429*cdf0e10cSrcweir } 430