1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: resultset.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_dbaccess.hxx"
33 #ifndef _DBA_COREAPI_RESULTSET_HXX_
34 #include <resultset.hxx>
36 #ifndef DBACCESS_SHARED_DBASTRINGS_HRC
37 #include "dbastrings.hrc"
39 #ifndef _DBASHARED_APITOOLS_HXX_
40 #include "apitools.hxx"
42 #ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_
43 #include <com/sun/star/lang/DisposedException.hpp>
45 #ifndef _COM_SUN_STAR_SDBC_RESULTSETTYPE_HPP_
46 #include <com/sun/star/sdbc/ResultSetType.hpp>
48 #ifndef _CPPUHELPER_TYPEPROVIDER_HXX_
49 #include <cppuhelper/typeprovider.hxx>
51 #ifndef _COMPHELPER_PROPERTY_HXX_
52 #include <comphelper/property.hxx>
54 #ifndef _COMPHELPER_SEQUENCE_HXX_
55 #include <comphelper/sequence.hxx>
57 #ifndef _COMPHELPER_TYPES_HXX_
58 #include <comphelper/types.hxx>
60 #ifndef _TOOLS_DEBUG_HXX //autogen
61 #include <tools/debug.hxx>
63 #ifndef TOOLS_DIAGNOSE_EX_H
64 #include <tools/diagnose_ex.h>
66 #ifndef _DBA_COREAPI_DATACOLUMN_HXX_
67 #include <datacolumn.hxx>
69 #ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
70 #include <com/sun/star/beans/PropertyAttribute.hpp>
72 #ifndef _DBHELPER_DBEXCEPTION_HXX_
73 #include <connectivity/dbexception.hxx>
75 #ifndef _CONNECTIVITY_DBTOOLS_HXX_
76 #include <connectivity/dbtools.hxx>
78 #ifndef _CPPUHELPER_EXC_HLP_HXX_
79 #include <cppuhelper/exc_hlp.hxx>
81 #ifndef _OSL_THREAD_H_
82 #include <osl/thread.h>
84 #include <rtl/logfile.hxx>
87 using namespace ::com::sun::star::sdbc
;
88 using namespace ::com::sun::star::sdbcx
;
89 //using namespace ::com::sun::star::sdb;
90 using namespace ::com::sun::star::beans
;
91 using namespace ::com::sun::star::uno
;
92 using namespace ::com::sun::star::lang
;
93 using namespace ::com::sun::star::container
;
94 using namespace ::cppu
;
95 using namespace ::osl
;
96 using namespace dbaccess
;
97 using namespace dbtools
;
101 //--------------------------------------------------------------------------
102 OResultSet::OResultSet(const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XResultSet
>& _xResultSet
,
103 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& _xStatement
,
104 sal_Bool _bCaseSensitive
)
105 :OResultSetBase(m_aMutex
)
106 ,OPropertySetHelper(OResultSetBase::rBHelper
)
107 ,m_xDelegatorResultSet(_xResultSet
)
108 ,m_aWarnings( Reference
< XWarningsSupplier
>( _xResultSet
, UNO_QUERY
) )
109 ,m_bIsBookmarkable(sal_False
)
111 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::OResultSet" );
112 DBG_CTOR(OResultSet
, NULL
);
114 m_pColumns
= new OColumns(*this, m_aMutex
, _bCaseSensitive
, ::std::vector
< ::rtl::OUString
>(), NULL
,NULL
);
118 m_aStatement
= _xStatement
;
119 m_xDelegatorResultSetUpdate
= m_xDelegatorResultSetUpdate
.query( m_xDelegatorResultSet
);
120 m_xDelegatorRow
= m_xDelegatorRow
.query( m_xDelegatorResultSet
);
121 m_xDelegatorRowUpdate
= m_xDelegatorRowUpdate
.query( m_xDelegatorResultSet
);
123 Reference
< XPropertySet
> xSet(m_xDelegatorResultSet
, UNO_QUERY
);
124 xSet
->getPropertyValue(PROPERTY_RESULTSETTYPE
) >>= m_nResultSetType
;
125 xSet
->getPropertyValue(PROPERTY_RESULTSETCONCURRENCY
) >>= m_nResultSetConcurrency
;
127 // test for Bookmarks
128 if (ResultSetType::FORWARD_ONLY
!= m_nResultSetType
)
130 Reference
<XPropertySetInfo
> xInfo(xSet
->getPropertySetInfo());
131 if (xInfo
->hasPropertyByName(PROPERTY_ISBOOKMARKABLE
))
133 m_bIsBookmarkable
= ::comphelper::getBOOL(xSet
->getPropertyValue(PROPERTY_ISBOOKMARKABLE
));
134 OSL_ENSURE( !m_bIsBookmarkable
|| Reference
< XRowLocate
>(m_xDelegatorResultSet
, UNO_QUERY
).is(),
135 "OResultSet::OResultSet: aggregate is inconsistent in it's bookmarkable attribute!" );
136 m_bIsBookmarkable
= m_bIsBookmarkable
&& Reference
< XRowLocate
>(m_xDelegatorResultSet
, UNO_QUERY
).is();
145 //--------------------------------------------------------------------------
146 OResultSet::~OResultSet()
148 m_pColumns
->acquire();
149 m_pColumns
->disposing();
152 DBG_DTOR(OResultSet
, NULL
);
155 // com::sun::star::lang::XTypeProvider
156 //--------------------------------------------------------------------------
157 Sequence
< Type
> OResultSet::getTypes() throw (RuntimeException
)
159 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getTypes" );
160 OTypeCollection
aTypes(::getCppuType( (const Reference
< XPropertySet
> *)0 ),
161 OResultSetBase::getTypes());
163 return aTypes
.getTypes();
166 //--------------------------------------------------------------------------
167 Sequence
< sal_Int8
> OResultSet::getImplementationId() throw (RuntimeException
)
169 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getImplementationId" );
170 static OImplementationId
* pId
= 0;
173 MutexGuard
aGuard( Mutex::getGlobalMutex() );
176 static OImplementationId aId
;
180 return pId
->getImplementationId();
183 // com::sun::star::uno::XInterface
184 //--------------------------------------------------------------------------
185 Any
OResultSet::queryInterface( const Type
& rType
) throw (RuntimeException
)
187 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::queryInterface" );
188 Any aIface
= OResultSetBase::queryInterface( rType
);
189 if (!aIface
.hasValue())
190 aIface
= ::cppu::queryInterface(
192 static_cast< XPropertySet
* >( this ));
197 //--------------------------------------------------------------------------
198 void OResultSet::acquire() throw ()
200 OResultSetBase::acquire();
203 //--------------------------------------------------------------------------
204 void OResultSet::release() throw ()
206 OResultSetBase::release();
211 //------------------------------------------------------------------------------
212 void OResultSet::disposing()
214 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::disposing" );
215 OPropertySetHelper::disposing();
217 MutexGuard
aGuard(m_aMutex
);
220 m_pColumns
->disposing();
222 // close the pending result set
223 Reference
< XCloseable
> (m_xDelegatorResultSet
, UNO_QUERY
)->close();
225 m_xDelegatorResultSet
= NULL
;
226 m_xDelegatorRow
= NULL
;
227 m_xDelegatorRowUpdate
= NULL
;
229 m_aStatement
= Reference
< XInterface
>();
233 //------------------------------------------------------------------------------
234 void OResultSet::close(void) throw( SQLException
, RuntimeException
)
236 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::close" );
238 MutexGuard
aGuard( m_aMutex
);
239 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
245 //------------------------------------------------------------------------------
246 rtl::OUString
OResultSet::getImplementationName( ) throw(RuntimeException
)
248 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getImplementationName" );
249 return rtl::OUString::createFromAscii("com.sun.star.sdb.OResultSet");
252 //------------------------------------------------------------------------------
253 sal_Bool
OResultSet::supportsService( const ::rtl::OUString
& _rServiceName
) throw (RuntimeException
)
255 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::supportsService" );
256 return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName
, sal_True
).getLength() != 0;
259 //------------------------------------------------------------------------------
260 Sequence
< ::rtl::OUString
> OResultSet::getSupportedServiceNames( ) throw (RuntimeException
)
262 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getSupportedServiceNames" );
263 Sequence
< ::rtl::OUString
> aSNS( 2 );
264 aSNS
[0] = SERVICE_SDBC_RESULTSET
;
265 aSNS
[1] = SERVICE_SDB_RESULTSET
;
269 // com::sun::star::beans::XPropertySet
270 //------------------------------------------------------------------------------
271 Reference
< XPropertySetInfo
> OResultSet::getPropertySetInfo() throw (RuntimeException
)
273 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getPropertySetInfo" );
274 return createPropertySetInfo( getInfoHelper() ) ;
277 // comphelper::OPropertyArrayUsageHelper
278 //------------------------------------------------------------------------------
279 ::cppu::IPropertyArrayHelper
* OResultSet::createArrayHelper( ) const
281 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::createArrayHelper" );
282 BEGIN_PROPERTY_HELPER(6)
283 DECL_PROP1(CURSORNAME
, ::rtl::OUString
, READONLY
);
284 DECL_PROP0(FETCHDIRECTION
, sal_Int32
);
285 DECL_PROP0(FETCHSIZE
, sal_Int32
);
286 DECL_PROP1_BOOL(ISBOOKMARKABLE
, READONLY
);
287 DECL_PROP1(RESULTSETCONCURRENCY
, sal_Int32
, READONLY
);
288 DECL_PROP1(RESULTSETTYPE
, sal_Int32
, READONLY
);
289 END_PROPERTY_HELPER();
292 // cppu::OPropertySetHelper
293 //------------------------------------------------------------------------------
294 ::cppu::IPropertyArrayHelper
& OResultSet::getInfoHelper()
296 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getInfoHelper" );
297 return *getArrayHelper();
300 //------------------------------------------------------------------------------
301 sal_Bool
OResultSet::convertFastPropertyValue(Any
& rConvertedValue
, Any
& rOldValue
, sal_Int32 nHandle
, const Any
& rValue
) throw( IllegalArgumentException
)
303 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::convertFastPropertyValue" );
305 rConvertedValue
= rValue
;
306 getFastPropertyValue( rOldValue
, nHandle
);
310 //------------------------------------------------------------------------------
311 void OResultSet::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle
, const Any
& rValue
) throw (Exception
)
313 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::setFastPropertyValue_NoBroadcast" );
314 // set it for the driver result set
315 Reference
< XPropertySet
> xSet(m_xDelegatorResultSet
, UNO_QUERY
);
318 case PROPERTY_ID_FETCHDIRECTION
:
319 xSet
->setPropertyValue(PROPERTY_FETCHDIRECTION
, rValue
);
321 case PROPERTY_ID_FETCHSIZE
:
322 xSet
->setPropertyValue(PROPERTY_FETCHSIZE
, rValue
);
325 DBG_ERROR("unknown Property");
329 //------------------------------------------------------------------------------
330 void OResultSet::getFastPropertyValue( Any
& rValue
, sal_Int32 nHandle
) const
332 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getFastPropertyValue" );
335 case PROPERTY_ID_ISBOOKMARKABLE
:
337 sal_Bool bVal
= m_bIsBookmarkable
;
338 rValue
.setValue(&bVal
, getBooleanCppuType());
342 // get the property name
343 ::rtl::OUString aPropName
;
344 sal_Int16 nAttributes
;
345 const_cast<OResultSet
*>(this)->getInfoHelper().
346 fillPropertyMembersByHandle(&aPropName
, &nAttributes
, nHandle
);
347 OSL_ENSURE(aPropName
.getLength(), "property not found?");
349 // now read the value
350 rValue
= Reference
< XPropertySet
>(m_xDelegatorResultSet
, UNO_QUERY
)->getPropertyValue(aPropName
);
356 //------------------------------------------------------------------------------
357 Any
OResultSet::getWarnings(void) throw( SQLException
, RuntimeException
)
359 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getWarnings" );
360 MutexGuard
aGuard(m_aMutex
);
361 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
362 return m_aWarnings
.getWarnings();
365 //------------------------------------------------------------------------------
366 void OResultSet::clearWarnings(void) throw( SQLException
, RuntimeException
)
368 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::clearWarnings" );
369 MutexGuard
aGuard(m_aMutex
);
370 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
371 m_aWarnings
.clearWarnings();
374 // ::com::sun::star::sdbc::XResultSetMetaDataSupplier
375 //------------------------------------------------------------------------------
376 Reference
< XResultSetMetaData
> OResultSet::getMetaData(void) throw( SQLException
, RuntimeException
)
378 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getMetaData" );
379 MutexGuard
aGuard(m_aMutex
);
380 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
382 return Reference
< XResultSetMetaDataSupplier
>(m_xDelegatorResultSet
, UNO_QUERY
)->getMetaData();
385 // ::com::sun::star::sdbc::XColumnLocate
386 //------------------------------------------------------------------------------
387 sal_Int32
OResultSet::findColumn(const rtl::OUString
& columnName
) throw( SQLException
, RuntimeException
)
389 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::findColumn" );
390 MutexGuard
aGuard(m_aMutex
);
391 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
393 return Reference
< XColumnLocate
>(m_xDelegatorResultSet
, UNO_QUERY
)->findColumn(columnName
);
396 //------------------------------------------------------------------------------
399 static Reference
< XDatabaseMetaData
> lcl_getDBMetaDataFromStatement_nothrow( const Reference
< XInterface
>& _rxStatement
)
401 Reference
< XDatabaseMetaData
> xDBMetaData
;
404 Reference
< XStatement
> xStatement( _rxStatement
, UNO_QUERY
);
405 Reference
< XPreparedStatement
> xPreparedStatement( _rxStatement
, UNO_QUERY
);
406 Reference
< XConnection
> xConn
;
407 if ( xStatement
.is() )
408 xConn
= xStatement
->getConnection();
409 else if ( xPreparedStatement
.is() )
410 xConn
= xPreparedStatement
->getConnection();
412 xDBMetaData
= xConn
->getMetaData();
414 catch( const Exception
& )
416 DBG_UNHANDLED_EXCEPTION();
421 // ::com::sun::star::sdbcx::XColumnsSupplier
422 //------------------------------------------------------------------------------
423 Reference
< ::com::sun::star::container::XNameAccess
> OResultSet::getColumns(void) throw( RuntimeException
)
425 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getColumns" );
426 MutexGuard
aGuard(m_aMutex
);
427 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
429 // do we have to populate the columns
430 if (!m_pColumns
->isInitialized())
433 Reference
< XResultSetMetaData
> xMetaData
= Reference
< XResultSetMetaDataSupplier
>(m_xDelegatorResultSet
, UNO_QUERY
)->getMetaData();
435 sal_Int32 nColCount
= 0;
436 // do we have columns
439 Reference
< XDatabaseMetaData
> xDBMetaData( lcl_getDBMetaDataFromStatement_nothrow( getStatement() ) );
440 nColCount
= xMetaData
->getColumnCount();
442 for ( sal_Int32 i
= 0; i
< nColCount
; ++i
)
444 // retrieve the name of the column
445 rtl::OUString sName
= xMetaData
->getColumnName(i
+ 1);
446 ODataColumn
* pColumn
= new ODataColumn(xMetaData
, m_xDelegatorRow
, m_xDelegatorRowUpdate
, i
+ 1, xDBMetaData
);
448 // don't silently assume that the name is unique - result set implementations
449 // are allowed to return duplicate names, but we are required to have
450 // unique column names
451 if ( m_pColumns
->hasByName( sName
) )
452 sName
= ::dbtools::createUniqueName( m_pColumns
, sName
);
454 m_pColumns
->append( sName
, pColumn
);
457 catch ( const SQLException
& )
459 DBG_UNHANDLED_EXCEPTION();
461 m_pColumns
->setInitialized();
463 #if OSL_DEBUG_LEVEL > 0
464 // some sanity checks. Especially in case we auto-adjusted the column names above,
465 // this might be reasonable
468 const Reference
< XNameAccess
> xColNames( static_cast< XNameAccess
* >( m_pColumns
), UNO_SET_THROW
);
469 const Sequence
< ::rtl::OUString
> aNames( xColNames
->getElementNames() );
470 OSL_POSTCOND( aNames
.getLength() == nColCount
,
471 "OResultSet::getColumns: invalid column count!" );
472 for ( const ::rtl::OUString
* pName
= aNames
.getConstArray();
473 pName
!= aNames
.getConstArray() + aNames
.getLength();
477 Reference
< XPropertySet
> xColProps( xColNames
->getByName( *pName
), UNO_QUERY_THROW
);
478 ::rtl::OUString sName
;
479 OSL_VERIFY( xColProps
->getPropertyValue( PROPERTY_NAME
) >>= sName
);
480 OSL_POSTCOND( sName
== *pName
, "OResultSet::getColumns: invalid column name!" );
484 catch( const Exception
& )
486 DBG_UNHANDLED_EXCEPTION();
493 // ::com::sun::star::sdbc::XRow
494 //------------------------------------------------------------------------------
495 sal_Bool
OResultSet::wasNull(void) throw( SQLException
, RuntimeException
)
497 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::wasNull" );
498 MutexGuard
aGuard(m_aMutex
);
499 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
501 return m_xDelegatorRow
->wasNull();
503 //------------------------------------------------------------------------------
504 rtl::OUString
OResultSet::getString(sal_Int32 columnIndex
) throw( SQLException
, RuntimeException
)
506 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getString" );
507 MutexGuard
aGuard(m_aMutex
);
508 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
510 return m_xDelegatorRow
->getString(columnIndex
);
512 //------------------------------------------------------------------------------
513 sal_Bool
OResultSet::getBoolean(sal_Int32 columnIndex
) throw( SQLException
, RuntimeException
)
515 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getBoolean" );
516 MutexGuard
aGuard(m_aMutex
);
517 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
519 return m_xDelegatorRow
->getBoolean(columnIndex
);
521 //------------------------------------------------------------------------------
522 sal_Int8
OResultSet::getByte(sal_Int32 columnIndex
) throw( SQLException
, RuntimeException
)
524 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getByte" );
525 MutexGuard
aGuard(m_aMutex
);
526 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
528 return m_xDelegatorRow
->getByte(columnIndex
);
530 //------------------------------------------------------------------------------
531 sal_Int16
OResultSet::getShort(sal_Int32 columnIndex
) throw( SQLException
, RuntimeException
)
533 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getShort" );
534 MutexGuard
aGuard(m_aMutex
);
535 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
537 return m_xDelegatorRow
->getShort(columnIndex
);
539 //------------------------------------------------------------------------------
540 sal_Int32
OResultSet::getInt(sal_Int32 columnIndex
) throw( SQLException
, RuntimeException
)
542 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getInt" );
543 MutexGuard
aGuard(m_aMutex
);
544 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
546 return m_xDelegatorRow
->getInt(columnIndex
);
548 //------------------------------------------------------------------------------
549 sal_Int64
OResultSet::getLong(sal_Int32 columnIndex
) throw( SQLException
, RuntimeException
)
551 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getLong" );
552 MutexGuard
aGuard(m_aMutex
);
553 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
555 return m_xDelegatorRow
->getLong(columnIndex
);
557 //------------------------------------------------------------------------------
558 float OResultSet::getFloat(sal_Int32 columnIndex
) throw( SQLException
, RuntimeException
)
560 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getFloat" );
561 MutexGuard
aGuard(m_aMutex
);
562 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
564 return m_xDelegatorRow
->getFloat(columnIndex
);
566 //------------------------------------------------------------------------------
567 double OResultSet::getDouble(sal_Int32 columnIndex
) throw( SQLException
, RuntimeException
)
569 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getDouble" );
570 MutexGuard
aGuard(m_aMutex
);
571 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
573 return m_xDelegatorRow
->getDouble(columnIndex
);
575 //------------------------------------------------------------------------------
576 Sequence
< sal_Int8
> OResultSet::getBytes(sal_Int32 columnIndex
) throw( SQLException
, RuntimeException
)
578 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getBytes" );
579 MutexGuard
aGuard(m_aMutex
);
580 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
582 return m_xDelegatorRow
->getBytes(columnIndex
);
584 //------------------------------------------------------------------------------
585 ::com::sun::star::util::Date
OResultSet::getDate(sal_Int32 columnIndex
) throw( SQLException
, RuntimeException
)
587 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getDate" );
588 MutexGuard
aGuard(m_aMutex
);
589 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
591 return m_xDelegatorRow
->getDate(columnIndex
);
593 //------------------------------------------------------------------------------
594 ::com::sun::star::util::Time
OResultSet::getTime(sal_Int32 columnIndex
) throw( SQLException
, RuntimeException
)
596 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getTime" );
597 MutexGuard
aGuard(m_aMutex
);
598 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
600 return m_xDelegatorRow
->getTime(columnIndex
);
602 //------------------------------------------------------------------------------
603 ::com::sun::star::util::DateTime
OResultSet::getTimestamp(sal_Int32 columnIndex
) throw( SQLException
, RuntimeException
)
605 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getTimestamp" );
606 MutexGuard
aGuard(m_aMutex
);
607 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
609 return m_xDelegatorRow
->getTimestamp(columnIndex
);
611 //------------------------------------------------------------------------------
612 Reference
< ::com::sun::star::io::XInputStream
> OResultSet::getBinaryStream(sal_Int32 columnIndex
) throw( SQLException
, RuntimeException
)
614 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getBinaryStream" );
615 MutexGuard
aGuard(m_aMutex
);
616 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
618 return m_xDelegatorRow
->getBinaryStream(columnIndex
);
620 //------------------------------------------------------------------------------
621 Reference
< ::com::sun::star::io::XInputStream
> OResultSet::getCharacterStream(sal_Int32 columnIndex
) throw( SQLException
, RuntimeException
)
623 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getCharacterStream" );
624 MutexGuard
aGuard(m_aMutex
);
625 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
627 return m_xDelegatorRow
->getCharacterStream(columnIndex
);
629 //------------------------------------------------------------------------------
630 Any
OResultSet::getObject(sal_Int32 columnIndex
, const Reference
< ::com::sun::star::container::XNameAccess
> & typeMap
) throw( SQLException
, RuntimeException
)
632 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getObject" );
633 MutexGuard
aGuard(m_aMutex
);
634 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
636 return m_xDelegatorRow
->getObject(columnIndex
, typeMap
);
638 //------------------------------------------------------------------------------
639 Reference
< XRef
> OResultSet::getRef(sal_Int32 columnIndex
) throw( SQLException
, RuntimeException
)
641 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getRef" );
642 MutexGuard
aGuard(m_aMutex
);
643 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
645 return m_xDelegatorRow
->getRef(columnIndex
);
647 //------------------------------------------------------------------------------
648 Reference
< XBlob
> OResultSet::getBlob(sal_Int32 columnIndex
) throw( SQLException
, RuntimeException
)
650 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getBlob" );
651 MutexGuard
aGuard(m_aMutex
);
652 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
654 return m_xDelegatorRow
->getBlob(columnIndex
);
656 //------------------------------------------------------------------------------
657 Reference
< XClob
> OResultSet::getClob(sal_Int32 columnIndex
) throw( SQLException
, RuntimeException
)
659 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getClob" );
660 MutexGuard
aGuard(m_aMutex
);
661 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
663 return m_xDelegatorRow
->getClob(columnIndex
);
665 //------------------------------------------------------------------------------
666 Reference
< XArray
> OResultSet::getArray(sal_Int32 columnIndex
) throw( SQLException
, RuntimeException
)
668 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getArray" );
669 MutexGuard
aGuard(m_aMutex
);
670 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
672 return m_xDelegatorRow
->getArray(columnIndex
);
675 // ::com::sun::star::sdbc::XRowUpdate
676 //------------------------------------------------------------------------------
677 void OResultSet::updateNull(sal_Int32 columnIndex
) throw( SQLException
, RuntimeException
)
679 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateNull" );
680 MutexGuard
aGuard(m_aMutex
);
681 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
685 m_xDelegatorRowUpdate
->updateNull(columnIndex
);
688 //------------------------------------------------------------------------------
689 void OResultSet::updateBoolean(sal_Int32 columnIndex
, sal_Bool x
) throw( SQLException
, RuntimeException
)
691 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateBoolean" );
692 MutexGuard
aGuard(m_aMutex
);
693 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
697 m_xDelegatorRowUpdate
->updateBoolean(columnIndex
, x
);
699 //------------------------------------------------------------------------------
700 void OResultSet::updateByte(sal_Int32 columnIndex
, sal_Int8 x
) throw( SQLException
, RuntimeException
)
702 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateByte" );
703 MutexGuard
aGuard(m_aMutex
);
704 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
708 m_xDelegatorRowUpdate
->updateByte(columnIndex
, x
);
710 //------------------------------------------------------------------------------
711 void OResultSet::updateShort(sal_Int32 columnIndex
, sal_Int16 x
) throw( SQLException
, RuntimeException
)
713 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateShort" );
714 MutexGuard
aGuard(m_aMutex
);
715 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
719 m_xDelegatorRowUpdate
->updateShort(columnIndex
, x
);
721 //------------------------------------------------------------------------------
722 void OResultSet::updateInt(sal_Int32 columnIndex
, sal_Int32 x
) throw( SQLException
, RuntimeException
)
724 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateInt" );
725 MutexGuard
aGuard(m_aMutex
);
726 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
730 m_xDelegatorRowUpdate
->updateInt(columnIndex
, x
);
732 //------------------------------------------------------------------------------
733 void OResultSet::updateLong(sal_Int32 columnIndex
, sal_Int64 x
) throw( SQLException
, RuntimeException
)
735 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateLong" );
736 MutexGuard
aGuard(m_aMutex
);
737 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
741 m_xDelegatorRowUpdate
->updateLong(columnIndex
, x
);
743 //------------------------------------------------------------------------------
744 void OResultSet::updateFloat(sal_Int32 columnIndex
, float x
) throw( SQLException
, RuntimeException
)
746 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateFloat" );
747 MutexGuard
aGuard(m_aMutex
);
748 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
752 m_xDelegatorRowUpdate
->updateFloat(columnIndex
, x
);
754 //------------------------------------------------------------------------------
755 void OResultSet::updateDouble(sal_Int32 columnIndex
, double x
) throw( SQLException
, RuntimeException
)
757 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateDouble" );
758 MutexGuard
aGuard(m_aMutex
);
759 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
763 m_xDelegatorRowUpdate
->updateDouble(columnIndex
, x
);
765 //------------------------------------------------------------------------------
766 void OResultSet::updateString(sal_Int32 columnIndex
, const rtl::OUString
& x
) throw( SQLException
, RuntimeException
)
768 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateString" );
769 MutexGuard
aGuard(m_aMutex
);
770 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
774 m_xDelegatorRowUpdate
->updateString(columnIndex
, x
);
776 //------------------------------------------------------------------------------
777 void OResultSet::updateBytes(sal_Int32 columnIndex
, const Sequence
< sal_Int8
>& x
) throw( SQLException
, RuntimeException
)
779 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateBytes" );
780 MutexGuard
aGuard(m_aMutex
);
781 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
785 m_xDelegatorRowUpdate
->updateBytes(columnIndex
, x
);
787 //------------------------------------------------------------------------------
788 void OResultSet::updateDate(sal_Int32 columnIndex
, const ::com::sun::star::util::Date
& x
) throw( SQLException
, RuntimeException
)
790 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateDate" );
791 MutexGuard
aGuard(m_aMutex
);
792 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
796 m_xDelegatorRowUpdate
->updateDate(columnIndex
, x
);
798 //------------------------------------------------------------------------------
799 void OResultSet::updateTime(sal_Int32 columnIndex
, const ::com::sun::star::util::Time
& x
) throw( SQLException
, RuntimeException
)
801 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateTime" );
802 MutexGuard
aGuard(m_aMutex
);
803 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
807 m_xDelegatorRowUpdate
->updateTime(columnIndex
, x
);
809 //------------------------------------------------------------------------------
810 void OResultSet::updateTimestamp(sal_Int32 columnIndex
, const ::com::sun::star::util::DateTime
& x
) throw( SQLException
, RuntimeException
)
812 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateTimestamp" );
813 MutexGuard
aGuard(m_aMutex
);
814 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
818 m_xDelegatorRowUpdate
->updateTimestamp(columnIndex
, x
);
820 //------------------------------------------------------------------------------
821 void OResultSet::updateBinaryStream(sal_Int32 columnIndex
, const Reference
< ::com::sun::star::io::XInputStream
> & x
, sal_Int32 length
) throw( SQLException
, RuntimeException
)
823 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateBinaryStream" );
824 MutexGuard
aGuard(m_aMutex
);
825 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
829 m_xDelegatorRowUpdate
->updateBinaryStream(columnIndex
, x
, length
);
831 //------------------------------------------------------------------------------
832 void OResultSet::updateCharacterStream(sal_Int32 columnIndex
, const Reference
< ::com::sun::star::io::XInputStream
> & x
, sal_Int32 length
) throw( SQLException
, RuntimeException
)
834 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateCharacterStream" );
835 MutexGuard
aGuard(m_aMutex
);
836 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
840 m_xDelegatorRowUpdate
->updateCharacterStream(columnIndex
, x
, length
);
842 //------------------------------------------------------------------------------
843 void OResultSet::updateNumericObject(sal_Int32 columnIndex
, const Any
& x
, sal_Int32 scale
) throw( SQLException
, RuntimeException
)
845 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateNumericObject" );
846 MutexGuard
aGuard(m_aMutex
);
847 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
851 m_xDelegatorRowUpdate
->updateNumericObject(columnIndex
, x
, scale
);
854 //------------------------------------------------------------------------------
855 void OResultSet::updateObject(sal_Int32 columnIndex
, const Any
& x
) throw( SQLException
, RuntimeException
)
857 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateObject" );
858 MutexGuard
aGuard(m_aMutex
);
859 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
863 m_xDelegatorRowUpdate
->updateObject(columnIndex
, x
);
866 // ::com::sun::star::sdbc::XResultSet
867 //------------------------------------------------------------------------------
868 sal_Bool
OResultSet::next(void) throw( SQLException
, RuntimeException
)
870 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::next" );
871 MutexGuard
aGuard(m_aMutex
);
872 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
874 return m_xDelegatorResultSet
->next();
877 //------------------------------------------------------------------------------
878 sal_Bool
OResultSet::isBeforeFirst(void) throw( SQLException
, RuntimeException
)
880 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::isBeforeFirst" );
881 MutexGuard
aGuard(m_aMutex
);
882 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
884 return m_xDelegatorResultSet
->isBeforeFirst();
887 //------------------------------------------------------------------------------
888 sal_Bool
OResultSet::isAfterLast(void) throw( SQLException
, RuntimeException
)
890 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::isAfterLast" );
891 MutexGuard
aGuard(m_aMutex
);
892 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
894 return m_xDelegatorResultSet
->isAfterLast();
897 //------------------------------------------------------------------------------
898 sal_Bool
OResultSet::isFirst(void) throw( SQLException
, RuntimeException
)
900 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::isFirst" );
901 MutexGuard
aGuard(m_aMutex
);
902 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
904 return m_xDelegatorResultSet
->isFirst();
907 //------------------------------------------------------------------------------
908 sal_Bool
OResultSet::isLast(void) throw( SQLException
, RuntimeException
)
910 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::isLast" );
911 MutexGuard
aGuard(m_aMutex
);
912 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
914 return m_xDelegatorResultSet
->isLast();
917 //------------------------------------------------------------------------------
918 void OResultSet::beforeFirst(void) throw( SQLException
, RuntimeException
)
920 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::beforeFirst" );
921 MutexGuard
aGuard(m_aMutex
);
922 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
924 m_xDelegatorResultSet
->beforeFirst();
927 //------------------------------------------------------------------------------
928 void OResultSet::afterLast(void) throw( SQLException
, RuntimeException
)
930 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::afterLast" );
931 MutexGuard
aGuard(m_aMutex
);
932 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
934 m_xDelegatorResultSet
->afterLast();
937 //------------------------------------------------------------------------------
938 sal_Bool
OResultSet::first(void) throw( SQLException
, RuntimeException
)
940 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::first" );
941 MutexGuard
aGuard(m_aMutex
);
942 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
944 return m_xDelegatorResultSet
->first();
947 //------------------------------------------------------------------------------
948 sal_Bool
OResultSet::last(void) throw( SQLException
, RuntimeException
)
950 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::last" );
951 MutexGuard
aGuard(m_aMutex
);
952 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
954 return m_xDelegatorResultSet
->last();
957 //------------------------------------------------------------------------------
958 sal_Int32
OResultSet::getRow(void) throw( SQLException
, RuntimeException
)
960 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getRow" );
961 MutexGuard
aGuard(m_aMutex
);
962 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
964 return m_xDelegatorResultSet
->getRow();
967 //------------------------------------------------------------------------------
968 sal_Bool
OResultSet::absolute(sal_Int32 row
) throw( SQLException
, RuntimeException
)
970 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::absolute" );
971 MutexGuard
aGuard(m_aMutex
);
972 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
974 return m_xDelegatorResultSet
->absolute(row
);
977 //------------------------------------------------------------------------------
978 sal_Bool
OResultSet::relative(sal_Int32 rows
) throw( SQLException
, RuntimeException
)
980 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::relative" );
981 MutexGuard
aGuard(m_aMutex
);
982 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
984 return m_xDelegatorResultSet
->relative(rows
);
987 //------------------------------------------------------------------------------
988 sal_Bool
OResultSet::previous(void) throw( SQLException
, RuntimeException
)
990 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::previous" );
991 MutexGuard
aGuard(m_aMutex
);
992 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
994 return m_xDelegatorResultSet
->previous();
997 //------------------------------------------------------------------------------
998 void OResultSet::refreshRow(void) throw( SQLException
, RuntimeException
)
1000 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::refreshRow" );
1001 MutexGuard
aGuard(m_aMutex
);
1002 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
1004 m_xDelegatorResultSet
->refreshRow();
1007 //------------------------------------------------------------------------------
1008 sal_Bool
OResultSet::rowUpdated(void) throw( SQLException
, RuntimeException
)
1010 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::rowUpdated" );
1011 MutexGuard
aGuard(m_aMutex
);
1012 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
1014 return m_xDelegatorResultSet
->rowUpdated();
1017 //------------------------------------------------------------------------------
1018 sal_Bool
OResultSet::rowInserted(void) throw( SQLException
, RuntimeException
)
1020 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::rowInserted" );
1021 MutexGuard
aGuard(m_aMutex
);
1022 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
1024 return m_xDelegatorResultSet
->rowInserted();
1027 //------------------------------------------------------------------------------
1028 sal_Bool
OResultSet::rowDeleted(void) throw( SQLException
, RuntimeException
)
1030 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::rowDeleted" );
1031 MutexGuard
aGuard(m_aMutex
);
1032 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
1034 return m_xDelegatorResultSet
->rowDeleted();
1037 //------------------------------------------------------------------------------
1038 Reference
< XInterface
> OResultSet::getStatement(void) throw( SQLException
, RuntimeException
)
1040 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getStatement" );
1041 MutexGuard
aGuard(m_aMutex
);
1042 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
1044 return m_aStatement
;
1047 // ::com::sun::star::sdbcx::XRowLocate
1048 //------------------------------------------------------------------------------
1049 Any
OResultSet::getBookmark(void) throw( SQLException
, RuntimeException
)
1051 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::getBookmark" );
1052 MutexGuard
aGuard(m_aMutex
);
1053 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
1055 checkBookmarkable();
1057 return Reference
< XRowLocate
>(m_xDelegatorResultSet
, UNO_QUERY
)->getBookmark();
1060 //------------------------------------------------------------------------------
1061 sal_Bool
OResultSet::moveToBookmark(const Any
& bookmark
) throw( SQLException
, RuntimeException
)
1063 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::moveToBookmark" );
1064 MutexGuard
aGuard(m_aMutex
);
1065 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
1067 checkBookmarkable();
1069 return Reference
< XRowLocate
>(m_xDelegatorResultSet
, UNO_QUERY
)->moveToBookmark(bookmark
);
1072 //------------------------------------------------------------------------------
1073 sal_Bool
OResultSet::moveRelativeToBookmark(const Any
& bookmark
, sal_Int32 rows
) throw( SQLException
, RuntimeException
)
1075 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::moveRelativeToBookmark" );
1076 MutexGuard
aGuard(m_aMutex
);
1077 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
1079 checkBookmarkable();
1081 return Reference
< XRowLocate
>(m_xDelegatorResultSet
, UNO_QUERY
)->moveRelativeToBookmark(bookmark
, rows
);
1084 //------------------------------------------------------------------------------
1085 sal_Int32
OResultSet::compareBookmarks(const Any
& _first
, const Any
& _second
) throw( SQLException
, RuntimeException
)
1087 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::compareBookmarks" );
1088 MutexGuard
aGuard(m_aMutex
);
1089 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
1091 checkBookmarkable();
1093 return Reference
< XRowLocate
>(m_xDelegatorResultSet
, UNO_QUERY
)->compareBookmarks(_first
, _second
);
1096 //------------------------------------------------------------------------------
1097 sal_Bool
OResultSet::hasOrderedBookmarks(void) throw( SQLException
, RuntimeException
)
1099 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::hasOrderedBookmarks" );
1100 MutexGuard
aGuard(m_aMutex
);
1101 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
1103 checkBookmarkable();
1105 return Reference
< XRowLocate
>(m_xDelegatorResultSet
, UNO_QUERY
)->hasOrderedBookmarks();
1108 //------------------------------------------------------------------------------
1109 sal_Int32
OResultSet::hashBookmark(const Any
& bookmark
) throw( SQLException
, RuntimeException
)
1111 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::hashBookmark" );
1112 MutexGuard
aGuard(m_aMutex
);
1113 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
1115 checkBookmarkable();
1117 return Reference
< XRowLocate
>(m_xDelegatorResultSet
, UNO_QUERY
)->hashBookmark(bookmark
);
1120 // ::com::sun::star::sdbc::XResultSetUpdate
1121 //------------------------------------------------------------------------------
1122 void OResultSet::insertRow(void) throw( SQLException
, RuntimeException
)
1124 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::insertRow" );
1125 MutexGuard
aGuard(m_aMutex
);
1126 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
1130 m_xDelegatorResultSetUpdate
->insertRow();
1133 //------------------------------------------------------------------------------
1134 void OResultSet::updateRow(void) throw( SQLException
, RuntimeException
)
1136 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::updateRow" );
1137 MutexGuard
aGuard(m_aMutex
);
1138 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
1142 m_xDelegatorResultSetUpdate
->updateRow();
1145 //------------------------------------------------------------------------------
1146 void OResultSet::deleteRow(void) throw( SQLException
, RuntimeException
)
1148 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::deleteRow" );
1149 MutexGuard
aGuard(m_aMutex
);
1150 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
1154 m_xDelegatorResultSetUpdate
->deleteRow();
1157 //------------------------------------------------------------------------------
1158 void OResultSet::cancelRowUpdates(void) throw( SQLException
, RuntimeException
)
1160 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::cancelRowUpdates" );
1161 MutexGuard
aGuard(m_aMutex
);
1162 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
1166 m_xDelegatorResultSetUpdate
->cancelRowUpdates();
1169 //------------------------------------------------------------------------------
1170 void OResultSet::moveToInsertRow(void) throw( SQLException
, RuntimeException
)
1172 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::moveToInsertRow" );
1173 MutexGuard
aGuard(m_aMutex
);
1174 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
1178 m_xDelegatorResultSetUpdate
->moveToInsertRow();
1181 //------------------------------------------------------------------------------
1182 void OResultSet::moveToCurrentRow(void) throw( SQLException
, RuntimeException
)
1184 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::moveToCurrentRow" );
1185 MutexGuard
aGuard(m_aMutex
);
1186 ::connectivity::checkDisposed(OResultSetBase::rBHelper
.bDisposed
);
1190 m_xDelegatorResultSetUpdate
->moveToCurrentRow();
1193 // -----------------------------------------------------------------------------
1194 void OResultSet::checkReadOnly() const
1196 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::checkReadOnly" );
1197 if ( ( m_nResultSetConcurrency
== ResultSetConcurrency::READ_ONLY
)
1198 || !m_xDelegatorResultSetUpdate
.is()
1200 throwSQLException( "The result set is read-only.", SQL_GENERAL_ERROR
, *const_cast< OResultSet
* >( this ) );
1203 // -----------------------------------------------------------------------------
1204 void OResultSet::checkBookmarkable() const
1206 //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OResultSet::checkBookmarkable" );
1207 if ( !m_bIsBookmarkable
)
1208 throwSQLException( "The result set does not have bookmark support.", SQL_GENERAL_ERROR
, *const_cast< OResultSet
* >( this ) );
1210 // -----------------------------------------------------------------------------