xref: /AOO41X/main/connectivity/source/drivers/macab/MacabResultSet.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_connectivity.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include "MacabResultSet.hxx"
32*cdf0e10cSrcweir #include "MacabAddressBook.hxx"
33*cdf0e10cSrcweir #include "MacabRecords.hxx"
34*cdf0e10cSrcweir #include "macabutilities.hxx"
35*cdf0e10cSrcweir #include "MacabResultSetMetaData.hxx"
36*cdf0e10cSrcweir #include "MacabConnection.hxx"
37*cdf0e10cSrcweir #include "macabcondition.hxx"
38*cdf0e10cSrcweir #include "macaborder.hxx"
39*cdf0e10cSrcweir #include <com/sun/star/beans/PropertyAttribute.hpp>
40*cdf0e10cSrcweir #include <com/sun/star/sdbcx/CompareBookmark.hpp>
41*cdf0e10cSrcweir #include "TConnection.hxx"
42*cdf0e10cSrcweir #include <connectivity/dbexception.hxx>
43*cdf0e10cSrcweir #include "resource/sharedresources.hxx"
44*cdf0e10cSrcweir #include "resource/macab_res.hrc"
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir using namespace connectivity::macab;
47*cdf0e10cSrcweir using namespace cppu;
48*cdf0e10cSrcweir using namespace com::sun::star::uno;
49*cdf0e10cSrcweir using namespace com::sun::star::lang;
50*cdf0e10cSrcweir using namespace com::sun::star::beans;
51*cdf0e10cSrcweir using namespace com::sun::star::sdbc;
52*cdf0e10cSrcweir using namespace com::sun::star::sdbcx;
53*cdf0e10cSrcweir using namespace com::sun::star::io;
54*cdf0e10cSrcweir using namespace com::sun::star::util;
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir IMPLEMENT_SERVICE_INFO(MacabResultSet, "com.sun.star.sdbc.drivers.MacabResultSet", "com.sun.star.sdbc.ResultSet");
57*cdf0e10cSrcweir // -------------------------------------------------------------------------
58*cdf0e10cSrcweir MacabResultSet::MacabResultSet(MacabCommonStatement* pStmt)
59*cdf0e10cSrcweir 	: MacabResultSet_BASE(m_aMutex),
60*cdf0e10cSrcweir 	  OPropertySetHelper(MacabResultSet_BASE::rBHelper),
61*cdf0e10cSrcweir 	  m_xStatement(pStmt),
62*cdf0e10cSrcweir 	  m_xMetaData(NULL),
63*cdf0e10cSrcweir 	  m_aMacabRecords(),
64*cdf0e10cSrcweir 	  m_nRowPos(-1),
65*cdf0e10cSrcweir 	  m_bWasNull(sal_True)
66*cdf0e10cSrcweir {
67*cdf0e10cSrcweir 	m_sTableName = MacabAddressBook::getDefaultTableName();
68*cdf0e10cSrcweir }
69*cdf0e10cSrcweir // -------------------------------------------------------------------------
70*cdf0e10cSrcweir MacabResultSet::~MacabResultSet()
71*cdf0e10cSrcweir {
72*cdf0e10cSrcweir }
73*cdf0e10cSrcweir // -------------------------------------------------------------------------
74*cdf0e10cSrcweir void MacabResultSet::allMacabRecords()
75*cdf0e10cSrcweir {
76*cdf0e10cSrcweir 	MacabConnection* pConnection = static_cast< MacabConnection *>(m_xStatement->getConnection().get());
77*cdf0e10cSrcweir 
78*cdf0e10cSrcweir 	m_aMacabRecords = pConnection->getAddressBook()->getMacabRecords(m_sTableName);
79*cdf0e10cSrcweir }
80*cdf0e10cSrcweir // -------------------------------------------------------------------------
81*cdf0e10cSrcweir void MacabResultSet::someMacabRecords(const MacabCondition *pCondition)
82*cdf0e10cSrcweir {
83*cdf0e10cSrcweir 	MacabConnection* pConnection = static_cast< MacabConnection *>(m_xStatement->getConnection().get());
84*cdf0e10cSrcweir 	MacabRecords* allRecords;
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir 	allRecords = pConnection->getAddressBook()->getMacabRecords(m_sTableName);
87*cdf0e10cSrcweir 
88*cdf0e10cSrcweir 	// Bad table!! Throw exception?
89*cdf0e10cSrcweir 	if(allRecords == NULL)
90*cdf0e10cSrcweir 		return;
91*cdf0e10cSrcweir 
92*cdf0e10cSrcweir 	if(m_aMacabRecords != NULL && m_aMacabRecords != allRecords)
93*cdf0e10cSrcweir 		delete m_aMacabRecords;
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir 	// The copy constructor copies everything but records (including the
96*cdf0e10cSrcweir 	// maximum alloted size, which means that we'll never have to resize)
97*cdf0e10cSrcweir 	m_aMacabRecords = new MacabRecords(allRecords);
98*cdf0e10cSrcweir 
99*cdf0e10cSrcweir 	MacabRecords::iterator iterator;
100*cdf0e10cSrcweir 
101*cdf0e10cSrcweir 	for (iterator = allRecords->begin();
102*cdf0e10cSrcweir 	     iterator != allRecords->end();
103*cdf0e10cSrcweir 	     ++iterator)
104*cdf0e10cSrcweir 	{
105*cdf0e10cSrcweir 		if (pCondition->eval(*iterator))
106*cdf0e10cSrcweir 			m_aMacabRecords->insertRecord(*iterator);
107*cdf0e10cSrcweir 	}
108*cdf0e10cSrcweir }
109*cdf0e10cSrcweir // -------------------------------------------------------------------------
110*cdf0e10cSrcweir void MacabResultSet::sortMacabRecords(const MacabOrder *pOrder)
111*cdf0e10cSrcweir {
112*cdf0e10cSrcweir 	// I do this with ints rather than an iterator because the ids will
113*cdf0e10cSrcweir 	// be changing when we change the order and ints are easier to deal
114*cdf0e10cSrcweir 	// with (for me).
115*cdf0e10cSrcweir 	sal_Int32 i, j, size, smallest;
116*cdf0e10cSrcweir 	size = m_aMacabRecords->size();
117*cdf0e10cSrcweir 
118*cdf0e10cSrcweir 	for(i = 0; i < size; i++)
119*cdf0e10cSrcweir 	{
120*cdf0e10cSrcweir 		smallest = i;
121*cdf0e10cSrcweir 		for( j = i + 1; j < size; j++)
122*cdf0e10cSrcweir 		{
123*cdf0e10cSrcweir 			// if smallest > j
124*cdf0e10cSrcweir 			if(pOrder->compare(m_aMacabRecords->getRecord(smallest),
125*cdf0e10cSrcweir 						m_aMacabRecords->getRecord(j) ) > 0)
126*cdf0e10cSrcweir 			{
127*cdf0e10cSrcweir 				smallest = j;
128*cdf0e10cSrcweir 			}
129*cdf0e10cSrcweir 
130*cdf0e10cSrcweir 		}
131*cdf0e10cSrcweir 
132*cdf0e10cSrcweir 		if(smallest != i)
133*cdf0e10cSrcweir 		{
134*cdf0e10cSrcweir 			m_aMacabRecords->swap(i,smallest);
135*cdf0e10cSrcweir 		}
136*cdf0e10cSrcweir 	}
137*cdf0e10cSrcweir 
138*cdf0e10cSrcweir }
139*cdf0e10cSrcweir // -------------------------------------------------------------------------
140*cdf0e10cSrcweir void MacabResultSet::setTableName(::rtl::OUString _sTableName)
141*cdf0e10cSrcweir {
142*cdf0e10cSrcweir 	m_sTableName = _sTableName;
143*cdf0e10cSrcweir }
144*cdf0e10cSrcweir // -------------------------------------------------------------------------
145*cdf0e10cSrcweir void MacabResultSet::disposing()
146*cdf0e10cSrcweir {
147*cdf0e10cSrcweir 	OPropertySetHelper::disposing();
148*cdf0e10cSrcweir 
149*cdf0e10cSrcweir 	::osl::MutexGuard aGuard(m_aMutex);
150*cdf0e10cSrcweir 
151*cdf0e10cSrcweir m_xStatement.clear();
152*cdf0e10cSrcweir m_xMetaData.clear();
153*cdf0e10cSrcweir }
154*cdf0e10cSrcweir // -------------------------------------------------------------------------
155*cdf0e10cSrcweir Any SAL_CALL MacabResultSet::queryInterface(const Type & rType) throw(RuntimeException)
156*cdf0e10cSrcweir {
157*cdf0e10cSrcweir 	Any aRet = OPropertySetHelper::queryInterface(rType);
158*cdf0e10cSrcweir 	if (!aRet.hasValue())
159*cdf0e10cSrcweir 		aRet = MacabResultSet_BASE::queryInterface(rType);
160*cdf0e10cSrcweir 	return aRet;
161*cdf0e10cSrcweir }
162*cdf0e10cSrcweir // -------------------------------------------------------------------------
163*cdf0e10cSrcweir void SAL_CALL MacabResultSet::acquire() throw()
164*cdf0e10cSrcweir {
165*cdf0e10cSrcweir 	MacabResultSet_BASE::acquire();
166*cdf0e10cSrcweir }
167*cdf0e10cSrcweir // -------------------------------------------------------------------------
168*cdf0e10cSrcweir void SAL_CALL MacabResultSet::release() throw()
169*cdf0e10cSrcweir {
170*cdf0e10cSrcweir 	MacabResultSet_BASE::release();
171*cdf0e10cSrcweir }
172*cdf0e10cSrcweir // -------------------------------------------------------------------------
173*cdf0e10cSrcweir Sequence<  Type > SAL_CALL MacabResultSet::getTypes() throw(RuntimeException)
174*cdf0e10cSrcweir {
175*cdf0e10cSrcweir 	OTypeCollection aTypes(
176*cdf0e10cSrcweir 		::getCppuType( (const Reference< ::com::sun::star::beans::XMultiPropertySet >*) 0),
177*cdf0e10cSrcweir 		::getCppuType( (const Reference< ::com::sun::star::beans::XFastPropertySet >*) 0),
178*cdf0e10cSrcweir 		::getCppuType( (const Reference< ::com::sun::star::beans::XPropertySet >*) 0));
179*cdf0e10cSrcweir 
180*cdf0e10cSrcweir 	return comphelper::concatSequences(aTypes.getTypes(), MacabResultSet_BASE::getTypes());
181*cdf0e10cSrcweir }
182*cdf0e10cSrcweir // -------------------------------------------------------------------------
183*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL MacabResultSet::getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException)
184*cdf0e10cSrcweir {
185*cdf0e10cSrcweir 	return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
186*cdf0e10cSrcweir }
187*cdf0e10cSrcweir // -------------------------------------------------------------------------
188*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabResultSet::findColumn(const ::rtl::OUString& columnName) throw(SQLException, RuntimeException)
189*cdf0e10cSrcweir {
190*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
191*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
192*cdf0e10cSrcweir 
193*cdf0e10cSrcweir 	// find the first column with the name columnName
194*cdf0e10cSrcweir 	Reference< XResultSetMetaData > xMeta = getMetaData();
195*cdf0e10cSrcweir 	sal_Int32 nLen = xMeta->getColumnCount();
196*cdf0e10cSrcweir 
197*cdf0e10cSrcweir 	for (sal_Int32 i = 1; i <= nLen; ++i)
198*cdf0e10cSrcweir 		if (xMeta->isCaseSensitive(i) ?
199*cdf0e10cSrcweir 			columnName == xMeta->getColumnName(i) :
200*cdf0e10cSrcweir 			columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
201*cdf0e10cSrcweir 				return i;
202*cdf0e10cSrcweir 
203*cdf0e10cSrcweir     ::connectivity::SharedResources aResources;
204*cdf0e10cSrcweir     const ::rtl::OUString sError( aResources.getResourceStringWithSubstitution(
205*cdf0e10cSrcweir             STR_NO_ELEMENT_NAME,
206*cdf0e10cSrcweir             "$name$", columnName
207*cdf0e10cSrcweir          ) );
208*cdf0e10cSrcweir 	::dbtools::throwGenericSQLException(sError , *this);
209*cdf0e10cSrcweir     // Unreachable:
210*cdf0e10cSrcweir     OSL_ASSERT(false);
211*cdf0e10cSrcweir     return 0;
212*cdf0e10cSrcweir }
213*cdf0e10cSrcweir // -------------------------------------------------------------------------
214*cdf0e10cSrcweir ::rtl::OUString SAL_CALL MacabResultSet::getString(sal_Int32 columnIndex) throw(SQLException, RuntimeException)
215*cdf0e10cSrcweir {
216*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
217*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
218*cdf0e10cSrcweir 
219*cdf0e10cSrcweir 	::rtl::OUString aRet;
220*cdf0e10cSrcweir 	sal_Int32 nRecords = m_aMacabRecords->size();
221*cdf0e10cSrcweir 	m_bWasNull = true;
222*cdf0e10cSrcweir 
223*cdf0e10cSrcweir 	if (m_nRowPos != -1 && m_nRowPos != nRecords && m_xMetaData.is())
224*cdf0e10cSrcweir 	{
225*cdf0e10cSrcweir 		sal_Int32 nFieldNumber = m_xMetaData->fieldAtColumn(columnIndex);
226*cdf0e10cSrcweir 		macabfield *aField = m_aMacabRecords->getField(m_nRowPos,nFieldNumber);
227*cdf0e10cSrcweir 		if(aField != NULL)
228*cdf0e10cSrcweir 		{
229*cdf0e10cSrcweir 			if(aField->type == kABStringProperty)
230*cdf0e10cSrcweir 			{
231*cdf0e10cSrcweir 				aRet = CFStringToOUString( (CFStringRef) aField->value);
232*cdf0e10cSrcweir 				m_bWasNull = false;
233*cdf0e10cSrcweir 			}
234*cdf0e10cSrcweir 		}
235*cdf0e10cSrcweir 	}
236*cdf0e10cSrcweir 
237*cdf0e10cSrcweir // Trigger an exception if m_bWasNull is true?
238*cdf0e10cSrcweir 	return aRet;
239*cdf0e10cSrcweir }
240*cdf0e10cSrcweir // -------------------------------------------------------------------------
241*cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::getBoolean(sal_Int32) throw(SQLException, RuntimeException)
242*cdf0e10cSrcweir {
243*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
244*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
245*cdf0e10cSrcweir 
246*cdf0e10cSrcweir ::dbtools::throwFunctionNotSupportedException("getBoolean", NULL);
247*cdf0e10cSrcweir 
248*cdf0e10cSrcweir 	return sal_False;
249*cdf0e10cSrcweir }
250*cdf0e10cSrcweir // -------------------------------------------------------------------------
251*cdf0e10cSrcweir sal_Int8 SAL_CALL MacabResultSet::getByte(sal_Int32) throw(SQLException, RuntimeException)
252*cdf0e10cSrcweir {
253*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
254*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
255*cdf0e10cSrcweir 
256*cdf0e10cSrcweir ::dbtools::throwFunctionNotSupportedException("getByte", NULL);
257*cdf0e10cSrcweir 
258*cdf0e10cSrcweir 	sal_Int8 nRet = 0;
259*cdf0e10cSrcweir 	return nRet;
260*cdf0e10cSrcweir }
261*cdf0e10cSrcweir // -------------------------------------------------------------------------
262*cdf0e10cSrcweir sal_Int16 SAL_CALL MacabResultSet::getShort(sal_Int32) throw(SQLException, RuntimeException)
263*cdf0e10cSrcweir {
264*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
265*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
266*cdf0e10cSrcweir 
267*cdf0e10cSrcweir ::dbtools::throwFunctionNotSupportedException("getShort", NULL);
268*cdf0e10cSrcweir 
269*cdf0e10cSrcweir 	sal_Int16 nRet = 0;
270*cdf0e10cSrcweir 	return nRet;
271*cdf0e10cSrcweir }
272*cdf0e10cSrcweir // -------------------------------------------------------------------------
273*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabResultSet::getInt(sal_Int32 columnIndex) throw(SQLException, RuntimeException)
274*cdf0e10cSrcweir {
275*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
276*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
277*cdf0e10cSrcweir 
278*cdf0e10cSrcweir 	sal_Int32 nRet = 0;
279*cdf0e10cSrcweir 	sal_Int32 nRecords = m_aMacabRecords->size();
280*cdf0e10cSrcweir 	m_bWasNull = true;
281*cdf0e10cSrcweir 
282*cdf0e10cSrcweir 	if (m_nRowPos != -1 && m_nRowPos != nRecords && m_xMetaData.is())
283*cdf0e10cSrcweir 	{
284*cdf0e10cSrcweir 		sal_Int32 nFieldNumber = m_xMetaData->fieldAtColumn(columnIndex);
285*cdf0e10cSrcweir 		macabfield *aField = m_aMacabRecords->getField(m_nRowPos,nFieldNumber);
286*cdf0e10cSrcweir 		if(aField != NULL)
287*cdf0e10cSrcweir 		{
288*cdf0e10cSrcweir 			if(aField->type == kABIntegerProperty)
289*cdf0e10cSrcweir 			{
290*cdf0e10cSrcweir 				CFNumberType numberType = CFNumberGetType( (CFNumberRef) aField->value );
291*cdf0e10cSrcweir 				// m_bWasNull now becomes whether getting the value was successful
292*cdf0e10cSrcweir 				// Should we check for the wrong type here, e.g., a float or a 64 bit int?
293*cdf0e10cSrcweir 				m_bWasNull = !CFNumberGetValue((CFNumberRef) aField->value, numberType, &nRet);
294*cdf0e10cSrcweir 			}
295*cdf0e10cSrcweir 		}
296*cdf0e10cSrcweir 	}
297*cdf0e10cSrcweir 
298*cdf0e10cSrcweir // Trigger an exception if m_bWasNull is true?
299*cdf0e10cSrcweir 	return nRet;
300*cdf0e10cSrcweir }
301*cdf0e10cSrcweir // -------------------------------------------------------------------------
302*cdf0e10cSrcweir sal_Int64 SAL_CALL MacabResultSet::getLong(sal_Int32 columnIndex) throw(SQLException, RuntimeException)
303*cdf0e10cSrcweir {
304*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
305*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
306*cdf0e10cSrcweir 
307*cdf0e10cSrcweir 	sal_Int64 nRet = 0;
308*cdf0e10cSrcweir 	sal_Int32 nRecords = m_aMacabRecords->size();
309*cdf0e10cSrcweir 	m_bWasNull = true;
310*cdf0e10cSrcweir 
311*cdf0e10cSrcweir 	if (m_nRowPos != -1 && m_nRowPos != nRecords && m_xMetaData.is())
312*cdf0e10cSrcweir 	{
313*cdf0e10cSrcweir 		sal_Int32 nFieldNumber = m_xMetaData->fieldAtColumn(columnIndex);
314*cdf0e10cSrcweir 		macabfield *aField = m_aMacabRecords->getField(m_nRowPos,nFieldNumber);
315*cdf0e10cSrcweir 		if(aField != NULL)
316*cdf0e10cSrcweir 		{
317*cdf0e10cSrcweir 			if(aField->type == kABIntegerProperty)
318*cdf0e10cSrcweir 			{
319*cdf0e10cSrcweir 				CFNumberType numberType = CFNumberGetType( (CFNumberRef) aField->value );
320*cdf0e10cSrcweir 				// m_bWasNull now becomes whether getting the value was successful
321*cdf0e10cSrcweir 				// Should we check for the wrong type here, e.g., a float or a 32 bit int?
322*cdf0e10cSrcweir 				m_bWasNull = !CFNumberGetValue((CFNumberRef) aField->value, numberType, &nRet);
323*cdf0e10cSrcweir 			}
324*cdf0e10cSrcweir 		}
325*cdf0e10cSrcweir 	}
326*cdf0e10cSrcweir 
327*cdf0e10cSrcweir // Trigger an exception if m_bWasNull is true?
328*cdf0e10cSrcweir 	return nRet;
329*cdf0e10cSrcweir }
330*cdf0e10cSrcweir // -------------------------------------------------------------------------
331*cdf0e10cSrcweir float SAL_CALL MacabResultSet::getFloat(sal_Int32 columnIndex) throw(SQLException, RuntimeException)
332*cdf0e10cSrcweir {
333*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
334*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
335*cdf0e10cSrcweir 
336*cdf0e10cSrcweir 	float nVal = 0;
337*cdf0e10cSrcweir 	sal_Int32 nRecords = m_aMacabRecords->size();
338*cdf0e10cSrcweir 	m_bWasNull = true;
339*cdf0e10cSrcweir 
340*cdf0e10cSrcweir 	if (m_nRowPos != -1 && m_nRowPos != nRecords && m_xMetaData.is())
341*cdf0e10cSrcweir 	{
342*cdf0e10cSrcweir 		sal_Int32 nFieldNumber = m_xMetaData->fieldAtColumn(columnIndex);
343*cdf0e10cSrcweir 		macabfield *aField = m_aMacabRecords->getField(m_nRowPos,nFieldNumber);
344*cdf0e10cSrcweir 		if(aField != NULL)
345*cdf0e10cSrcweir 		{
346*cdf0e10cSrcweir 			if(aField->type == kABRealProperty)
347*cdf0e10cSrcweir 			{
348*cdf0e10cSrcweir 				CFNumberType numberType = CFNumberGetType( (CFNumberRef) aField->value );
349*cdf0e10cSrcweir 				// m_bWasNull now becomes whether getting the value was successful
350*cdf0e10cSrcweir 				// Should we check for the wrong type here, e.g., an int or a double?
351*cdf0e10cSrcweir 				m_bWasNull = !CFNumberGetValue((CFNumberRef) aField->value, numberType, &nVal);
352*cdf0e10cSrcweir 			}
353*cdf0e10cSrcweir 		}
354*cdf0e10cSrcweir 	}
355*cdf0e10cSrcweir 
356*cdf0e10cSrcweir // Trigger an exception if m_bWasNull is true?
357*cdf0e10cSrcweir 	return nVal;
358*cdf0e10cSrcweir }
359*cdf0e10cSrcweir // -------------------------------------------------------------------------
360*cdf0e10cSrcweir double SAL_CALL MacabResultSet::getDouble(sal_Int32 columnIndex) throw(SQLException, RuntimeException)
361*cdf0e10cSrcweir {
362*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
363*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
364*cdf0e10cSrcweir 
365*cdf0e10cSrcweir 	double nVal = 0;
366*cdf0e10cSrcweir 	sal_Int32 nRecords = m_aMacabRecords->size();
367*cdf0e10cSrcweir 	m_bWasNull = true;
368*cdf0e10cSrcweir 
369*cdf0e10cSrcweir 	if (m_nRowPos != -1 && m_nRowPos != nRecords && m_xMetaData.is())
370*cdf0e10cSrcweir 	{
371*cdf0e10cSrcweir 		sal_Int32 nFieldNumber = m_xMetaData->fieldAtColumn(columnIndex);
372*cdf0e10cSrcweir 		macabfield *aField = m_aMacabRecords->getField(m_nRowPos,nFieldNumber);
373*cdf0e10cSrcweir 		if(aField != NULL)
374*cdf0e10cSrcweir 		{
375*cdf0e10cSrcweir 			if(aField->type == kABRealProperty)
376*cdf0e10cSrcweir 			{
377*cdf0e10cSrcweir 				CFNumberType numberType = CFNumberGetType( (CFNumberRef) aField->value );
378*cdf0e10cSrcweir 				// m_bWasNull now becomes whether getting the value was successful
379*cdf0e10cSrcweir 				// Should we check for the wrong type here, e.g., an int or a float?
380*cdf0e10cSrcweir 				m_bWasNull = !CFNumberGetValue((CFNumberRef) aField->value, numberType, &nVal);
381*cdf0e10cSrcweir 			}
382*cdf0e10cSrcweir 		}
383*cdf0e10cSrcweir 	}
384*cdf0e10cSrcweir 
385*cdf0e10cSrcweir // Trigger an exception if m_bWasNull is true?
386*cdf0e10cSrcweir 	return nVal;
387*cdf0e10cSrcweir }
388*cdf0e10cSrcweir // -------------------------------------------------------------------------
389*cdf0e10cSrcweir Sequence< sal_Int8 > SAL_CALL MacabResultSet::getBytes(sal_Int32) throw(SQLException, RuntimeException)
390*cdf0e10cSrcweir {
391*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
392*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
393*cdf0e10cSrcweir 
394*cdf0e10cSrcweir ::dbtools::throwFunctionNotSupportedException("getBytes", NULL);
395*cdf0e10cSrcweir 
396*cdf0e10cSrcweir 	return Sequence< sal_Int8 >();
397*cdf0e10cSrcweir }
398*cdf0e10cSrcweir // -------------------------------------------------------------------------
399*cdf0e10cSrcweir Date SAL_CALL MacabResultSet::getDate(sal_Int32) throw(SQLException, RuntimeException)
400*cdf0e10cSrcweir {
401*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
402*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
403*cdf0e10cSrcweir 
404*cdf0e10cSrcweir ::dbtools::throwFunctionNotSupportedException("getDate", NULL);
405*cdf0e10cSrcweir 
406*cdf0e10cSrcweir 	Date aRet;
407*cdf0e10cSrcweir 	return aRet;
408*cdf0e10cSrcweir }
409*cdf0e10cSrcweir // -------------------------------------------------------------------------
410*cdf0e10cSrcweir Time SAL_CALL MacabResultSet::getTime(sal_Int32) throw(SQLException, RuntimeException)
411*cdf0e10cSrcweir {
412*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
413*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
414*cdf0e10cSrcweir 
415*cdf0e10cSrcweir ::dbtools::throwFunctionNotSupportedException("getTime", NULL);
416*cdf0e10cSrcweir 
417*cdf0e10cSrcweir 	Time nRet;
418*cdf0e10cSrcweir 	return nRet;
419*cdf0e10cSrcweir }
420*cdf0e10cSrcweir // -------------------------------------------------------------------------
421*cdf0e10cSrcweir DateTime SAL_CALL MacabResultSet::getTimestamp(sal_Int32 columnIndex) throw(SQLException, RuntimeException)
422*cdf0e10cSrcweir {
423*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
424*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
425*cdf0e10cSrcweir 
426*cdf0e10cSrcweir 	DateTime nRet;
427*cdf0e10cSrcweir 	sal_Int32 nRecords = m_aMacabRecords->size();
428*cdf0e10cSrcweir 	m_bWasNull = true;
429*cdf0e10cSrcweir 
430*cdf0e10cSrcweir 	if (m_nRowPos != -1 && m_nRowPos != nRecords && m_xMetaData.is())
431*cdf0e10cSrcweir 	{
432*cdf0e10cSrcweir 		sal_Int32 nFieldNumber = m_xMetaData->fieldAtColumn(columnIndex);
433*cdf0e10cSrcweir 		macabfield *aField = m_aMacabRecords->getField(m_nRowPos,nFieldNumber);
434*cdf0e10cSrcweir 		if(aField != NULL)
435*cdf0e10cSrcweir 		{
436*cdf0e10cSrcweir 			if(aField->type == kABDateProperty)
437*cdf0e10cSrcweir 			{
438*cdf0e10cSrcweir 				nRet = CFDateToDateTime((CFDateRef) aField->value);
439*cdf0e10cSrcweir 				m_bWasNull = false;
440*cdf0e10cSrcweir 			}
441*cdf0e10cSrcweir 		}
442*cdf0e10cSrcweir 	}
443*cdf0e10cSrcweir 
444*cdf0e10cSrcweir // Trigger an exception if m_bWasNull is true?
445*cdf0e10cSrcweir 	return nRet;
446*cdf0e10cSrcweir }
447*cdf0e10cSrcweir // -------------------------------------------------------------------------
448*cdf0e10cSrcweir Reference< XInputStream > SAL_CALL MacabResultSet::getBinaryStream(sal_Int32) throw(SQLException, RuntimeException)
449*cdf0e10cSrcweir {
450*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
451*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
452*cdf0e10cSrcweir 
453*cdf0e10cSrcweir ::dbtools::throwFunctionNotSupportedException("getBinaryStream", NULL);
454*cdf0e10cSrcweir 
455*cdf0e10cSrcweir 	return NULL;
456*cdf0e10cSrcweir }
457*cdf0e10cSrcweir // -------------------------------------------------------------------------
458*cdf0e10cSrcweir Reference< XInputStream > SAL_CALL MacabResultSet::getCharacterStream(sal_Int32) throw(SQLException, RuntimeException)
459*cdf0e10cSrcweir {
460*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
461*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
462*cdf0e10cSrcweir 
463*cdf0e10cSrcweir ::dbtools::throwFunctionNotSupportedException("getCharacterStream", NULL);
464*cdf0e10cSrcweir 
465*cdf0e10cSrcweir 	return NULL;
466*cdf0e10cSrcweir }
467*cdf0e10cSrcweir // -------------------------------------------------------------------------
468*cdf0e10cSrcweir Any SAL_CALL MacabResultSet::getObject(sal_Int32, const Reference< ::com::sun::star::container::XNameAccess >&) throw(SQLException, RuntimeException)
469*cdf0e10cSrcweir {
470*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
471*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
472*cdf0e10cSrcweir 
473*cdf0e10cSrcweir ::dbtools::throwFunctionNotSupportedException("getObject", NULL);
474*cdf0e10cSrcweir 
475*cdf0e10cSrcweir 	return Any();
476*cdf0e10cSrcweir }
477*cdf0e10cSrcweir // -------------------------------------------------------------------------
478*cdf0e10cSrcweir Reference< XRef > SAL_CALL MacabResultSet::getRef(sal_Int32) throw(SQLException, RuntimeException)
479*cdf0e10cSrcweir {
480*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
481*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
482*cdf0e10cSrcweir 
483*cdf0e10cSrcweir ::dbtools::throwFunctionNotSupportedException("getRef", NULL);
484*cdf0e10cSrcweir 
485*cdf0e10cSrcweir 	return NULL;
486*cdf0e10cSrcweir }
487*cdf0e10cSrcweir // -------------------------------------------------------------------------
488*cdf0e10cSrcweir Reference< XBlob > SAL_CALL MacabResultSet::getBlob(sal_Int32) throw(SQLException, RuntimeException)
489*cdf0e10cSrcweir {
490*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
491*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
492*cdf0e10cSrcweir 
493*cdf0e10cSrcweir ::dbtools::throwFunctionNotSupportedException("getBlob", NULL);
494*cdf0e10cSrcweir 
495*cdf0e10cSrcweir 	return NULL;
496*cdf0e10cSrcweir }
497*cdf0e10cSrcweir // -------------------------------------------------------------------------
498*cdf0e10cSrcweir Reference< XClob > SAL_CALL MacabResultSet::getClob(sal_Int32) throw(SQLException, RuntimeException)
499*cdf0e10cSrcweir {
500*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
501*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
502*cdf0e10cSrcweir 
503*cdf0e10cSrcweir ::dbtools::throwFunctionNotSupportedException("getClob", NULL);
504*cdf0e10cSrcweir 
505*cdf0e10cSrcweir 	return NULL;
506*cdf0e10cSrcweir }
507*cdf0e10cSrcweir // -------------------------------------------------------------------------
508*cdf0e10cSrcweir Reference< XArray > SAL_CALL MacabResultSet::getArray(sal_Int32) throw(SQLException, RuntimeException)
509*cdf0e10cSrcweir {
510*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
511*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
512*cdf0e10cSrcweir 
513*cdf0e10cSrcweir ::dbtools::throwFunctionNotSupportedException("getArray", NULL);
514*cdf0e10cSrcweir 
515*cdf0e10cSrcweir 	return NULL;
516*cdf0e10cSrcweir }
517*cdf0e10cSrcweir // -------------------------------------------------------------------------
518*cdf0e10cSrcweir Reference< XResultSetMetaData > SAL_CALL MacabResultSet::getMetaData() throw(SQLException, RuntimeException)
519*cdf0e10cSrcweir {
520*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
521*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
522*cdf0e10cSrcweir 
523*cdf0e10cSrcweir 	if (!m_xMetaData.is())
524*cdf0e10cSrcweir 		m_xMetaData = new MacabResultSetMetaData(m_xStatement->getOwnConnection(), m_sTableName);
525*cdf0e10cSrcweir 
526*cdf0e10cSrcweir 	Reference< XResultSetMetaData > xMetaData = m_xMetaData.get();
527*cdf0e10cSrcweir 	return xMetaData;
528*cdf0e10cSrcweir }
529*cdf0e10cSrcweir // -------------------------------------------------------------------------
530*cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::isBeforeFirst() throw(SQLException, RuntimeException)
531*cdf0e10cSrcweir {
532*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
533*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
534*cdf0e10cSrcweir 
535*cdf0e10cSrcweir 	if (m_nRowPos == -1)
536*cdf0e10cSrcweir 		return sal_True;
537*cdf0e10cSrcweir 
538*cdf0e10cSrcweir 	return sal_False;
539*cdf0e10cSrcweir }
540*cdf0e10cSrcweir // -------------------------------------------------------------------------
541*cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::isAfterLast() throw(SQLException, RuntimeException)
542*cdf0e10cSrcweir {
543*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
544*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
545*cdf0e10cSrcweir 
546*cdf0e10cSrcweir 	sal_Int32 nRecords = m_aMacabRecords->size();
547*cdf0e10cSrcweir 	if (m_nRowPos == nRecords)
548*cdf0e10cSrcweir 		return sal_True;
549*cdf0e10cSrcweir 
550*cdf0e10cSrcweir 	return sal_False;
551*cdf0e10cSrcweir }
552*cdf0e10cSrcweir // -------------------------------------------------------------------------
553*cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::isFirst() throw(SQLException, RuntimeException)
554*cdf0e10cSrcweir {
555*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
556*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
557*cdf0e10cSrcweir 
558*cdf0e10cSrcweir 	if (m_nRowPos == 0)
559*cdf0e10cSrcweir 		return sal_True;
560*cdf0e10cSrcweir 
561*cdf0e10cSrcweir 	return sal_False;
562*cdf0e10cSrcweir }
563*cdf0e10cSrcweir // -------------------------------------------------------------------------
564*cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::isLast() throw(SQLException, RuntimeException)
565*cdf0e10cSrcweir {
566*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
567*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
568*cdf0e10cSrcweir 
569*cdf0e10cSrcweir 	sal_Int32 nRecords = m_aMacabRecords->size();
570*cdf0e10cSrcweir 	if (m_nRowPos == nRecords - 1)
571*cdf0e10cSrcweir 		return sal_True;
572*cdf0e10cSrcweir 
573*cdf0e10cSrcweir 	return sal_False;
574*cdf0e10cSrcweir }
575*cdf0e10cSrcweir // -------------------------------------------------------------------------
576*cdf0e10cSrcweir void SAL_CALL MacabResultSet::beforeFirst() throw(SQLException, RuntimeException)
577*cdf0e10cSrcweir {
578*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
579*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
580*cdf0e10cSrcweir 
581*cdf0e10cSrcweir 	// move before the first row
582*cdf0e10cSrcweir 	m_nRowPos = -1;
583*cdf0e10cSrcweir }
584*cdf0e10cSrcweir // -------------------------------------------------------------------------
585*cdf0e10cSrcweir void SAL_CALL MacabResultSet::afterLast() throw(SQLException, RuntimeException)
586*cdf0e10cSrcweir {
587*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
588*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
589*cdf0e10cSrcweir 
590*cdf0e10cSrcweir 	// move after the last row
591*cdf0e10cSrcweir 	sal_Int32 nRecords = m_aMacabRecords->size();
592*cdf0e10cSrcweir 	m_nRowPos = nRecords;
593*cdf0e10cSrcweir }
594*cdf0e10cSrcweir // -------------------------------------------------------------------------
595*cdf0e10cSrcweir void SAL_CALL MacabResultSet::close() throw(SQLException, RuntimeException)
596*cdf0e10cSrcweir {
597*cdf0e10cSrcweir 	{
598*cdf0e10cSrcweir 		::osl::MutexGuard aGuard( m_aMutex );
599*cdf0e10cSrcweir 		checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
600*cdf0e10cSrcweir 	}
601*cdf0e10cSrcweir 	dispose();
602*cdf0e10cSrcweir }
603*cdf0e10cSrcweir // -------------------------------------------------------------------------
604*cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::first() throw(SQLException, RuntimeException)
605*cdf0e10cSrcweir {
606*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
607*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
608*cdf0e10cSrcweir 
609*cdf0e10cSrcweir 	sal_Int32 nRecords = m_aMacabRecords->size();
610*cdf0e10cSrcweir 	if (nRecords == 0)
611*cdf0e10cSrcweir 		return sal_False;
612*cdf0e10cSrcweir 
613*cdf0e10cSrcweir 	m_nRowPos = 0;
614*cdf0e10cSrcweir 	return sal_True;
615*cdf0e10cSrcweir }
616*cdf0e10cSrcweir // -------------------------------------------------------------------------
617*cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::last() throw(SQLException, RuntimeException)
618*cdf0e10cSrcweir {
619*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
620*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
621*cdf0e10cSrcweir 
622*cdf0e10cSrcweir 	sal_Int32 nRecords = m_aMacabRecords->size();
623*cdf0e10cSrcweir 	if (nRecords == 0)
624*cdf0e10cSrcweir 		return sal_False;
625*cdf0e10cSrcweir 
626*cdf0e10cSrcweir 	m_nRowPos = nRecords - 1;
627*cdf0e10cSrcweir 	return sal_True;
628*cdf0e10cSrcweir }
629*cdf0e10cSrcweir // -------------------------------------------------------------------------
630*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabResultSet::getRow() throw(SQLException, RuntimeException)
631*cdf0e10cSrcweir {
632*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
633*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
634*cdf0e10cSrcweir 
635*cdf0e10cSrcweir 	return m_nRowPos;
636*cdf0e10cSrcweir }
637*cdf0e10cSrcweir // -------------------------------------------------------------------------
638*cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::absolute(sal_Int32 row) throw(SQLException, RuntimeException)
639*cdf0e10cSrcweir {
640*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
641*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
642*cdf0e10cSrcweir 
643*cdf0e10cSrcweir 	sal_Int32 nRecords = m_aMacabRecords->size();
644*cdf0e10cSrcweir 	if (row <= -1 ||
645*cdf0e10cSrcweir 	    row >= nRecords)
646*cdf0e10cSrcweir 		return sal_False;
647*cdf0e10cSrcweir 
648*cdf0e10cSrcweir 	m_nRowPos = row;
649*cdf0e10cSrcweir 	return sal_True;
650*cdf0e10cSrcweir }
651*cdf0e10cSrcweir // -------------------------------------------------------------------------
652*cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::relative(sal_Int32 row) throw(SQLException, RuntimeException)
653*cdf0e10cSrcweir {
654*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
655*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
656*cdf0e10cSrcweir 
657*cdf0e10cSrcweir 	return absolute(m_nRowPos + row);
658*cdf0e10cSrcweir }
659*cdf0e10cSrcweir // -------------------------------------------------------------------------
660*cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::next() throw(SQLException, RuntimeException)
661*cdf0e10cSrcweir {
662*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
663*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
664*cdf0e10cSrcweir 
665*cdf0e10cSrcweir 	return absolute(m_nRowPos + 1);
666*cdf0e10cSrcweir }
667*cdf0e10cSrcweir // -------------------------------------------------------------------------
668*cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::previous() throw(SQLException, RuntimeException)
669*cdf0e10cSrcweir {
670*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
671*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
672*cdf0e10cSrcweir 
673*cdf0e10cSrcweir 	return absolute(m_nRowPos - 1);
674*cdf0e10cSrcweir }
675*cdf0e10cSrcweir // -------------------------------------------------------------------------
676*cdf0e10cSrcweir Reference< XInterface > SAL_CALL MacabResultSet::getStatement() throw(SQLException, RuntimeException)
677*cdf0e10cSrcweir {
678*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
679*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
680*cdf0e10cSrcweir 
681*cdf0e10cSrcweir 	Reference< XStatement > xStatement = m_xStatement.get();
682*cdf0e10cSrcweir 	return xStatement;
683*cdf0e10cSrcweir }
684*cdf0e10cSrcweir // -------------------------------------------------------------------------
685*cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::rowDeleted() throw(SQLException, RuntimeException)
686*cdf0e10cSrcweir {
687*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
688*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
689*cdf0e10cSrcweir 
690*cdf0e10cSrcweir 	return sal_False;
691*cdf0e10cSrcweir }
692*cdf0e10cSrcweir // -------------------------------------------------------------------------
693*cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::rowInserted() throw(SQLException, RuntimeException)
694*cdf0e10cSrcweir {
695*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
696*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
697*cdf0e10cSrcweir 
698*cdf0e10cSrcweir 	return sal_False;
699*cdf0e10cSrcweir }
700*cdf0e10cSrcweir // -------------------------------------------------------------------------
701*cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::rowUpdated() throw(SQLException, RuntimeException)
702*cdf0e10cSrcweir {
703*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
704*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
705*cdf0e10cSrcweir 
706*cdf0e10cSrcweir 	return sal_False;
707*cdf0e10cSrcweir }
708*cdf0e10cSrcweir // -------------------------------------------------------------------------
709*cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::wasNull() throw(SQLException, RuntimeException)
710*cdf0e10cSrcweir {
711*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
712*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
713*cdf0e10cSrcweir 
714*cdf0e10cSrcweir 	return m_bWasNull;
715*cdf0e10cSrcweir }
716*cdf0e10cSrcweir // -------------------------------------------------------------------------
717*cdf0e10cSrcweir void SAL_CALL MacabResultSet::cancel() throw(RuntimeException)
718*cdf0e10cSrcweir {
719*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
720*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
721*cdf0e10cSrcweir }
722*cdf0e10cSrcweir // -------------------------------------------------------------------------
723*cdf0e10cSrcweir void SAL_CALL MacabResultSet::clearWarnings() throw(SQLException, RuntimeException)
724*cdf0e10cSrcweir {
725*cdf0e10cSrcweir }
726*cdf0e10cSrcweir // -------------------------------------------------------------------------
727*cdf0e10cSrcweir Any SAL_CALL MacabResultSet::getWarnings() throw(SQLException, RuntimeException)
728*cdf0e10cSrcweir {
729*cdf0e10cSrcweir 	return Any();
730*cdf0e10cSrcweir }
731*cdf0e10cSrcweir // -------------------------------------------------------------------------
732*cdf0e10cSrcweir void SAL_CALL MacabResultSet::insertRow() throw(SQLException, RuntimeException)
733*cdf0e10cSrcweir {
734*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
735*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
736*cdf0e10cSrcweir 
737*cdf0e10cSrcweir 	// you only have to implement this if you want to insert new rows
738*cdf0e10cSrcweir }
739*cdf0e10cSrcweir // -------------------------------------------------------------------------
740*cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateRow() throw(SQLException, RuntimeException)
741*cdf0e10cSrcweir {
742*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
743*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
744*cdf0e10cSrcweir 
745*cdf0e10cSrcweir 	// only when you allow updates
746*cdf0e10cSrcweir }
747*cdf0e10cSrcweir // -------------------------------------------------------------------------
748*cdf0e10cSrcweir void SAL_CALL MacabResultSet::deleteRow() throw(SQLException, RuntimeException)
749*cdf0e10cSrcweir {
750*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
751*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
752*cdf0e10cSrcweir }
753*cdf0e10cSrcweir // -------------------------------------------------------------------------
754*cdf0e10cSrcweir void SAL_CALL MacabResultSet::cancelRowUpdates() throw(SQLException, RuntimeException)
755*cdf0e10cSrcweir {
756*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
757*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
758*cdf0e10cSrcweir }
759*cdf0e10cSrcweir // -------------------------------------------------------------------------
760*cdf0e10cSrcweir void SAL_CALL MacabResultSet::moveToInsertRow() throw(SQLException, RuntimeException)
761*cdf0e10cSrcweir {
762*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
763*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
764*cdf0e10cSrcweir 
765*cdf0e10cSrcweir 	// only when you allow inserts
766*cdf0e10cSrcweir }
767*cdf0e10cSrcweir // -------------------------------------------------------------------------
768*cdf0e10cSrcweir void SAL_CALL MacabResultSet::moveToCurrentRow() throw(SQLException, RuntimeException)
769*cdf0e10cSrcweir {
770*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
771*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
772*cdf0e10cSrcweir }
773*cdf0e10cSrcweir // -------------------------------------------------------------------------
774*cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateNull(sal_Int32) throw(SQLException, RuntimeException)
775*cdf0e10cSrcweir {
776*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
777*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
778*cdf0e10cSrcweir }
779*cdf0e10cSrcweir // -------------------------------------------------------------------------
780*cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateBoolean(sal_Int32, sal_Bool) throw(SQLException, RuntimeException)
781*cdf0e10cSrcweir {
782*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
783*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
784*cdf0e10cSrcweir }
785*cdf0e10cSrcweir // -------------------------------------------------------------------------
786*cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateByte(sal_Int32, sal_Int8) throw(SQLException, RuntimeException)
787*cdf0e10cSrcweir {
788*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
789*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
790*cdf0e10cSrcweir }
791*cdf0e10cSrcweir // -------------------------------------------------------------------------
792*cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateShort(sal_Int32, sal_Int16) throw(SQLException, RuntimeException)
793*cdf0e10cSrcweir {
794*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
795*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
796*cdf0e10cSrcweir }
797*cdf0e10cSrcweir // -------------------------------------------------------------------------
798*cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateInt(sal_Int32, sal_Int32) throw(SQLException, RuntimeException)
799*cdf0e10cSrcweir {
800*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
801*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
802*cdf0e10cSrcweir }
803*cdf0e10cSrcweir // -------------------------------------------------------------------------
804*cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateLong(sal_Int32, sal_Int64) throw(SQLException, RuntimeException)
805*cdf0e10cSrcweir {
806*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
807*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
808*cdf0e10cSrcweir }
809*cdf0e10cSrcweir // -----------------------------------------------------------------------
810*cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateFloat(sal_Int32, float) throw(SQLException, RuntimeException)
811*cdf0e10cSrcweir {
812*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
813*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
814*cdf0e10cSrcweir }
815*cdf0e10cSrcweir // -------------------------------------------------------------------------
816*cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateDouble(sal_Int32, double) throw(SQLException, RuntimeException)
817*cdf0e10cSrcweir {
818*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
819*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
820*cdf0e10cSrcweir }
821*cdf0e10cSrcweir // -------------------------------------------------------------------------
822*cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateString(sal_Int32, const ::rtl::OUString&) throw(SQLException, RuntimeException)
823*cdf0e10cSrcweir {
824*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
825*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
826*cdf0e10cSrcweir }
827*cdf0e10cSrcweir // -------------------------------------------------------------------------
828*cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateBytes(sal_Int32, const Sequence< sal_Int8 >&) throw(SQLException, RuntimeException)
829*cdf0e10cSrcweir {
830*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
831*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
832*cdf0e10cSrcweir }
833*cdf0e10cSrcweir // -------------------------------------------------------------------------
834*cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateDate(sal_Int32, const Date&) throw(SQLException, RuntimeException)
835*cdf0e10cSrcweir {
836*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
837*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
838*cdf0e10cSrcweir }
839*cdf0e10cSrcweir // -------------------------------------------------------------------------
840*cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateTime(sal_Int32, const Time&) throw(SQLException, RuntimeException)
841*cdf0e10cSrcweir {
842*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
843*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
844*cdf0e10cSrcweir }
845*cdf0e10cSrcweir // -------------------------------------------------------------------------
846*cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateTimestamp(sal_Int32, const DateTime&) throw(SQLException, RuntimeException)
847*cdf0e10cSrcweir {
848*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
849*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
850*cdf0e10cSrcweir }
851*cdf0e10cSrcweir // -------------------------------------------------------------------------
852*cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateBinaryStream(sal_Int32, const Reference< XInputStream >&, sal_Int32) throw(SQLException, RuntimeException)
853*cdf0e10cSrcweir {
854*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
855*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
856*cdf0e10cSrcweir }
857*cdf0e10cSrcweir // -------------------------------------------------------------------------
858*cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateCharacterStream(sal_Int32, const Reference< XInputStream >&, sal_Int32) throw(SQLException, RuntimeException)
859*cdf0e10cSrcweir {
860*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
861*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
862*cdf0e10cSrcweir }
863*cdf0e10cSrcweir // -------------------------------------------------------------------------
864*cdf0e10cSrcweir void SAL_CALL MacabResultSet::refreshRow() throw(SQLException, RuntimeException)
865*cdf0e10cSrcweir {
866*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
867*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
868*cdf0e10cSrcweir }
869*cdf0e10cSrcweir // -------------------------------------------------------------------------
870*cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateObject(sal_Int32, const Any&) throw(SQLException, RuntimeException)
871*cdf0e10cSrcweir {
872*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
873*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
874*cdf0e10cSrcweir }
875*cdf0e10cSrcweir // -------------------------------------------------------------------------
876*cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateNumericObject(sal_Int32, const Any&, sal_Int32) throw(SQLException, RuntimeException)
877*cdf0e10cSrcweir {
878*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
879*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
880*cdf0e10cSrcweir }
881*cdf0e10cSrcweir // -------------------------------------------------------------------------
882*cdf0e10cSrcweir // XRowLocate
883*cdf0e10cSrcweir Any SAL_CALL MacabResultSet::getBookmark() throw( SQLException,  RuntimeException)
884*cdf0e10cSrcweir {
885*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
886*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
887*cdf0e10cSrcweir 
888*cdf0e10cSrcweir 	sal_Int32 nRecords = m_aMacabRecords->size();
889*cdf0e10cSrcweir 
890*cdf0e10cSrcweir 	if (m_nRowPos != -1 && m_nRowPos != nRecords)
891*cdf0e10cSrcweir 	{
892*cdf0e10cSrcweir 		macabfield *uidField = m_aMacabRecords->getField(m_nRowPos,::rtl::OUString::createFromAscii("UID"));
893*cdf0e10cSrcweir 		if(uidField != NULL)
894*cdf0e10cSrcweir 		{
895*cdf0e10cSrcweir 			if(uidField->type == kABStringProperty)
896*cdf0e10cSrcweir 			{
897*cdf0e10cSrcweir 				return makeAny(CFStringToOUString( (CFStringRef) uidField->value ));
898*cdf0e10cSrcweir 			}
899*cdf0e10cSrcweir 		}
900*cdf0e10cSrcweir 	}
901*cdf0e10cSrcweir 	return Any();
902*cdf0e10cSrcweir }
903*cdf0e10cSrcweir // -------------------------------------------------------------------------
904*cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::moveToBookmark(const  Any& bookmark) throw( SQLException,  RuntimeException)
905*cdf0e10cSrcweir {
906*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
907*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
908*cdf0e10cSrcweir 
909*cdf0e10cSrcweir 	::rtl::OUString sBookmark = comphelper::getString(bookmark);
910*cdf0e10cSrcweir         sal_Int32 nRecords = m_aMacabRecords->size();
911*cdf0e10cSrcweir 
912*cdf0e10cSrcweir 	for (sal_Int32 nRow = 0; nRow < nRecords; nRow++)
913*cdf0e10cSrcweir 	{
914*cdf0e10cSrcweir 		macabfield *uidField = m_aMacabRecords->getField(m_nRowPos,::rtl::OUString::createFromAscii("UID"));
915*cdf0e10cSrcweir 		if(uidField != NULL)
916*cdf0e10cSrcweir 		{
917*cdf0e10cSrcweir 			if(uidField->type == kABStringProperty)
918*cdf0e10cSrcweir 			{
919*cdf0e10cSrcweir 				::rtl::OUString sUniqueIdentifier = CFStringToOUString( (CFStringRef) uidField->value );
920*cdf0e10cSrcweir 				if (sUniqueIdentifier == sBookmark)
921*cdf0e10cSrcweir 				{
922*cdf0e10cSrcweir 					m_nRowPos = nRow;
923*cdf0e10cSrcweir 					return sal_True;
924*cdf0e10cSrcweir 				}
925*cdf0e10cSrcweir 			}
926*cdf0e10cSrcweir 		}
927*cdf0e10cSrcweir 	}
928*cdf0e10cSrcweir 	return sal_False;
929*cdf0e10cSrcweir }
930*cdf0e10cSrcweir // -------------------------------------------------------------------------
931*cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::moveRelativeToBookmark(const  Any& bookmark, sal_Int32 rows) throw( SQLException,  RuntimeException)
932*cdf0e10cSrcweir {
933*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
934*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
935*cdf0e10cSrcweir 
936*cdf0e10cSrcweir 	sal_Int32 nRowSave = m_nRowPos;
937*cdf0e10cSrcweir 
938*cdf0e10cSrcweir 	if (moveToBookmark(bookmark))
939*cdf0e10cSrcweir 	{
940*cdf0e10cSrcweir 		sal_Int32 nRecords = m_aMacabRecords->size();
941*cdf0e10cSrcweir 
942*cdf0e10cSrcweir 		m_nRowPos += rows;
943*cdf0e10cSrcweir 
944*cdf0e10cSrcweir 		if (-1 < m_nRowPos && m_nRowPos < nRecords)
945*cdf0e10cSrcweir 			return sal_True;
946*cdf0e10cSrcweir 	}
947*cdf0e10cSrcweir 
948*cdf0e10cSrcweir 	m_nRowPos = nRowSave;
949*cdf0e10cSrcweir 	return sal_False;
950*cdf0e10cSrcweir }
951*cdf0e10cSrcweir // -------------------------------------------------------------------------
952*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabResultSet::compareBookmarks(const  Any& firstItem, const  Any& secondItem) throw( SQLException,  RuntimeException)
953*cdf0e10cSrcweir {
954*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
955*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
956*cdf0e10cSrcweir 
957*cdf0e10cSrcweir 	::rtl::OUString sFirst = comphelper::getString(firstItem);
958*cdf0e10cSrcweir 	::rtl::OUString sSecond = comphelper::getString(secondItem);
959*cdf0e10cSrcweir 
960*cdf0e10cSrcweir 	if (sFirst < sSecond)
961*cdf0e10cSrcweir 		return CompareBookmark::LESS;
962*cdf0e10cSrcweir 	if (sFirst > sSecond)
963*cdf0e10cSrcweir 		return CompareBookmark::GREATER;
964*cdf0e10cSrcweir 	return CompareBookmark::EQUAL;
965*cdf0e10cSrcweir }
966*cdf0e10cSrcweir // -------------------------------------------------------------------------
967*cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::hasOrderedBookmarks() throw( SQLException,  RuntimeException)
968*cdf0e10cSrcweir {
969*cdf0e10cSrcweir 	return sal_False;
970*cdf0e10cSrcweir }
971*cdf0e10cSrcweir // -------------------------------------------------------------------------
972*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabResultSet::hashBookmark(const  Any& bookmark) throw( SQLException,  RuntimeException)
973*cdf0e10cSrcweir {
974*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
975*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
976*cdf0e10cSrcweir 
977*cdf0e10cSrcweir 	::rtl::OUString sBookmark = comphelper::getString(bookmark);
978*cdf0e10cSrcweir 
979*cdf0e10cSrcweir 	return sBookmark.hashCode();
980*cdf0e10cSrcweir }
981*cdf0e10cSrcweir // -------------------------------------------------------------------------
982*cdf0e10cSrcweir // XDeleteRows
983*cdf0e10cSrcweir Sequence< sal_Int32 > SAL_CALL MacabResultSet::deleteRows(const  Sequence<  Any >&) throw( SQLException,  RuntimeException)
984*cdf0e10cSrcweir {
985*cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
986*cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
987*cdf0e10cSrcweir 
988*cdf0e10cSrcweir 	return Sequence< sal_Int32 >();
989*cdf0e10cSrcweir }
990*cdf0e10cSrcweir // -------------------------------------------------------------------------
991*cdf0e10cSrcweir IPropertyArrayHelper* MacabResultSet::createArrayHelper() const
992*cdf0e10cSrcweir {
993*cdf0e10cSrcweir 	Sequence< Property > aProps(6);
994*cdf0e10cSrcweir 	Property* pProperties = aProps.getArray();
995*cdf0e10cSrcweir 	sal_Int32 nPos = 0;
996*cdf0e10cSrcweir 	DECL_PROP1IMPL(CURSORNAME,			::rtl::OUString) PropertyAttribute::READONLY);
997*cdf0e10cSrcweir 	DECL_PROP0(FETCHDIRECTION,			sal_Int32);
998*cdf0e10cSrcweir 	DECL_PROP0(FETCHSIZE,				sal_Int32);
999*cdf0e10cSrcweir 	DECL_BOOL_PROP1IMPL(ISBOOKMARKABLE) PropertyAttribute::READONLY);
1000*cdf0e10cSrcweir 	DECL_PROP1IMPL(RESULTSETCONCURRENCY,sal_Int32) PropertyAttribute::READONLY);
1001*cdf0e10cSrcweir 	DECL_PROP1IMPL(RESULTSETTYPE,		sal_Int32) PropertyAttribute::READONLY);
1002*cdf0e10cSrcweir 
1003*cdf0e10cSrcweir 	return new OPropertyArrayHelper(aProps);
1004*cdf0e10cSrcweir }
1005*cdf0e10cSrcweir // -------------------------------------------------------------------------
1006*cdf0e10cSrcweir IPropertyArrayHelper & MacabResultSet::getInfoHelper()
1007*cdf0e10cSrcweir {
1008*cdf0e10cSrcweir 	return *static_cast<MacabResultSet*>(this)->getArrayHelper();
1009*cdf0e10cSrcweir }
1010*cdf0e10cSrcweir // -------------------------------------------------------------------------
1011*cdf0e10cSrcweir sal_Bool MacabResultSet::convertFastPropertyValue(
1012*cdf0e10cSrcweir 			Any &,
1013*cdf0e10cSrcweir 			Any &,
1014*cdf0e10cSrcweir 			sal_Int32 nHandle,
1015*cdf0e10cSrcweir 			const Any& )
1016*cdf0e10cSrcweir 				throw (::com::sun::star::lang::IllegalArgumentException)
1017*cdf0e10cSrcweir {
1018*cdf0e10cSrcweir 	switch (nHandle)
1019*cdf0e10cSrcweir 	{
1020*cdf0e10cSrcweir 		case PROPERTY_ID_ISBOOKMARKABLE:
1021*cdf0e10cSrcweir 		case PROPERTY_ID_CURSORNAME:
1022*cdf0e10cSrcweir 		case PROPERTY_ID_RESULTSETCONCURRENCY:
1023*cdf0e10cSrcweir 		case PROPERTY_ID_RESULTSETTYPE:
1024*cdf0e10cSrcweir 			throw ::com::sun::star::lang::IllegalArgumentException();
1025*cdf0e10cSrcweir 			break;
1026*cdf0e10cSrcweir 		case PROPERTY_ID_FETCHDIRECTION:
1027*cdf0e10cSrcweir 		case PROPERTY_ID_FETCHSIZE:
1028*cdf0e10cSrcweir 		default:
1029*cdf0e10cSrcweir 			;
1030*cdf0e10cSrcweir 	}
1031*cdf0e10cSrcweir 	return sal_False;
1032*cdf0e10cSrcweir }
1033*cdf0e10cSrcweir // -------------------------------------------------------------------------
1034*cdf0e10cSrcweir void MacabResultSet::setFastPropertyValue_NoBroadcast(
1035*cdf0e10cSrcweir 			sal_Int32 nHandle,
1036*cdf0e10cSrcweir 			const Any& )
1037*cdf0e10cSrcweir 				 throw (Exception)
1038*cdf0e10cSrcweir {
1039*cdf0e10cSrcweir 	switch (nHandle)
1040*cdf0e10cSrcweir 	{
1041*cdf0e10cSrcweir 		case PROPERTY_ID_ISBOOKMARKABLE:
1042*cdf0e10cSrcweir 		case PROPERTY_ID_CURSORNAME:
1043*cdf0e10cSrcweir 		case PROPERTY_ID_RESULTSETCONCURRENCY:
1044*cdf0e10cSrcweir 		case PROPERTY_ID_RESULTSETTYPE:
1045*cdf0e10cSrcweir 			throw Exception();
1046*cdf0e10cSrcweir 			break;
1047*cdf0e10cSrcweir 		case PROPERTY_ID_FETCHDIRECTION:
1048*cdf0e10cSrcweir 			break;
1049*cdf0e10cSrcweir 		case PROPERTY_ID_FETCHSIZE:
1050*cdf0e10cSrcweir 			break;
1051*cdf0e10cSrcweir 		default:
1052*cdf0e10cSrcweir 			;
1053*cdf0e10cSrcweir 	}
1054*cdf0e10cSrcweir }
1055*cdf0e10cSrcweir // -------------------------------------------------------------------------
1056*cdf0e10cSrcweir void MacabResultSet::getFastPropertyValue(
1057*cdf0e10cSrcweir 			Any& _rValue,
1058*cdf0e10cSrcweir 			sal_Int32 nHandle) const
1059*cdf0e10cSrcweir {
1060*cdf0e10cSrcweir 	switch (nHandle)
1061*cdf0e10cSrcweir 	{
1062*cdf0e10cSrcweir 		case PROPERTY_ID_ISBOOKMARKABLE:
1063*cdf0e10cSrcweir             _rValue <<= (sal_Bool)sal_False;
1064*cdf0e10cSrcweir             break;
1065*cdf0e10cSrcweir 		case PROPERTY_ID_CURSORNAME:
1066*cdf0e10cSrcweir 		case PROPERTY_ID_RESULTSETCONCURRENCY:
1067*cdf0e10cSrcweir 		case PROPERTY_ID_RESULTSETTYPE:
1068*cdf0e10cSrcweir 		case PROPERTY_ID_FETCHDIRECTION:
1069*cdf0e10cSrcweir 		case PROPERTY_ID_FETCHSIZE:
1070*cdf0e10cSrcweir 			;
1071*cdf0e10cSrcweir 	}
1072*cdf0e10cSrcweir }
1073*cdf0e10cSrcweir // -----------------------------------------------------------------------------
1074