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 24 // MARKER(update_precomp.py): autogen include statement, do not remove 25 #include "precompiled_dbaccess.hxx" 26 #ifndef _DBA_COREAPI_RESULTSET_HXX_ 27 #include <resultset.hxx> 28 #endif 29 #ifndef DBACCESS_SHARED_DBASTRINGS_HRC 30 #include "dbastrings.hrc" 31 #endif 32 #ifndef _DBASHARED_APITOOLS_HXX_ 33 #include "apitools.hxx" 34 #endif 35 #ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_ 36 #include <com/sun/star/lang/DisposedException.hpp> 37 #endif 38 #ifndef _COM_SUN_STAR_SDBC_RESULTSETTYPE_HPP_ 39 #include <com/sun/star/sdbc/ResultSetType.hpp> 40 #endif 41 #ifndef _CPPUHELPER_TYPEPROVIDER_HXX_ 42 #include <cppuhelper/typeprovider.hxx> 43 #endif 44 #ifndef _COMPHELPER_PROPERTY_HXX_ 45 #include <comphelper/property.hxx> 46 #endif 47 #ifndef _COMPHELPER_SEQUENCE_HXX_ 48 #include <comphelper/sequence.hxx> 49 #endif 50 #ifndef _COMPHELPER_TYPES_HXX_ 51 #include <comphelper/types.hxx> 52 #endif 53 #ifndef _TOOLS_DEBUG_HXX //autogen 54 #include <tools/debug.hxx> 55 #endif 56 #ifndef TOOLS_DIAGNOSE_EX_H 57 #include <tools/diagnose_ex.h> 58 #endif 59 #ifndef _DBA_COREAPI_DATACOLUMN_HXX_ 60 #include <datacolumn.hxx> 61 #endif 62 #ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ 63 #include <com/sun/star/beans/PropertyAttribute.hpp> 64 #endif 65 #ifndef _DBHELPER_DBEXCEPTION_HXX_ 66 #include <connectivity/dbexception.hxx> 67 #endif 68 #ifndef _CONNECTIVITY_DBTOOLS_HXX_ 69 #include <connectivity/dbtools.hxx> 70 #endif 71 #ifndef _CPPUHELPER_EXC_HLP_HXX_ 72 #include <cppuhelper/exc_hlp.hxx> 73 #endif 74 #ifndef _OSL_THREAD_H_ 75 #include <osl/thread.h> 76 #endif 77 #include <rtl/logfile.hxx> 78 79 80 using namespace ::com::sun::star::sdbc; 81 using namespace ::com::sun::star::sdbcx; 82 //using namespace ::com::sun::star::sdb; 83 using namespace ::com::sun::star::beans; 84 using namespace ::com::sun::star::uno; 85 using namespace ::com::sun::star::lang; 86 using namespace ::com::sun::star::container; 87 using namespace ::cppu; 88 using namespace ::osl; 89 using namespace dbaccess; 90 using namespace dbtools; 91 92 DBG_NAME(OResultSet) 93 94 //-------------------------------------------------------------------------- 95 OResultSet::OResultSet(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >& _xResultSet, 96 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xStatement, 97 sal_Bool _bCaseSensitive) 98 :OResultSetBase(m_aMutex) 99 ,OPropertySetHelper(OResultSetBase::rBHelper) 100 ,m_xDelegatorResultSet(_xResultSet) 101 ,m_aWarnings( Reference< XWarningsSupplier >( _xResultSet, UNO_QUERY ) ) 102 ,m_bIsBookmarkable(sal_False) 103 { 104 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::OResultSet" ); 105 DBG_CTOR(OResultSet, NULL); 106 107 m_pColumns = new OColumns(*this, m_aMutex, _bCaseSensitive, ::std::vector< ::rtl::OUString>(), NULL,NULL); 108 109 try 110 { 111 m_aStatement = _xStatement; 112 m_xDelegatorResultSetUpdate = m_xDelegatorResultSetUpdate.query( m_xDelegatorResultSet ); 113 m_xDelegatorRow = m_xDelegatorRow.query( m_xDelegatorResultSet ); 114 m_xDelegatorRowUpdate = m_xDelegatorRowUpdate.query( m_xDelegatorResultSet ); 115 116 Reference< XPropertySet > xSet(m_xDelegatorResultSet, UNO_QUERY); 117 xSet->getPropertyValue(PROPERTY_RESULTSETTYPE) >>= m_nResultSetType; 118 xSet->getPropertyValue(PROPERTY_RESULTSETCONCURRENCY) >>= m_nResultSetConcurrency; 119 120 // test for Bookmarks 121 if (ResultSetType::FORWARD_ONLY != m_nResultSetType) 122 { 123 Reference <XPropertySetInfo > xInfo(xSet->getPropertySetInfo()); 124 if (xInfo->hasPropertyByName(PROPERTY_ISBOOKMARKABLE)) 125 { 126 m_bIsBookmarkable = ::comphelper::getBOOL(xSet->getPropertyValue(PROPERTY_ISBOOKMARKABLE)); 127 OSL_ENSURE( !m_bIsBookmarkable || Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY).is(), 128 "OResultSet::OResultSet: aggregate is inconsistent in it's bookmarkable attribute!" ); 129 m_bIsBookmarkable = m_bIsBookmarkable && Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY).is(); 130 } 131 } 132 } 133 catch(Exception&) 134 { 135 } 136 } 137 138 //-------------------------------------------------------------------------- 139 OResultSet::~OResultSet() 140 { 141 m_pColumns->acquire(); 142 m_pColumns->disposing(); 143 delete m_pColumns; 144 145 DBG_DTOR(OResultSet, NULL); 146 } 147 148 // com::sun::star::lang::XTypeProvider 149 //-------------------------------------------------------------------------- 150 Sequence< Type > OResultSet::getTypes() throw (RuntimeException) 151 { 152 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getTypes" ); 153 OTypeCollection aTypes(::getCppuType( (const Reference< XPropertySet > *)0 ), 154 OResultSetBase::getTypes()); 155 156 return aTypes.getTypes(); 157 } 158 159 //-------------------------------------------------------------------------- 160 Sequence< sal_Int8 > OResultSet::getImplementationId() throw (RuntimeException) 161 { 162 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getImplementationId" ); 163 static OImplementationId * pId = 0; 164 if (! pId) 165 { 166 MutexGuard aGuard( Mutex::getGlobalMutex() ); 167 if (! pId) 168 { 169 static OImplementationId aId; 170 pId = &aId; 171 } 172 } 173 return pId->getImplementationId(); 174 } 175 176 // com::sun::star::uno::XInterface 177 //-------------------------------------------------------------------------- 178 Any OResultSet::queryInterface( const Type & rType ) throw (RuntimeException) 179 { 180 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::queryInterface" ); 181 Any aIface = OResultSetBase::queryInterface( rType ); 182 if (!aIface.hasValue()) 183 aIface = ::cppu::queryInterface( 184 rType, 185 static_cast< XPropertySet * >( this )); 186 187 return aIface; 188 } 189 190 //-------------------------------------------------------------------------- 191 void OResultSet::acquire() throw () 192 { 193 OResultSetBase::acquire(); 194 } 195 196 //-------------------------------------------------------------------------- 197 void OResultSet::release() throw () 198 { 199 OResultSetBase::release(); 200 } 201 202 203 // OResultSetBase 204 //------------------------------------------------------------------------------ 205 void OResultSet::disposing() 206 { 207 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::disposing" ); 208 OPropertySetHelper::disposing(); 209 210 MutexGuard aGuard(m_aMutex); 211 212 // free the columns 213 m_pColumns->disposing(); 214 215 // close the pending result set 216 Reference< XCloseable > (m_xDelegatorResultSet, UNO_QUERY)->close(); 217 218 m_xDelegatorResultSet = NULL; 219 m_xDelegatorRow = NULL; 220 m_xDelegatorRowUpdate = NULL; 221 222 m_aStatement = Reference< XInterface >(); 223 } 224 225 // XCloseable 226 //------------------------------------------------------------------------------ 227 void OResultSet::close(void) throw( SQLException, RuntimeException ) 228 { 229 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::close" ); 230 { 231 MutexGuard aGuard( m_aMutex ); 232 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 233 } 234 dispose(); 235 } 236 237 // XServiceInfo 238 //------------------------------------------------------------------------------ 239 rtl::OUString OResultSet::getImplementationName( ) throw(RuntimeException) 240 { 241 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getImplementationName" ); 242 return rtl::OUString::createFromAscii("com.sun.star.sdb.OResultSet"); 243 } 244 245 //------------------------------------------------------------------------------ 246 sal_Bool OResultSet::supportsService( const ::rtl::OUString& _rServiceName ) throw (RuntimeException) 247 { 248 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::supportsService" ); 249 return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0; 250 } 251 252 //------------------------------------------------------------------------------ 253 Sequence< ::rtl::OUString > OResultSet::getSupportedServiceNames( ) throw (RuntimeException) 254 { 255 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getSupportedServiceNames" ); 256 Sequence< ::rtl::OUString > aSNS( 2 ); 257 aSNS[0] = SERVICE_SDBC_RESULTSET; 258 aSNS[1] = SERVICE_SDB_RESULTSET; 259 return aSNS; 260 } 261 262 // com::sun::star::beans::XPropertySet 263 //------------------------------------------------------------------------------ 264 Reference< XPropertySetInfo > OResultSet::getPropertySetInfo() throw (RuntimeException) 265 { 266 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getPropertySetInfo" ); 267 return createPropertySetInfo( getInfoHelper() ) ; 268 } 269 270 // comphelper::OPropertyArrayUsageHelper 271 //------------------------------------------------------------------------------ 272 ::cppu::IPropertyArrayHelper* OResultSet::createArrayHelper( ) const 273 { 274 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::createArrayHelper" ); 275 BEGIN_PROPERTY_HELPER(6) 276 DECL_PROP1(CURSORNAME, ::rtl::OUString, READONLY); 277 DECL_PROP0(FETCHDIRECTION, sal_Int32); 278 DECL_PROP0(FETCHSIZE, sal_Int32); 279 DECL_PROP1_BOOL(ISBOOKMARKABLE, READONLY); 280 DECL_PROP1(RESULTSETCONCURRENCY, sal_Int32, READONLY); 281 DECL_PROP1(RESULTSETTYPE, sal_Int32, READONLY); 282 END_PROPERTY_HELPER(); 283 } 284 285 // cppu::OPropertySetHelper 286 //------------------------------------------------------------------------------ 287 ::cppu::IPropertyArrayHelper& OResultSet::getInfoHelper() 288 { 289 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getInfoHelper" ); 290 return *getArrayHelper(); 291 } 292 293 //------------------------------------------------------------------------------ 294 sal_Bool OResultSet::convertFastPropertyValue(Any & rConvertedValue, Any & rOldValue, sal_Int32 nHandle, const Any& rValue ) throw( IllegalArgumentException ) 295 { 296 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::convertFastPropertyValue" ); 297 // be lazy ... 298 rConvertedValue = rValue; 299 getFastPropertyValue( rOldValue, nHandle ); 300 return sal_True; 301 } 302 303 //------------------------------------------------------------------------------ 304 void OResultSet::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue ) throw (Exception) 305 { 306 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::setFastPropertyValue_NoBroadcast" ); 307 // set it for the driver result set 308 Reference< XPropertySet > xSet(m_xDelegatorResultSet, UNO_QUERY); 309 switch (nHandle) 310 { 311 case PROPERTY_ID_FETCHDIRECTION: 312 xSet->setPropertyValue(PROPERTY_FETCHDIRECTION, rValue); 313 break; 314 case PROPERTY_ID_FETCHSIZE: 315 xSet->setPropertyValue(PROPERTY_FETCHSIZE, rValue); 316 break; 317 default: 318 DBG_ERROR("unknown Property"); 319 } 320 } 321 322 //------------------------------------------------------------------------------ 323 void OResultSet::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const 324 { 325 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getFastPropertyValue" ); 326 switch (nHandle) 327 { 328 case PROPERTY_ID_ISBOOKMARKABLE: 329 { 330 sal_Bool bVal = m_bIsBookmarkable; 331 rValue.setValue(&bVal, getBooleanCppuType()); 332 } break; 333 default: 334 { 335 // get the property name 336 ::rtl::OUString aPropName; 337 sal_Int16 nAttributes; 338 const_cast<OResultSet*>(this)->getInfoHelper(). 339 fillPropertyMembersByHandle(&aPropName, &nAttributes, nHandle); 340 OSL_ENSURE(aPropName.getLength(), "property not found?"); 341 342 // now read the value 343 rValue = Reference< XPropertySet >(m_xDelegatorResultSet, UNO_QUERY)->getPropertyValue(aPropName); 344 } 345 } 346 } 347 348 // XWarningsSupplier 349 //------------------------------------------------------------------------------ 350 Any OResultSet::getWarnings(void) throw( SQLException, RuntimeException ) 351 { 352 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getWarnings" ); 353 MutexGuard aGuard(m_aMutex); 354 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 355 return m_aWarnings.getWarnings(); 356 } 357 358 //------------------------------------------------------------------------------ 359 void OResultSet::clearWarnings(void) throw( SQLException, RuntimeException ) 360 { 361 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::clearWarnings" ); 362 MutexGuard aGuard(m_aMutex); 363 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 364 m_aWarnings.clearWarnings(); 365 } 366 367 // ::com::sun::star::sdbc::XResultSetMetaDataSupplier 368 //------------------------------------------------------------------------------ 369 Reference< XResultSetMetaData > OResultSet::getMetaData(void) throw( SQLException, RuntimeException ) 370 { 371 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getMetaData" ); 372 MutexGuard aGuard(m_aMutex); 373 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 374 375 return Reference< XResultSetMetaDataSupplier >(m_xDelegatorResultSet, UNO_QUERY)->getMetaData(); 376 } 377 378 // ::com::sun::star::sdbc::XColumnLocate 379 //------------------------------------------------------------------------------ 380 sal_Int32 OResultSet::findColumn(const rtl::OUString& columnName) throw( SQLException, RuntimeException ) 381 { 382 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::findColumn" ); 383 MutexGuard aGuard(m_aMutex); 384 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 385 386 return Reference< XColumnLocate >(m_xDelegatorResultSet, UNO_QUERY)->findColumn(columnName); 387 } 388 389 //------------------------------------------------------------------------------ 390 namespace 391 { 392 static Reference< XDatabaseMetaData > lcl_getDBMetaDataFromStatement_nothrow( const Reference< XInterface >& _rxStatement ) 393 { 394 Reference< XDatabaseMetaData > xDBMetaData; 395 try 396 { 397 Reference< XStatement > xStatement( _rxStatement, UNO_QUERY ); 398 Reference< XPreparedStatement > xPreparedStatement( _rxStatement, UNO_QUERY ); 399 Reference< XConnection > xConn; 400 if ( xStatement.is() ) 401 xConn = xStatement->getConnection(); 402 else if ( xPreparedStatement.is() ) 403 xConn = xPreparedStatement->getConnection(); 404 if ( xConn.is() ) 405 xDBMetaData = xConn->getMetaData(); 406 } 407 catch( const Exception& ) 408 { 409 DBG_UNHANDLED_EXCEPTION(); 410 } 411 return xDBMetaData; 412 } 413 } 414 // ::com::sun::star::sdbcx::XColumnsSupplier 415 //------------------------------------------------------------------------------ 416 Reference< ::com::sun::star::container::XNameAccess > OResultSet::getColumns(void) throw( RuntimeException ) 417 { 418 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getColumns" ); 419 MutexGuard aGuard(m_aMutex); 420 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 421 422 // do we have to populate the columns 423 if (!m_pColumns->isInitialized()) 424 { 425 // get the metadata 426 Reference< XResultSetMetaData > xMetaData = Reference< XResultSetMetaDataSupplier >(m_xDelegatorResultSet, UNO_QUERY)->getMetaData(); 427 428 sal_Int32 nColCount = 0; 429 // do we have columns 430 try 431 { 432 Reference< XDatabaseMetaData > xDBMetaData( lcl_getDBMetaDataFromStatement_nothrow( getStatement() ) ); 433 nColCount = xMetaData->getColumnCount(); 434 435 for ( sal_Int32 i = 0; i < nColCount; ++i) 436 { 437 // retrieve the name of the column 438 rtl::OUString sName = xMetaData->getColumnName(i + 1); 439 ODataColumn* pColumn = new ODataColumn(xMetaData, m_xDelegatorRow, m_xDelegatorRowUpdate, i + 1, xDBMetaData); 440 441 // don't silently assume that the name is unique - result set implementations 442 // are allowed to return duplicate names, but we are required to have 443 // unique column names 444 if ( m_pColumns->hasByName( sName ) ) 445 sName = ::dbtools::createUniqueName( m_pColumns, sName ); 446 447 m_pColumns->append( sName, pColumn ); 448 } 449 } 450 catch ( const SQLException& ) 451 { 452 DBG_UNHANDLED_EXCEPTION(); 453 } 454 m_pColumns->setInitialized(); 455 456 #if OSL_DEBUG_LEVEL > 0 457 // some sanity checks. Especially in case we auto-adjusted the column names above, 458 // this might be reasonable 459 try 460 { 461 const Reference< XNameAccess > xColNames( static_cast< XNameAccess* >( m_pColumns ), UNO_SET_THROW ); 462 const Sequence< ::rtl::OUString > aNames( xColNames->getElementNames() ); 463 OSL_POSTCOND( aNames.getLength() == nColCount, 464 "OResultSet::getColumns: invalid column count!" ); 465 for ( const ::rtl::OUString* pName = aNames.getConstArray(); 466 pName != aNames.getConstArray() + aNames.getLength(); 467 ++pName 468 ) 469 { 470 Reference< XPropertySet > xColProps( xColNames->getByName( *pName ), UNO_QUERY_THROW ); 471 ::rtl::OUString sName; 472 OSL_VERIFY( xColProps->getPropertyValue( PROPERTY_NAME ) >>= sName ); 473 OSL_POSTCOND( sName == *pName, "OResultSet::getColumns: invalid column name!" ); 474 } 475 476 } 477 catch( const Exception& ) 478 { 479 DBG_UNHANDLED_EXCEPTION(); 480 } 481 #endif 482 } 483 return m_pColumns; 484 } 485 486 // ::com::sun::star::sdbc::XRow 487 //------------------------------------------------------------------------------ 488 sal_Bool OResultSet::wasNull(void) throw( SQLException, RuntimeException ) 489 { 490 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::wasNull" ); 491 MutexGuard aGuard(m_aMutex); 492 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 493 494 return m_xDelegatorRow->wasNull(); 495 } 496 //------------------------------------------------------------------------------ 497 rtl::OUString OResultSet::getString(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) 498 { 499 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getString" ); 500 MutexGuard aGuard(m_aMutex); 501 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 502 503 return m_xDelegatorRow->getString(columnIndex); 504 } 505 //------------------------------------------------------------------------------ 506 sal_Bool OResultSet::getBoolean(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) 507 { 508 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getBoolean" ); 509 MutexGuard aGuard(m_aMutex); 510 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 511 512 return m_xDelegatorRow->getBoolean(columnIndex); 513 } 514 //------------------------------------------------------------------------------ 515 sal_Int8 OResultSet::getByte(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) 516 { 517 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getByte" ); 518 MutexGuard aGuard(m_aMutex); 519 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 520 521 return m_xDelegatorRow->getByte(columnIndex); 522 } 523 //------------------------------------------------------------------------------ 524 sal_Int16 OResultSet::getShort(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) 525 { 526 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getShort" ); 527 MutexGuard aGuard(m_aMutex); 528 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 529 530 return m_xDelegatorRow->getShort(columnIndex); 531 } 532 //------------------------------------------------------------------------------ 533 sal_Int32 OResultSet::getInt(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) 534 { 535 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getInt" ); 536 MutexGuard aGuard(m_aMutex); 537 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 538 539 return m_xDelegatorRow->getInt(columnIndex); 540 } 541 //------------------------------------------------------------------------------ 542 sal_Int64 OResultSet::getLong(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) 543 { 544 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getLong" ); 545 MutexGuard aGuard(m_aMutex); 546 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 547 548 return m_xDelegatorRow->getLong(columnIndex); 549 } 550 //------------------------------------------------------------------------------ 551 float OResultSet::getFloat(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) 552 { 553 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getFloat" ); 554 MutexGuard aGuard(m_aMutex); 555 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 556 557 return m_xDelegatorRow->getFloat(columnIndex); 558 } 559 //------------------------------------------------------------------------------ 560 double OResultSet::getDouble(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) 561 { 562 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getDouble" ); 563 MutexGuard aGuard(m_aMutex); 564 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 565 566 return m_xDelegatorRow->getDouble(columnIndex); 567 } 568 //------------------------------------------------------------------------------ 569 Sequence< sal_Int8 > OResultSet::getBytes(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) 570 { 571 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getBytes" ); 572 MutexGuard aGuard(m_aMutex); 573 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 574 575 return m_xDelegatorRow->getBytes(columnIndex); 576 } 577 //------------------------------------------------------------------------------ 578 ::com::sun::star::util::Date OResultSet::getDate(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) 579 { 580 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getDate" ); 581 MutexGuard aGuard(m_aMutex); 582 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 583 584 return m_xDelegatorRow->getDate(columnIndex); 585 } 586 //------------------------------------------------------------------------------ 587 ::com::sun::star::util::Time OResultSet::getTime(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) 588 { 589 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getTime" ); 590 MutexGuard aGuard(m_aMutex); 591 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 592 593 return m_xDelegatorRow->getTime(columnIndex); 594 } 595 //------------------------------------------------------------------------------ 596 ::com::sun::star::util::DateTime OResultSet::getTimestamp(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) 597 { 598 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getTimestamp" ); 599 MutexGuard aGuard(m_aMutex); 600 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 601 602 return m_xDelegatorRow->getTimestamp(columnIndex); 603 } 604 //------------------------------------------------------------------------------ 605 Reference< ::com::sun::star::io::XInputStream > OResultSet::getBinaryStream(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) 606 { 607 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getBinaryStream" ); 608 MutexGuard aGuard(m_aMutex); 609 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 610 611 return m_xDelegatorRow->getBinaryStream(columnIndex); 612 } 613 //------------------------------------------------------------------------------ 614 Reference< ::com::sun::star::io::XInputStream > OResultSet::getCharacterStream(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) 615 { 616 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getCharacterStream" ); 617 MutexGuard aGuard(m_aMutex); 618 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 619 620 return m_xDelegatorRow->getCharacterStream(columnIndex); 621 } 622 //------------------------------------------------------------------------------ 623 Any OResultSet::getObject(sal_Int32 columnIndex, const Reference< ::com::sun::star::container::XNameAccess > & typeMap) throw( SQLException, RuntimeException ) 624 { 625 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getObject" ); 626 MutexGuard aGuard(m_aMutex); 627 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 628 629 return m_xDelegatorRow->getObject(columnIndex, typeMap); 630 } 631 //------------------------------------------------------------------------------ 632 Reference< XRef > OResultSet::getRef(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) 633 { 634 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getRef" ); 635 MutexGuard aGuard(m_aMutex); 636 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 637 638 return m_xDelegatorRow->getRef(columnIndex); 639 } 640 //------------------------------------------------------------------------------ 641 Reference< XBlob > OResultSet::getBlob(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) 642 { 643 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getBlob" ); 644 MutexGuard aGuard(m_aMutex); 645 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 646 647 return m_xDelegatorRow->getBlob(columnIndex); 648 } 649 //------------------------------------------------------------------------------ 650 Reference< XClob > OResultSet::getClob(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) 651 { 652 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getClob" ); 653 MutexGuard aGuard(m_aMutex); 654 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 655 656 return m_xDelegatorRow->getClob(columnIndex); 657 } 658 //------------------------------------------------------------------------------ 659 Reference< XArray > OResultSet::getArray(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) 660 { 661 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getArray" ); 662 MutexGuard aGuard(m_aMutex); 663 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 664 665 return m_xDelegatorRow->getArray(columnIndex); 666 } 667 668 // ::com::sun::star::sdbc::XRowUpdate 669 //------------------------------------------------------------------------------ 670 void OResultSet::updateNull(sal_Int32 columnIndex) throw( SQLException, RuntimeException ) 671 { 672 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateNull" ); 673 MutexGuard aGuard(m_aMutex); 674 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 675 676 checkReadOnly(); 677 678 m_xDelegatorRowUpdate->updateNull(columnIndex); 679 } 680 681 //------------------------------------------------------------------------------ 682 void OResultSet::updateBoolean(sal_Int32 columnIndex, sal_Bool x) throw( SQLException, RuntimeException ) 683 { 684 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateBoolean" ); 685 MutexGuard aGuard(m_aMutex); 686 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 687 688 checkReadOnly(); 689 690 m_xDelegatorRowUpdate->updateBoolean(columnIndex, x); 691 } 692 //------------------------------------------------------------------------------ 693 void OResultSet::updateByte(sal_Int32 columnIndex, sal_Int8 x) throw( SQLException, RuntimeException ) 694 { 695 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateByte" ); 696 MutexGuard aGuard(m_aMutex); 697 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 698 699 checkReadOnly(); 700 701 m_xDelegatorRowUpdate->updateByte(columnIndex, x); 702 } 703 //------------------------------------------------------------------------------ 704 void OResultSet::updateShort(sal_Int32 columnIndex, sal_Int16 x) throw( SQLException, RuntimeException ) 705 { 706 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateShort" ); 707 MutexGuard aGuard(m_aMutex); 708 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 709 710 checkReadOnly(); 711 712 m_xDelegatorRowUpdate->updateShort(columnIndex, x); 713 } 714 //------------------------------------------------------------------------------ 715 void OResultSet::updateInt(sal_Int32 columnIndex, sal_Int32 x) throw( SQLException, RuntimeException ) 716 { 717 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateInt" ); 718 MutexGuard aGuard(m_aMutex); 719 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 720 721 checkReadOnly(); 722 723 m_xDelegatorRowUpdate->updateInt(columnIndex, x); 724 } 725 //------------------------------------------------------------------------------ 726 void OResultSet::updateLong(sal_Int32 columnIndex, sal_Int64 x) throw( SQLException, RuntimeException ) 727 { 728 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateLong" ); 729 MutexGuard aGuard(m_aMutex); 730 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 731 732 checkReadOnly(); 733 734 m_xDelegatorRowUpdate->updateLong(columnIndex, x); 735 } 736 //------------------------------------------------------------------------------ 737 void OResultSet::updateFloat(sal_Int32 columnIndex, float x) throw( SQLException, RuntimeException ) 738 { 739 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateFloat" ); 740 MutexGuard aGuard(m_aMutex); 741 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 742 743 checkReadOnly(); 744 745 m_xDelegatorRowUpdate->updateFloat(columnIndex, x); 746 } 747 //------------------------------------------------------------------------------ 748 void OResultSet::updateDouble(sal_Int32 columnIndex, double x) throw( SQLException, RuntimeException ) 749 { 750 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateDouble" ); 751 MutexGuard aGuard(m_aMutex); 752 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 753 754 checkReadOnly(); 755 756 m_xDelegatorRowUpdate->updateDouble(columnIndex, x); 757 } 758 //------------------------------------------------------------------------------ 759 void OResultSet::updateString(sal_Int32 columnIndex, const rtl::OUString& x) throw( SQLException, RuntimeException ) 760 { 761 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateString" ); 762 MutexGuard aGuard(m_aMutex); 763 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 764 765 checkReadOnly(); 766 767 m_xDelegatorRowUpdate->updateString(columnIndex, x); 768 } 769 //------------------------------------------------------------------------------ 770 void OResultSet::updateBytes(sal_Int32 columnIndex, const Sequence< sal_Int8 >& x) throw( SQLException, RuntimeException ) 771 { 772 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateBytes" ); 773 MutexGuard aGuard(m_aMutex); 774 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 775 776 checkReadOnly(); 777 778 m_xDelegatorRowUpdate->updateBytes(columnIndex, x); 779 } 780 //------------------------------------------------------------------------------ 781 void OResultSet::updateDate(sal_Int32 columnIndex, const ::com::sun::star::util::Date& x) throw( SQLException, RuntimeException ) 782 { 783 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateDate" ); 784 MutexGuard aGuard(m_aMutex); 785 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 786 787 checkReadOnly(); 788 789 m_xDelegatorRowUpdate->updateDate(columnIndex, x); 790 } 791 //------------------------------------------------------------------------------ 792 void OResultSet::updateTime(sal_Int32 columnIndex, const ::com::sun::star::util::Time& x) throw( SQLException, RuntimeException ) 793 { 794 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateTime" ); 795 MutexGuard aGuard(m_aMutex); 796 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 797 798 checkReadOnly(); 799 800 m_xDelegatorRowUpdate->updateTime(columnIndex, x); 801 } 802 //------------------------------------------------------------------------------ 803 void OResultSet::updateTimestamp(sal_Int32 columnIndex, const ::com::sun::star::util::DateTime& x) throw( SQLException, RuntimeException ) 804 { 805 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateTimestamp" ); 806 MutexGuard aGuard(m_aMutex); 807 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 808 809 checkReadOnly(); 810 811 m_xDelegatorRowUpdate->updateTimestamp(columnIndex, x); 812 } 813 //------------------------------------------------------------------------------ 814 void OResultSet::updateBinaryStream(sal_Int32 columnIndex, const Reference< ::com::sun::star::io::XInputStream > & x, sal_Int32 length) throw( SQLException, RuntimeException ) 815 { 816 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateBinaryStream" ); 817 MutexGuard aGuard(m_aMutex); 818 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 819 820 checkReadOnly(); 821 822 m_xDelegatorRowUpdate->updateBinaryStream(columnIndex, x, length); 823 } 824 //------------------------------------------------------------------------------ 825 void OResultSet::updateCharacterStream(sal_Int32 columnIndex, const Reference< ::com::sun::star::io::XInputStream > & x, sal_Int32 length) throw( SQLException, RuntimeException ) 826 { 827 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateCharacterStream" ); 828 MutexGuard aGuard(m_aMutex); 829 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 830 831 checkReadOnly(); 832 833 m_xDelegatorRowUpdate->updateCharacterStream(columnIndex, x, length); 834 } 835 //------------------------------------------------------------------------------ 836 void OResultSet::updateNumericObject(sal_Int32 columnIndex, const Any& x, sal_Int32 scale) throw( SQLException, RuntimeException ) 837 { 838 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateNumericObject" ); 839 MutexGuard aGuard(m_aMutex); 840 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 841 842 checkReadOnly(); 843 844 m_xDelegatorRowUpdate->updateNumericObject(columnIndex, x, scale); 845 } 846 847 //------------------------------------------------------------------------------ 848 void OResultSet::updateObject(sal_Int32 columnIndex, const Any& x) throw( SQLException, RuntimeException ) 849 { 850 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateObject" ); 851 MutexGuard aGuard(m_aMutex); 852 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 853 854 checkReadOnly(); 855 856 m_xDelegatorRowUpdate->updateObject(columnIndex, x); 857 } 858 859 // ::com::sun::star::sdbc::XResultSet 860 //------------------------------------------------------------------------------ 861 sal_Bool OResultSet::next(void) throw( SQLException, RuntimeException ) 862 { 863 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::next" ); 864 MutexGuard aGuard(m_aMutex); 865 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 866 867 return m_xDelegatorResultSet->next(); 868 } 869 870 //------------------------------------------------------------------------------ 871 sal_Bool OResultSet::isBeforeFirst(void) throw( SQLException, RuntimeException ) 872 { 873 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::isBeforeFirst" ); 874 MutexGuard aGuard(m_aMutex); 875 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 876 877 return m_xDelegatorResultSet->isBeforeFirst(); 878 } 879 880 //------------------------------------------------------------------------------ 881 sal_Bool OResultSet::isAfterLast(void) throw( SQLException, RuntimeException ) 882 { 883 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::isAfterLast" ); 884 MutexGuard aGuard(m_aMutex); 885 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 886 887 return m_xDelegatorResultSet->isAfterLast(); 888 } 889 890 //------------------------------------------------------------------------------ 891 sal_Bool OResultSet::isFirst(void) throw( SQLException, RuntimeException ) 892 { 893 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::isFirst" ); 894 MutexGuard aGuard(m_aMutex); 895 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 896 897 return m_xDelegatorResultSet->isFirst(); 898 } 899 900 //------------------------------------------------------------------------------ 901 sal_Bool OResultSet::isLast(void) throw( SQLException, RuntimeException ) 902 { 903 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::isLast" ); 904 MutexGuard aGuard(m_aMutex); 905 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 906 907 return m_xDelegatorResultSet->isLast(); 908 } 909 910 //------------------------------------------------------------------------------ 911 void OResultSet::beforeFirst(void) throw( SQLException, RuntimeException ) 912 { 913 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::beforeFirst" ); 914 MutexGuard aGuard(m_aMutex); 915 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 916 917 m_xDelegatorResultSet->beforeFirst(); 918 } 919 920 //------------------------------------------------------------------------------ 921 void OResultSet::afterLast(void) throw( SQLException, RuntimeException ) 922 { 923 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::afterLast" ); 924 MutexGuard aGuard(m_aMutex); 925 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 926 927 m_xDelegatorResultSet->afterLast(); 928 } 929 930 //------------------------------------------------------------------------------ 931 sal_Bool OResultSet::first(void) throw( SQLException, RuntimeException ) 932 { 933 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::first" ); 934 MutexGuard aGuard(m_aMutex); 935 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 936 937 return m_xDelegatorResultSet->first(); 938 } 939 940 //------------------------------------------------------------------------------ 941 sal_Bool OResultSet::last(void) throw( SQLException, RuntimeException ) 942 { 943 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::last" ); 944 MutexGuard aGuard(m_aMutex); 945 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 946 947 return m_xDelegatorResultSet->last(); 948 } 949 950 //------------------------------------------------------------------------------ 951 sal_Int32 OResultSet::getRow(void) throw( SQLException, RuntimeException ) 952 { 953 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getRow" ); 954 MutexGuard aGuard(m_aMutex); 955 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 956 957 return m_xDelegatorResultSet->getRow(); 958 } 959 960 //------------------------------------------------------------------------------ 961 sal_Bool OResultSet::absolute(sal_Int32 row) throw( SQLException, RuntimeException ) 962 { 963 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::absolute" ); 964 MutexGuard aGuard(m_aMutex); 965 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 966 967 return m_xDelegatorResultSet->absolute(row); 968 } 969 970 //------------------------------------------------------------------------------ 971 sal_Bool OResultSet::relative(sal_Int32 rows) throw( SQLException, RuntimeException ) 972 { 973 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::relative" ); 974 MutexGuard aGuard(m_aMutex); 975 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 976 977 return m_xDelegatorResultSet->relative(rows); 978 } 979 980 //------------------------------------------------------------------------------ 981 sal_Bool OResultSet::previous(void) throw( SQLException, RuntimeException ) 982 { 983 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::previous" ); 984 MutexGuard aGuard(m_aMutex); 985 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 986 987 return m_xDelegatorResultSet->previous(); 988 } 989 990 //------------------------------------------------------------------------------ 991 void OResultSet::refreshRow(void) throw( SQLException, RuntimeException ) 992 { 993 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::refreshRow" ); 994 MutexGuard aGuard(m_aMutex); 995 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 996 997 m_xDelegatorResultSet->refreshRow(); 998 } 999 1000 //------------------------------------------------------------------------------ 1001 sal_Bool OResultSet::rowUpdated(void) throw( SQLException, RuntimeException ) 1002 { 1003 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::rowUpdated" ); 1004 MutexGuard aGuard(m_aMutex); 1005 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 1006 1007 return m_xDelegatorResultSet->rowUpdated(); 1008 } 1009 1010 //------------------------------------------------------------------------------ 1011 sal_Bool OResultSet::rowInserted(void) throw( SQLException, RuntimeException ) 1012 { 1013 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::rowInserted" ); 1014 MutexGuard aGuard(m_aMutex); 1015 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 1016 1017 return m_xDelegatorResultSet->rowInserted(); 1018 } 1019 1020 //------------------------------------------------------------------------------ 1021 sal_Bool OResultSet::rowDeleted(void) throw( SQLException, RuntimeException ) 1022 { 1023 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::rowDeleted" ); 1024 MutexGuard aGuard(m_aMutex); 1025 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 1026 1027 return m_xDelegatorResultSet->rowDeleted(); 1028 } 1029 1030 //------------------------------------------------------------------------------ 1031 Reference< XInterface > OResultSet::getStatement(void) throw( SQLException, RuntimeException ) 1032 { 1033 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getStatement" ); 1034 MutexGuard aGuard(m_aMutex); 1035 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 1036 1037 return m_aStatement; 1038 } 1039 1040 // ::com::sun::star::sdbcx::XRowLocate 1041 //------------------------------------------------------------------------------ 1042 Any OResultSet::getBookmark(void) throw( SQLException, RuntimeException ) 1043 { 1044 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getBookmark" ); 1045 MutexGuard aGuard(m_aMutex); 1046 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 1047 1048 checkBookmarkable(); 1049 1050 return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY)->getBookmark(); 1051 } 1052 1053 //------------------------------------------------------------------------------ 1054 sal_Bool OResultSet::moveToBookmark(const Any& bookmark) throw( SQLException, RuntimeException ) 1055 { 1056 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::moveToBookmark" ); 1057 MutexGuard aGuard(m_aMutex); 1058 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 1059 1060 checkBookmarkable(); 1061 1062 return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY)->moveToBookmark(bookmark); 1063 } 1064 1065 //------------------------------------------------------------------------------ 1066 sal_Bool OResultSet::moveRelativeToBookmark(const Any& bookmark, sal_Int32 rows) throw( SQLException, RuntimeException ) 1067 { 1068 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::moveRelativeToBookmark" ); 1069 MutexGuard aGuard(m_aMutex); 1070 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 1071 1072 checkBookmarkable(); 1073 1074 return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY)->moveRelativeToBookmark(bookmark, rows); 1075 } 1076 1077 //------------------------------------------------------------------------------ 1078 sal_Int32 OResultSet::compareBookmarks(const Any& _first, const Any& _second) throw( SQLException, RuntimeException ) 1079 { 1080 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::compareBookmarks" ); 1081 MutexGuard aGuard(m_aMutex); 1082 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 1083 1084 checkBookmarkable(); 1085 1086 return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY)->compareBookmarks(_first, _second); 1087 } 1088 1089 //------------------------------------------------------------------------------ 1090 sal_Bool OResultSet::hasOrderedBookmarks(void) throw( SQLException, RuntimeException ) 1091 { 1092 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::hasOrderedBookmarks" ); 1093 MutexGuard aGuard(m_aMutex); 1094 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 1095 1096 checkBookmarkable(); 1097 1098 return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY)->hasOrderedBookmarks(); 1099 } 1100 1101 //------------------------------------------------------------------------------ 1102 sal_Int32 OResultSet::hashBookmark(const Any& bookmark) throw( SQLException, RuntimeException ) 1103 { 1104 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::hashBookmark" ); 1105 MutexGuard aGuard(m_aMutex); 1106 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 1107 1108 checkBookmarkable(); 1109 1110 return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY)->hashBookmark(bookmark); 1111 } 1112 1113 // ::com::sun::star::sdbc::XResultSetUpdate 1114 //------------------------------------------------------------------------------ 1115 void OResultSet::insertRow(void) throw( SQLException, RuntimeException ) 1116 { 1117 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::insertRow" ); 1118 MutexGuard aGuard(m_aMutex); 1119 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 1120 1121 checkReadOnly(); 1122 1123 m_xDelegatorResultSetUpdate->insertRow(); 1124 } 1125 1126 //------------------------------------------------------------------------------ 1127 void OResultSet::updateRow(void) throw( SQLException, RuntimeException ) 1128 { 1129 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateRow" ); 1130 MutexGuard aGuard(m_aMutex); 1131 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 1132 1133 checkReadOnly(); 1134 1135 m_xDelegatorResultSetUpdate->updateRow(); 1136 } 1137 1138 //------------------------------------------------------------------------------ 1139 void OResultSet::deleteRow(void) throw( SQLException, RuntimeException ) 1140 { 1141 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::deleteRow" ); 1142 MutexGuard aGuard(m_aMutex); 1143 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 1144 1145 checkReadOnly(); 1146 1147 m_xDelegatorResultSetUpdate->deleteRow(); 1148 } 1149 1150 //------------------------------------------------------------------------------ 1151 void OResultSet::cancelRowUpdates(void) throw( SQLException, RuntimeException ) 1152 { 1153 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::cancelRowUpdates" ); 1154 MutexGuard aGuard(m_aMutex); 1155 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 1156 1157 checkReadOnly(); 1158 1159 m_xDelegatorResultSetUpdate->cancelRowUpdates(); 1160 } 1161 1162 //------------------------------------------------------------------------------ 1163 void OResultSet::moveToInsertRow(void) throw( SQLException, RuntimeException ) 1164 { 1165 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::moveToInsertRow" ); 1166 MutexGuard aGuard(m_aMutex); 1167 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 1168 1169 checkReadOnly(); 1170 1171 m_xDelegatorResultSetUpdate->moveToInsertRow(); 1172 } 1173 1174 //------------------------------------------------------------------------------ 1175 void OResultSet::moveToCurrentRow(void) throw( SQLException, RuntimeException ) 1176 { 1177 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::moveToCurrentRow" ); 1178 MutexGuard aGuard(m_aMutex); 1179 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed); 1180 1181 checkReadOnly(); 1182 1183 m_xDelegatorResultSetUpdate->moveToCurrentRow(); 1184 } 1185 1186 // ----------------------------------------------------------------------------- 1187 void OResultSet::checkReadOnly() const 1188 { 1189 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::checkReadOnly" ); 1190 if ( ( m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY ) 1191 || !m_xDelegatorResultSetUpdate.is() 1192 ) 1193 throwSQLException( "The result set is read-only.", SQL_GENERAL_ERROR, *const_cast< OResultSet* >( this ) ); 1194 } 1195 1196 // ----------------------------------------------------------------------------- 1197 void OResultSet::checkBookmarkable() const 1198 { 1199 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::checkBookmarkable" ); 1200 if ( !m_bIsBookmarkable ) 1201 throwSQLException( "The result set does not have bookmark support.", SQL_GENERAL_ERROR, *const_cast< OResultSet* >( this ) ); 1202 } 1203 // ----------------------------------------------------------------------------- 1204 1205