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