Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / odk / examples / DevelopersGuide / Database / DriverSkeleton / SResultSet.cxx
blob9cb6a9252cf7c009bb6949cf151d241b813cb52e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * The Contents of this file are made available subject to the terms of
5 * the BSD license.
7 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * All rights reserved.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. Neither the name of Sun Microsystems, Inc. nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
29 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
31 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
32 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 *************************************************************************/
36 #include "SResultSet.hxx"
37 #include "SResultSetMetaData.hxx"
38 #include <com/sun/star/sdbc/DataType.hpp>
39 #include <com/sun/star/beans/PropertyAttribute.hpp>
40 #include <com/sun/star/sdbcx/CompareBookmark.hpp>
41 #include <cppuhelper/typeprovider.hxx>
42 #include <cppuhelper/supportsservice.hxx>
43 #include <com/sun/star/lang/DisposedException.hpp>
44 #include "propertyids.hxx"
46 using namespace connectivity::skeleton;
47 using namespace cppu;
48 using namespace com::sun::star::uno;
49 using namespace com::sun::star::lang;
50 using namespace com::sun::star::beans;
51 using namespace com::sun::star::sdbc;
52 using namespace com::sun::star::sdbcx;
53 using namespace com::sun::star::container;
54 using namespace com::sun::star::io;
55 using namespace com::sun::star::util;
57 // IMPLEMENT_SERVICE_INFO(OResultSet,"com.sun.star.sdbcx.OResultSet","com.sun.star.sdbc.ResultSet");
58 ::rtl::OUString SAL_CALL OResultSet::getImplementationName( ) throw ( RuntimeException)
60 return ::rtl::OUString("com.sun.star.sdbcx.skeleton.ResultSet");
63 Sequence< ::rtl::OUString > SAL_CALL OResultSet::getSupportedServiceNames( ) throw( RuntimeException)
65 Sequence< ::rtl::OUString > aSupported(2);
66 aSupported[0] = ::rtl::OUString("com.sun.star.sdbc.ResultSet");
67 aSupported[1] = ::rtl::OUString("com.sun.star.sdbcx.ResultSet");
68 return aSupported;
71 sal_Bool SAL_CALL OResultSet::supportsService( const ::rtl::OUString& _rServiceName ) throw( RuntimeException)
73 return cppu::supportsService(this, _rServiceName);
76 OResultSet::OResultSet(OStatement_Base* pStmt)
77 : OResultSet_BASE(m_aMutex)
78 ,OPropertySetHelper(OResultSet_BASE::rBHelper)
79 ,m_aStatement((OWeakObject*)pStmt)
80 ,m_xMetaData(NULL)
81 ,m_nTextEncoding(pStmt->getOwnConnection()->getTextEncoding())
82 ,m_pStatement(pStmt)
83 ,m_bWasNull(sal_True)
87 OResultSet::~OResultSet()
91 void OResultSet::disposing()
93 OPropertySetHelper::disposing();
95 ::osl::MutexGuard aGuard(m_aMutex);
97 m_aStatement = NULL;
98 m_xMetaData = NULL;
101 Any SAL_CALL OResultSet::queryInterface( const Type & rType ) throw(RuntimeException)
103 Any aRet = OPropertySetHelper::queryInterface(rType);
104 if(!aRet.hasValue())
105 aRet = OResultSet_BASE::queryInterface(rType);
106 return aRet;
109 Sequence< Type > SAL_CALL OResultSet::getTypes( ) throw( RuntimeException)
111 OTypeCollection aTypes(
112 ::cppu::UnoType<css::beans::XMultiPropertySet>::get(),
113 ::cppu::UnoType<css::beans::XFastPropertySet>::get(),
114 ::cppu::UnoType<css::beans::XPropertySet>::get());
116 return concatSequences(aTypes.getTypes(),OResultSet_BASE::getTypes());
120 sal_Int32 SAL_CALL OResultSet::findColumn( const ::rtl::OUString& columnName ) throw(SQLException, RuntimeException)
123 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
125 // find the first column with the name columnName
127 ::osl::MutexGuard aGuard( m_aMutex );
129 Reference< XResultSetMetaData > xMeta = getMetaData();
130 sal_Int32 nLen = xMeta->getColumnCount();
131 sal_Int32 i = 1;
132 for(;i<=nLen;++i)
133 if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
134 columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
135 break;
136 return i;
139 Reference< XInputStream > SAL_CALL OResultSet::getBinaryStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
141 ::osl::MutexGuard aGuard( m_aMutex );
142 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
145 return NULL;
148 Reference< XInputStream > SAL_CALL OResultSet::getCharacterStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
150 ::osl::MutexGuard aGuard( m_aMutex );
151 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
154 return NULL;
158 sal_Bool SAL_CALL OResultSet::getBoolean( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
160 ::osl::MutexGuard aGuard( m_aMutex );
161 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
163 return sal_False;
167 sal_Int8 SAL_CALL OResultSet::getByte( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
169 ::osl::MutexGuard aGuard( m_aMutex );
170 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
173 sal_Int8 nRet = 0;
174 return nRet;
178 Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
181 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
182 ::osl::MutexGuard aGuard( m_aMutex );
184 return Sequence< sal_Int8 >();
188 Date SAL_CALL OResultSet::getDate( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
190 ::osl::MutexGuard aGuard( m_aMutex );
191 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
194 Date nRet;
195 return nRet;
199 double SAL_CALL OResultSet::getDouble( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
201 ::osl::MutexGuard aGuard( m_aMutex );
202 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
205 double nRet = 0;
206 return nRet;
210 float SAL_CALL OResultSet::getFloat( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
212 ::osl::MutexGuard aGuard( m_aMutex );
213 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
216 float nVal(0);
217 return nVal;
221 sal_Int32 SAL_CALL OResultSet::getInt( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
223 ::osl::MutexGuard aGuard( m_aMutex );
224 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
226 sal_Int32 nRet=0;
227 return nRet;
231 sal_Int32 SAL_CALL OResultSet::getRow( ) throw(SQLException, RuntimeException)
233 ::osl::MutexGuard aGuard( m_aMutex );
234 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
236 sal_Int32 nValue = 0;
237 return nValue;
241 sal_Int64 SAL_CALL OResultSet::getLong( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
243 ::osl::MutexGuard aGuard( m_aMutex );
244 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
246 return sal_Int64();
250 Reference< XResultSetMetaData > SAL_CALL OResultSet::getMetaData( ) throw(SQLException, RuntimeException)
252 ::osl::MutexGuard aGuard( m_aMutex );
253 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
256 if(!m_xMetaData.is())
257 m_xMetaData = new OResultSetMetaData(m_pStatement->getOwnConnection());
258 return m_xMetaData;
261 Reference< XArray > SAL_CALL OResultSet::getArray( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
263 ::osl::MutexGuard aGuard( m_aMutex );
264 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
266 return NULL;
270 Reference< XClob > SAL_CALL OResultSet::getClob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
272 ::osl::MutexGuard aGuard( m_aMutex );
273 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
275 return NULL;
278 Reference< XBlob > SAL_CALL OResultSet::getBlob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
280 ::osl::MutexGuard aGuard( m_aMutex );
281 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
283 return NULL;
287 Reference< XRef > SAL_CALL OResultSet::getRef( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
289 ::osl::MutexGuard aGuard( m_aMutex );
290 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
292 return NULL;
296 Any SAL_CALL OResultSet::getObject( sal_Int32 columnIndex, const Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(SQLException, RuntimeException)
298 ::osl::MutexGuard aGuard( m_aMutex );
299 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
301 return Any();
305 sal_Int16 SAL_CALL OResultSet::getShort( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
307 ::osl::MutexGuard aGuard( m_aMutex );
308 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
311 sal_Int16 nRet=0;
312 return nRet;
316 ::rtl::OUString SAL_CALL OResultSet::getString( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
318 ::osl::MutexGuard aGuard( m_aMutex );
319 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
322 ::rtl::OUString nRet;
323 return nRet;
327 css::util::Time SAL_CALL OResultSet::getTime( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
329 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
331 ::osl::MutexGuard aGuard( m_aMutex );
333 css::util::Time nRet;
334 return nRet;
338 DateTime SAL_CALL OResultSet::getTimestamp( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
340 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
343 ::osl::MutexGuard aGuard( m_aMutex );
345 DateTime nRet;
346 return nRet;
350 sal_Bool SAL_CALL OResultSet::isBeforeFirst( ) throw(SQLException, RuntimeException)
352 ::osl::MutexGuard aGuard( m_aMutex );
353 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
356 // here you have to implement your movements
357 // return true means there is no data
358 return sal_True;
361 sal_Bool SAL_CALL OResultSet::isAfterLast( ) throw(SQLException, RuntimeException)
363 ::osl::MutexGuard aGuard( m_aMutex );
364 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
366 return sal_True;
369 sal_Bool SAL_CALL OResultSet::isFirst( ) throw(SQLException, RuntimeException)
371 ::osl::MutexGuard aGuard( m_aMutex );
372 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
375 return sal_False;
378 sal_Bool SAL_CALL OResultSet::isLast( ) throw(SQLException, RuntimeException)
380 ::osl::MutexGuard aGuard( m_aMutex );
381 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
384 return sal_False;
387 void SAL_CALL OResultSet::beforeFirst( ) throw(SQLException, RuntimeException)
389 ::osl::MutexGuard aGuard( m_aMutex );
390 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
392 // move before the first row so that isBeforeFirst returns false
393 // the same for other movement methods
396 void SAL_CALL OResultSet::afterLast( ) throw(SQLException, RuntimeException)
398 ::osl::MutexGuard aGuard( m_aMutex );
399 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
403 void SAL_CALL OResultSet::close( ) throw(SQLException, RuntimeException)
406 ::osl::MutexGuard aGuard( m_aMutex );
407 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
410 dispose();
414 sal_Bool SAL_CALL OResultSet::first( ) throw(SQLException, RuntimeException)
416 ::osl::MutexGuard aGuard( m_aMutex );
417 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
419 return sal_False;
423 sal_Bool SAL_CALL OResultSet::last( ) throw(SQLException, RuntimeException)
425 ::osl::MutexGuard aGuard( m_aMutex );
426 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
428 return sal_False;
431 sal_Bool SAL_CALL OResultSet::absolute( sal_Int32 row ) throw(SQLException, RuntimeException)
433 ::osl::MutexGuard aGuard( m_aMutex );
434 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
436 return sal_False;
439 sal_Bool SAL_CALL OResultSet::relative( sal_Int32 row ) throw(SQLException, RuntimeException)
441 ::osl::MutexGuard aGuard( m_aMutex );
442 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
444 return sal_False;
447 sal_Bool SAL_CALL OResultSet::previous( ) throw(SQLException, RuntimeException)
449 ::osl::MutexGuard aGuard( m_aMutex );
450 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
452 return sal_False;
455 Reference< XInterface > SAL_CALL OResultSet::getStatement( ) throw(SQLException, RuntimeException)
457 ::osl::MutexGuard aGuard( m_aMutex );
458 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
461 return m_aStatement.get();
465 sal_Bool SAL_CALL OResultSet::rowDeleted( ) throw(SQLException, RuntimeException)
467 ::osl::MutexGuard aGuard( m_aMutex );
468 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
471 return sal_False;
474 sal_Bool SAL_CALL OResultSet::rowInserted( ) throw(SQLException, RuntimeException)
476 ::osl::MutexGuard aGuard( m_aMutex );
477 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
480 return sal_False;
483 sal_Bool SAL_CALL OResultSet::rowUpdated( ) throw(SQLException, RuntimeException)
485 ::osl::MutexGuard aGuard( m_aMutex );
486 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
489 return sal_False;
493 sal_Bool SAL_CALL OResultSet::next( ) throw(SQLException, RuntimeException)
495 ::osl::MutexGuard aGuard( m_aMutex );
496 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
499 return sal_False;
503 sal_Bool SAL_CALL OResultSet::wasNull( ) throw(SQLException, RuntimeException)
505 ::osl::MutexGuard aGuard( m_aMutex );
506 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
509 return m_bWasNull;
513 void SAL_CALL OResultSet::cancel( ) throw(RuntimeException)
515 ::osl::MutexGuard aGuard( m_aMutex );
516 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
520 void SAL_CALL OResultSet::clearWarnings( ) throw(SQLException, RuntimeException)
524 Any SAL_CALL OResultSet::getWarnings( ) throw(SQLException, RuntimeException)
526 return Any();
529 void SAL_CALL OResultSet::insertRow( ) throw(SQLException, RuntimeException)
531 ::osl::MutexGuard aGuard( m_aMutex );
532 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
534 // you only have to implement this if you want to insert new rows
537 void SAL_CALL OResultSet::updateRow( ) throw(SQLException, RuntimeException)
539 ::osl::MutexGuard aGuard( m_aMutex );
540 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
543 // only when you allow updates
546 void SAL_CALL OResultSet::deleteRow( ) throw(SQLException, RuntimeException)
548 ::osl::MutexGuard aGuard( m_aMutex );
549 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
553 void SAL_CALL OResultSet::cancelRowUpdates( ) throw(SQLException, RuntimeException)
555 ::osl::MutexGuard aGuard( m_aMutex );
556 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
560 void SAL_CALL OResultSet::moveToInsertRow( ) throw(SQLException, RuntimeException)
562 ::osl::MutexGuard aGuard( m_aMutex );
563 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
566 // only when you allow insert's
570 void SAL_CALL OResultSet::moveToCurrentRow( ) throw(SQLException, RuntimeException)
572 ::osl::MutexGuard aGuard( m_aMutex );
573 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
577 void SAL_CALL OResultSet::updateNull( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
579 ::osl::MutexGuard aGuard( m_aMutex );
580 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
584 void SAL_CALL OResultSet::updateBoolean( sal_Int32 columnIndex, sal_Bool x ) throw(SQLException, RuntimeException)
586 ::osl::MutexGuard aGuard( m_aMutex );
587 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
591 void SAL_CALL OResultSet::updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(SQLException, RuntimeException)
593 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
594 ::osl::MutexGuard aGuard( m_aMutex );
599 void SAL_CALL OResultSet::updateShort( sal_Int32 columnIndex, sal_Int16 x ) throw(SQLException, RuntimeException)
601 ::osl::MutexGuard aGuard( m_aMutex );
602 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
606 void SAL_CALL OResultSet::updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(SQLException, RuntimeException)
608 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
609 ::osl::MutexGuard aGuard( m_aMutex );
613 void SAL_CALL OResultSet::updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw(SQLException, RuntimeException)
615 ::osl::MutexGuard aGuard( m_aMutex );
616 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
620 void SAL_CALL OResultSet::updateFloat( sal_Int32 columnIndex, float x ) throw(SQLException, RuntimeException)
622 ::osl::MutexGuard aGuard( m_aMutex );
623 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
628 void SAL_CALL OResultSet::updateDouble( sal_Int32 columnIndex, double x ) throw(SQLException, RuntimeException)
630 ::osl::MutexGuard aGuard( m_aMutex );
631 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
635 void SAL_CALL OResultSet::updateString( sal_Int32 columnIndex, const ::rtl::OUString& x ) throw(SQLException, RuntimeException)
637 ::osl::MutexGuard aGuard( m_aMutex );
638 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
642 void SAL_CALL OResultSet::updateBytes( sal_Int32 columnIndex, const Sequence< sal_Int8 >& x ) throw(SQLException, RuntimeException)
644 ::osl::MutexGuard aGuard( m_aMutex );
645 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
649 void SAL_CALL OResultSet::updateDate( sal_Int32 columnIndex, const Date& x ) throw(SQLException, RuntimeException)
651 ::osl::MutexGuard aGuard( m_aMutex );
652 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
657 void SAL_CALL OResultSet::updateTime( sal_Int32 columnIndex, const css::util::Time& x ) throw(SQLException, RuntimeException)
659 ::osl::MutexGuard aGuard( m_aMutex );
660 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
665 void SAL_CALL OResultSet::updateTimestamp( sal_Int32 columnIndex, const DateTime& x ) throw(SQLException, RuntimeException)
667 ::osl::MutexGuard aGuard( m_aMutex );
668 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
673 void SAL_CALL OResultSet::updateBinaryStream( sal_Int32 columnIndex, const Reference< XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException)
675 ::osl::MutexGuard aGuard( m_aMutex );
676 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
680 void SAL_CALL OResultSet::updateCharacterStream( sal_Int32 columnIndex, const Reference< XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException)
682 ::osl::MutexGuard aGuard( m_aMutex );
683 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
687 void SAL_CALL OResultSet::refreshRow( ) throw(SQLException, RuntimeException)
689 ::osl::MutexGuard aGuard( m_aMutex );
690 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
694 void SAL_CALL OResultSet::updateObject( sal_Int32 columnIndex, const Any& x ) throw(SQLException, RuntimeException)
696 ::osl::MutexGuard aGuard( m_aMutex );
697 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
702 void SAL_CALL OResultSet::updateNumericObject( sal_Int32 columnIndex, const Any& x, sal_Int32 scale ) throw(SQLException, RuntimeException)
704 ::osl::MutexGuard aGuard( m_aMutex );
705 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
709 // XRowLocate
710 Any SAL_CALL OResultSet::getBookmark( ) throw( SQLException, RuntimeException)
712 ::osl::MutexGuard aGuard( m_aMutex );
713 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
715 // if you don't want to support bookmark you must remove the XRowLocate interface
717 return Any();
720 sal_Bool SAL_CALL OResultSet::moveToBookmark( const Any& bookmark ) throw( SQLException, RuntimeException)
722 ::osl::MutexGuard aGuard( m_aMutex );
723 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
725 return sal_False;
728 sal_Bool SAL_CALL OResultSet::moveRelativeToBookmark( const Any& bookmark, sal_Int32 rows ) throw( SQLException, RuntimeException)
730 ::osl::MutexGuard aGuard( m_aMutex );
731 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
733 return sal_False;
736 sal_Int32 SAL_CALL OResultSet::compareBookmarks( const Any& first, const Any& second ) throw( SQLException, RuntimeException)
738 ::osl::MutexGuard aGuard( m_aMutex );
739 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
742 return CompareBookmark::NOT_EQUAL;
745 sal_Bool SAL_CALL OResultSet::hasOrderedBookmarks( ) throw( SQLException, RuntimeException)
747 return sal_False;
750 sal_Int32 SAL_CALL OResultSet::hashBookmark( const Any& bookmark ) throw( SQLException, RuntimeException)
752 throw SQLException();
755 // XDeleteRows
756 Sequence< sal_Int32 > SAL_CALL OResultSet::deleteRows( const Sequence< Any >& rows ) throw( SQLException, RuntimeException)
758 ::osl::MutexGuard aGuard( m_aMutex );
759 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
761 return Sequence< sal_Int32 >();
764 IPropertyArrayHelper* OResultSet::createArrayHelper( ) const
766 Sequence< Property > aProps(6);
767 Property* pProperties = aProps.getArray();
768 sal_Int32 nPos = 0;
769 pProperties[nPos++] = ::com::sun::star::beans::Property(OPropertyMap::getPropMap().getNameByIndex(PROPERTY_ID_CURSORNAME),
770 PROPERTY_ID_CURSORNAME, ::cppu::UnoType<rtl::OUString>::get(), PropertyAttribute::READONLY);
771 pProperties[nPos++] = ::com::sun::star::beans::Property(OPropertyMap::getPropMap().getNameByIndex(PROPERTY_ID_FETCHDIRECTION),
772 PROPERTY_ID_FETCHDIRECTION, ::cppu::UnoType<sal_Int32>::get(), 0);
773 pProperties[nPos++] = ::com::sun::star::beans::Property(OPropertyMap::getPropMap().getNameByIndex(PROPERTY_ID_FETCHSIZE),
774 PROPERTY_ID_FETCHSIZE, ::cppu::UnoType<sal_Int32>::get(), 0);
775 pProperties[nPos++] = ::com::sun::star::beans::Property(OPropertyMap::getPropMap().getNameByIndex(PROPERTY_ID_ISBOOKMARKABLE),
776 PROPERTY_ID_ISBOOKMARKABLE, cppu::UnoType<bool>::get(), PropertyAttribute::READONLY);
777 pProperties[nPos++] = ::com::sun::star::beans::Property(OPropertyMap::getPropMap().getNameByIndex(PROPERTY_ID_RESULTSETCONCURRENCY),
778 PROPERTY_ID_RESULTSETCONCURRENCY, ::cppu::UnoType<sal_Int32>::get(), PropertyAttribute::READONLY);
779 pProperties[nPos++] = ::com::sun::star::beans::Property(OPropertyMap::getPropMap().getNameByIndex(PROPERTY_ID_RESULTSETTYPE),
780 PROPERTY_ID_RESULTSETTYPE, ::cppu::UnoType<sal_Int32>::get(), PropertyAttribute::READONLY);
782 return new OPropertyArrayHelper(aProps);
785 IPropertyArrayHelper & OResultSet::getInfoHelper()
787 return *const_cast<OResultSet*>(this)->getArrayHelper();
790 sal_Bool OResultSet::convertFastPropertyValue(
791 Any & rConvertedValue,
792 Any & rOldValue,
793 sal_Int32 nHandle,
794 const Any& rValue )
795 throw (::com::sun::star::lang::IllegalArgumentException)
797 switch(nHandle)
799 case PROPERTY_ID_ISBOOKMARKABLE:
800 case PROPERTY_ID_CURSORNAME:
801 case PROPERTY_ID_RESULTSETCONCURRENCY:
802 case PROPERTY_ID_RESULTSETTYPE:
803 throw ::com::sun::star::lang::IllegalArgumentException();
804 break;
805 case PROPERTY_ID_FETCHDIRECTION:
806 case PROPERTY_ID_FETCHSIZE:
807 default:
810 return sal_False;
813 void OResultSet::setFastPropertyValue_NoBroadcast(
814 sal_Int32 nHandle,
815 const Any& rValue
817 throw (Exception)
819 switch(nHandle)
821 case PROPERTY_ID_ISBOOKMARKABLE:
822 case PROPERTY_ID_CURSORNAME:
823 case PROPERTY_ID_RESULTSETCONCURRENCY:
824 case PROPERTY_ID_RESULTSETTYPE:
825 throw Exception();
826 break;
827 case PROPERTY_ID_FETCHDIRECTION:
828 break;
829 case PROPERTY_ID_FETCHSIZE:
830 break;
831 default:
836 void OResultSet::getFastPropertyValue(
837 Any& rValue,
838 sal_Int32 nHandle
839 ) const
841 switch(nHandle)
843 case PROPERTY_ID_ISBOOKMARKABLE:
844 case PROPERTY_ID_CURSORNAME:
845 case PROPERTY_ID_RESULTSETCONCURRENCY:
846 case PROPERTY_ID_RESULTSETTYPE:
847 case PROPERTY_ID_FETCHDIRECTION:
848 case PROPERTY_ID_FETCHSIZE:
853 void SAL_CALL OResultSet::acquire() throw()
855 OResultSet_BASE::acquire();
858 void SAL_CALL OResultSet::release() throw()
860 OResultSet_BASE::release();
863 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OResultSet::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
865 return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
869 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */