1 /*************************************************************************
3 * $RCSfile: SResultSet.cxx,v $
7 * last change: $Author: rt $ $Date: 2008-04-10 16:35:24 $
9 * The Contents of this file are made available subject to the terms of
12 * Copyright (c) 2003 by Sun Microsystems, Inc.
13 * All rights reserved.
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in the
22 * documentation and/or other materials provided with the distribution.
23 * 3. Neither the name of Sun Microsystems, Inc. nor the names of its
24 * contributors may be used to endorse or promote products derived
25 * from this software without specific prior written permission.
27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
30 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
31 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
32 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
33 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
34 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
35 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
36 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
37 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *************************************************************************/
41 #include "SResultSet.hxx"
42 #include "SResultSetMetaData.hxx"
43 #include <com/sun/star/sdbc/DataType.hpp>
44 #include <com/sun/star/beans/PropertyAttribute.hpp>
45 #include <com/sun/star/sdbcx/CompareBookmark.hpp>
46 #include <cppuhelper/typeprovider.hxx>
47 #include <com/sun/star/lang/DisposedException.hpp>
48 #include "propertyids.hxx"
50 using namespace connectivity::skeleton
;
52 using namespace com::sun::star::uno
;
53 using namespace com::sun::star::lang
;
54 using namespace com::sun::star::beans
;
55 using namespace com::sun::star::sdbc
;
56 using namespace com::sun::star::sdbcx
;
57 using namespace com::sun::star::container
;
58 using namespace com::sun::star::io
;
59 using namespace com::sun::star::util
;
61 //------------------------------------------------------------------------------
62 // IMPLEMENT_SERVICE_INFO(OResultSet,"com.sun.star.sdbcx.OResultSet","com.sun.star.sdbc.ResultSet");
63 ::rtl::OUString SAL_CALL
OResultSet::getImplementationName( ) throw ( RuntimeException
) \
65 return ::rtl::OUString::createFromAscii("com.sun.star.sdbcx.skeleton.ResultSet");
67 // -------------------------------------------------------------------------
68 Sequence
< ::rtl::OUString
> SAL_CALL
OResultSet::getSupportedServiceNames( ) throw( RuntimeException
)
70 Sequence
< ::rtl::OUString
> aSupported(2);
71 aSupported
[0] = ::rtl::OUString::createFromAscii("com.sun.star.sdbc.ResultSet");
72 aSupported
[1] = ::rtl::OUString::createFromAscii("com.sun.star.sdbcx.ResultSet");
75 // -------------------------------------------------------------------------
76 sal_Bool SAL_CALL
OResultSet::supportsService( const ::rtl::OUString
& _rServiceName
) throw( RuntimeException
)
78 Sequence
< ::rtl::OUString
> aSupported(getSupportedServiceNames());
79 const ::rtl::OUString
* pSupported
= aSupported
.getConstArray();
80 const ::rtl::OUString
* pEnd
= pSupported
+ aSupported
.getLength();
81 for (;pSupported
!= pEnd
&& !pSupported
->equals(_rServiceName
); ++pSupported
)
84 return pSupported
!= pEnd
;
87 // -------------------------------------------------------------------------
88 OResultSet::OResultSet(OStatement_Base
* pStmt
)
89 : OResultSet_BASE(m_aMutex
)
90 ,OPropertySetHelper(OResultSet_BASE::rBHelper
)
91 ,m_aStatement((OWeakObject
*)pStmt
)
93 ,m_nTextEncoding(pStmt
->getOwnConnection()->getTextEncoding())
98 // -------------------------------------------------------------------------
99 OResultSet::~OResultSet()
102 // -------------------------------------------------------------------------
103 void OResultSet::disposing(void)
105 OPropertySetHelper::disposing();
107 ::osl::MutexGuard
aGuard(m_aMutex
);
112 // -------------------------------------------------------------------------
113 Any SAL_CALL
OResultSet::queryInterface( const Type
& rType
) throw(RuntimeException
)
115 Any aRet
= OPropertySetHelper::queryInterface(rType
);
117 aRet
= OResultSet_BASE::queryInterface(rType
);
120 // -------------------------------------------------------------------------
121 Sequence
< Type
> SAL_CALL
OResultSet::getTypes( ) throw( RuntimeException
)
123 OTypeCollection
aTypes(
124 ::cppu::UnoType
< Reference
< ::com::sun::star::beans::XMultiPropertySet
> >::get(),
125 ::cppu::UnoType
< Reference
< ::com::sun::star::beans::XFastPropertySet
> >::get(),
126 ::cppu::UnoType
< Reference
< ::com::sun::star::beans::XPropertySet
> >::get());
128 return concatSequences(aTypes
.getTypes(),OResultSet_BASE::getTypes());
130 // -------------------------------------------------------------------------
132 sal_Int32 SAL_CALL
OResultSet::findColumn( const ::rtl::OUString
& columnName
) throw(SQLException
, RuntimeException
)
135 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
137 // find the first column with the name columnName
139 ::osl::MutexGuard
aGuard( m_aMutex
);
141 Reference
< XResultSetMetaData
> xMeta
= getMetaData();
142 sal_Int32 nLen
= xMeta
->getColumnCount();
145 if(xMeta
->isCaseSensitive(i
) ? columnName
== xMeta
->getColumnName(i
) :
146 columnName
.equalsIgnoreAsciiCase(xMeta
->getColumnName(i
)))
150 // -------------------------------------------------------------------------
151 Reference
< XInputStream
> SAL_CALL
OResultSet::getBinaryStream( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
)
153 ::osl::MutexGuard
aGuard( m_aMutex
);
154 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
159 // -------------------------------------------------------------------------
160 Reference
< XInputStream
> SAL_CALL
OResultSet::getCharacterStream( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
)
162 ::osl::MutexGuard
aGuard( m_aMutex
);
163 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
169 // -------------------------------------------------------------------------
170 sal_Bool SAL_CALL
OResultSet::getBoolean( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
)
172 ::osl::MutexGuard
aGuard( m_aMutex
);
173 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
177 // -------------------------------------------------------------------------
179 sal_Int8 SAL_CALL
OResultSet::getByte( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
)
181 ::osl::MutexGuard
aGuard( m_aMutex
);
182 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
188 // -------------------------------------------------------------------------
190 Sequence
< sal_Int8
> SAL_CALL
OResultSet::getBytes( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
)
193 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
194 ::osl::MutexGuard
aGuard( m_aMutex
);
196 return Sequence
< sal_Int8
>();
198 // -------------------------------------------------------------------------
200 Date SAL_CALL
OResultSet::getDate( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
)
202 ::osl::MutexGuard
aGuard( m_aMutex
);
203 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
209 // -------------------------------------------------------------------------
211 double SAL_CALL
OResultSet::getDouble( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
)
213 ::osl::MutexGuard
aGuard( m_aMutex
);
214 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
220 // -------------------------------------------------------------------------
222 float SAL_CALL
OResultSet::getFloat( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
)
224 ::osl::MutexGuard
aGuard( m_aMutex
);
225 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
231 // -------------------------------------------------------------------------
233 sal_Int32 SAL_CALL
OResultSet::getInt( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
)
235 ::osl::MutexGuard
aGuard( m_aMutex
);
236 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
241 // -------------------------------------------------------------------------
243 sal_Int32 SAL_CALL
OResultSet::getRow( ) throw(SQLException
, RuntimeException
)
245 ::osl::MutexGuard
aGuard( m_aMutex
);
246 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
248 sal_Int32 nValue
= 0;
251 // -------------------------------------------------------------------------
253 sal_Int64 SAL_CALL
OResultSet::getLong( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
)
255 ::osl::MutexGuard
aGuard( m_aMutex
);
256 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
260 // -------------------------------------------------------------------------
262 Reference
< XResultSetMetaData
> SAL_CALL
OResultSet::getMetaData( ) throw(SQLException
, RuntimeException
)
264 ::osl::MutexGuard
aGuard( m_aMutex
);
265 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
268 if(!m_xMetaData
.is())
269 m_xMetaData
= new OResultSetMetaData(m_pStatement
->getOwnConnection());
272 // -------------------------------------------------------------------------
273 Reference
< XArray
> SAL_CALL
OResultSet::getArray( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
)
275 ::osl::MutexGuard
aGuard( m_aMutex
);
276 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
281 // -------------------------------------------------------------------------
283 Reference
< XClob
> SAL_CALL
OResultSet::getClob( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
)
285 ::osl::MutexGuard
aGuard( m_aMutex
);
286 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
290 // -------------------------------------------------------------------------
291 Reference
< XBlob
> SAL_CALL
OResultSet::getBlob( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
)
293 ::osl::MutexGuard
aGuard( m_aMutex
);
294 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
298 // -------------------------------------------------------------------------
300 Reference
< XRef
> SAL_CALL
OResultSet::getRef( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
)
302 ::osl::MutexGuard
aGuard( m_aMutex
);
303 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
307 // -------------------------------------------------------------------------
309 Any SAL_CALL
OResultSet::getObject( sal_Int32 columnIndex
, const Reference
< ::com::sun::star::container::XNameAccess
>& typeMap
) throw(SQLException
, RuntimeException
)
311 ::osl::MutexGuard
aGuard( m_aMutex
);
312 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
316 // -------------------------------------------------------------------------
318 sal_Int16 SAL_CALL
OResultSet::getShort( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
)
320 ::osl::MutexGuard
aGuard( m_aMutex
);
321 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
327 // -------------------------------------------------------------------------
330 ::rtl::OUString SAL_CALL
OResultSet::getString( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
)
332 ::osl::MutexGuard
aGuard( m_aMutex
);
333 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
336 ::rtl::OUString nRet
;
339 // -------------------------------------------------------------------------
341 Time SAL_CALL
OResultSet::getTime( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
)
343 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
345 ::osl::MutexGuard
aGuard( m_aMutex
);
350 // -------------------------------------------------------------------------
353 DateTime SAL_CALL
OResultSet::getTimestamp( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
)
355 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
358 ::osl::MutexGuard
aGuard( m_aMutex
);
363 // -------------------------------------------------------------------------
365 sal_Bool SAL_CALL
OResultSet::isBeforeFirst( ) throw(SQLException
, RuntimeException
)
367 ::osl::MutexGuard
aGuard( m_aMutex
);
368 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
371 // here you have to implement your movements
372 // return true means there is no data
375 // -------------------------------------------------------------------------
376 sal_Bool SAL_CALL
OResultSet::isAfterLast( ) throw(SQLException
, RuntimeException
)
378 ::osl::MutexGuard
aGuard( m_aMutex
);
379 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
383 // -------------------------------------------------------------------------
384 sal_Bool SAL_CALL
OResultSet::isFirst( ) throw(SQLException
, RuntimeException
)
386 ::osl::MutexGuard
aGuard( m_aMutex
);
387 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
392 // -------------------------------------------------------------------------
393 sal_Bool SAL_CALL
OResultSet::isLast( ) throw(SQLException
, RuntimeException
)
395 ::osl::MutexGuard
aGuard( m_aMutex
);
396 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
401 // -------------------------------------------------------------------------
402 void SAL_CALL
OResultSet::beforeFirst( ) throw(SQLException
, RuntimeException
)
404 ::osl::MutexGuard
aGuard( m_aMutex
);
405 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
407 // move before the first row so that isBeforeFirst returns false
408 // the smae for other movement methods
410 // -------------------------------------------------------------------------
411 void SAL_CALL
OResultSet::afterLast( ) throw(SQLException
, RuntimeException
)
413 ::osl::MutexGuard
aGuard( m_aMutex
);
414 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
416 // -------------------------------------------------------------------------
418 void SAL_CALL
OResultSet::close( ) throw(SQLException
, RuntimeException
)
421 ::osl::MutexGuard
aGuard( m_aMutex
);
422 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
427 // -------------------------------------------------------------------------
429 sal_Bool SAL_CALL
OResultSet::first( ) throw(SQLException
, RuntimeException
)
431 ::osl::MutexGuard
aGuard( m_aMutex
);
432 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
436 // -------------------------------------------------------------------------
438 sal_Bool SAL_CALL
OResultSet::last( ) throw(SQLException
, RuntimeException
)
440 ::osl::MutexGuard
aGuard( m_aMutex
);
441 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
445 // -------------------------------------------------------------------------
446 sal_Bool SAL_CALL
OResultSet::absolute( sal_Int32 row
) throw(SQLException
, RuntimeException
)
448 ::osl::MutexGuard
aGuard( m_aMutex
);
449 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
453 // -------------------------------------------------------------------------
454 sal_Bool SAL_CALL
OResultSet::relative( sal_Int32 row
) throw(SQLException
, RuntimeException
)
456 ::osl::MutexGuard
aGuard( m_aMutex
);
457 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
461 // -------------------------------------------------------------------------
462 sal_Bool SAL_CALL
OResultSet::previous( ) throw(SQLException
, RuntimeException
)
464 ::osl::MutexGuard
aGuard( m_aMutex
);
465 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
469 // -------------------------------------------------------------------------
470 Reference
< XInterface
> SAL_CALL
OResultSet::getStatement( ) throw(SQLException
, RuntimeException
)
472 ::osl::MutexGuard
aGuard( m_aMutex
);
473 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
476 return m_aStatement
.get();
478 // -------------------------------------------------------------------------
480 sal_Bool SAL_CALL
OResultSet::rowDeleted( ) throw(SQLException
, RuntimeException
)
482 ::osl::MutexGuard
aGuard( m_aMutex
);
483 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
488 // -------------------------------------------------------------------------
489 sal_Bool SAL_CALL
OResultSet::rowInserted( ) throw(SQLException
, RuntimeException
)
491 ::osl::MutexGuard
aGuard( m_aMutex
);
492 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
497 // -------------------------------------------------------------------------
498 sal_Bool SAL_CALL
OResultSet::rowUpdated( ) throw(SQLException
, RuntimeException
)
500 ::osl::MutexGuard
aGuard( m_aMutex
);
501 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
506 // -------------------------------------------------------------------------
508 sal_Bool SAL_CALL
OResultSet::next( ) throw(SQLException
, RuntimeException
)
510 ::osl::MutexGuard
aGuard( m_aMutex
);
511 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
516 // -------------------------------------------------------------------------
518 sal_Bool SAL_CALL
OResultSet::wasNull( ) throw(SQLException
, RuntimeException
)
520 ::osl::MutexGuard
aGuard( m_aMutex
);
521 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
526 // -------------------------------------------------------------------------
528 void SAL_CALL
OResultSet::cancel( ) throw(RuntimeException
)
530 ::osl::MutexGuard
aGuard( m_aMutex
);
531 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
534 // -------------------------------------------------------------------------
535 void SAL_CALL
OResultSet::clearWarnings( ) throw(SQLException
, RuntimeException
)
538 // -------------------------------------------------------------------------
539 Any SAL_CALL
OResultSet::getWarnings( ) throw(SQLException
, RuntimeException
)
543 // -------------------------------------------------------------------------
544 void SAL_CALL
OResultSet::insertRow( ) throw(SQLException
, RuntimeException
)
546 ::osl::MutexGuard
aGuard( m_aMutex
);
547 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
549 // you only have to implement this if you want to insert new rows
551 // -------------------------------------------------------------------------
552 void SAL_CALL
OResultSet::updateRow( ) throw(SQLException
, RuntimeException
)
554 ::osl::MutexGuard
aGuard( m_aMutex
);
555 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
558 // only when you allow updates
560 // -------------------------------------------------------------------------
561 void SAL_CALL
OResultSet::deleteRow( ) throw(SQLException
, RuntimeException
)
563 ::osl::MutexGuard
aGuard( m_aMutex
);
564 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
566 // -------------------------------------------------------------------------
568 void SAL_CALL
OResultSet::cancelRowUpdates( ) throw(SQLException
, RuntimeException
)
570 ::osl::MutexGuard
aGuard( m_aMutex
);
571 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
573 // -------------------------------------------------------------------------
575 void SAL_CALL
OResultSet::moveToInsertRow( ) throw(SQLException
, RuntimeException
)
577 ::osl::MutexGuard
aGuard( m_aMutex
);
578 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
581 // only when you allow insert's
583 // -------------------------------------------------------------------------
585 void SAL_CALL
OResultSet::moveToCurrentRow( ) throw(SQLException
, RuntimeException
)
587 ::osl::MutexGuard
aGuard( m_aMutex
);
588 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
590 // -------------------------------------------------------------------------
592 void SAL_CALL
OResultSet::updateNull( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
)
594 ::osl::MutexGuard
aGuard( m_aMutex
);
595 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
597 // -------------------------------------------------------------------------
599 void SAL_CALL
OResultSet::updateBoolean( sal_Int32 columnIndex
, sal_Bool x
) throw(SQLException
, RuntimeException
)
601 ::osl::MutexGuard
aGuard( m_aMutex
);
602 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
605 // -------------------------------------------------------------------------
606 void SAL_CALL
OResultSet::updateByte( sal_Int32 columnIndex
, sal_Int8 x
) throw(SQLException
, RuntimeException
)
608 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
609 ::osl::MutexGuard
aGuard( m_aMutex
);
612 // -------------------------------------------------------------------------
614 void SAL_CALL
OResultSet::updateShort( sal_Int32 columnIndex
, sal_Int16 x
) throw(SQLException
, RuntimeException
)
616 ::osl::MutexGuard
aGuard( m_aMutex
);
617 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
620 // -------------------------------------------------------------------------
621 void SAL_CALL
OResultSet::updateInt( sal_Int32 columnIndex
, sal_Int32 x
) throw(SQLException
, RuntimeException
)
623 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
624 ::osl::MutexGuard
aGuard( m_aMutex
);
627 // -------------------------------------------------------------------------
628 void SAL_CALL
OResultSet::updateLong( sal_Int32 columnIndex
, sal_Int64 x
) throw(SQLException
, RuntimeException
)
630 ::osl::MutexGuard
aGuard( m_aMutex
);
631 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
634 // -----------------------------------------------------------------------
635 void SAL_CALL
OResultSet::updateFloat( sal_Int32 columnIndex
, float x
) throw(SQLException
, RuntimeException
)
637 ::osl::MutexGuard
aGuard( m_aMutex
);
638 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
641 // -------------------------------------------------------------------------
643 void SAL_CALL
OResultSet::updateDouble( sal_Int32 columnIndex
, double x
) throw(SQLException
, RuntimeException
)
645 ::osl::MutexGuard
aGuard( m_aMutex
);
646 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
649 // -------------------------------------------------------------------------
650 void SAL_CALL
OResultSet::updateString( sal_Int32 columnIndex
, const ::rtl::OUString
& x
) throw(SQLException
, RuntimeException
)
652 ::osl::MutexGuard
aGuard( m_aMutex
);
653 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
656 // -------------------------------------------------------------------------
657 void SAL_CALL
OResultSet::updateBytes( sal_Int32 columnIndex
, const Sequence
< sal_Int8
>& x
) throw(SQLException
, RuntimeException
)
659 ::osl::MutexGuard
aGuard( m_aMutex
);
660 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
663 // -------------------------------------------------------------------------
664 void SAL_CALL
OResultSet::updateDate( sal_Int32 columnIndex
, const Date
& x
) throw(SQLException
, RuntimeException
)
666 ::osl::MutexGuard
aGuard( m_aMutex
);
667 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
670 // -------------------------------------------------------------------------
672 void SAL_CALL
OResultSet::updateTime( sal_Int32 columnIndex
, const Time
& x
) throw(SQLException
, RuntimeException
)
674 ::osl::MutexGuard
aGuard( m_aMutex
);
675 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
678 // -------------------------------------------------------------------------
680 void SAL_CALL
OResultSet::updateTimestamp( sal_Int32 columnIndex
, const DateTime
& x
) throw(SQLException
, RuntimeException
)
682 ::osl::MutexGuard
aGuard( m_aMutex
);
683 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
686 // -------------------------------------------------------------------------
688 void SAL_CALL
OResultSet::updateBinaryStream( sal_Int32 columnIndex
, const Reference
< XInputStream
>& x
, sal_Int32 length
) throw(SQLException
, RuntimeException
)
690 ::osl::MutexGuard
aGuard( m_aMutex
);
691 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
694 // -------------------------------------------------------------------------
695 void SAL_CALL
OResultSet::updateCharacterStream( sal_Int32 columnIndex
, const Reference
< XInputStream
>& x
, sal_Int32 length
) throw(SQLException
, RuntimeException
)
697 ::osl::MutexGuard
aGuard( m_aMutex
);
698 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
701 // -------------------------------------------------------------------------
702 void SAL_CALL
OResultSet::refreshRow( ) throw(SQLException
, RuntimeException
)
704 ::osl::MutexGuard
aGuard( m_aMutex
);
705 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
708 // -------------------------------------------------------------------------
709 void SAL_CALL
OResultSet::updateObject( sal_Int32 columnIndex
, const Any
& x
) throw(SQLException
, RuntimeException
)
711 ::osl::MutexGuard
aGuard( m_aMutex
);
712 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
715 // -------------------------------------------------------------------------
717 void SAL_CALL
OResultSet::updateNumericObject( sal_Int32 columnIndex
, const Any
& x
, sal_Int32 scale
) throw(SQLException
, RuntimeException
)
719 ::osl::MutexGuard
aGuard( m_aMutex
);
720 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
723 // -------------------------------------------------------------------------
725 Any SAL_CALL
OResultSet::getBookmark( ) throw( SQLException
, RuntimeException
)
727 ::osl::MutexGuard
aGuard( m_aMutex
);
728 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
730 // if you don't want to support bookmark you must remove the XRowLocate interface
734 // -------------------------------------------------------------------------
735 sal_Bool SAL_CALL
OResultSet::moveToBookmark( const Any
& bookmark
) throw( SQLException
, RuntimeException
)
737 ::osl::MutexGuard
aGuard( m_aMutex
);
738 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
742 // -------------------------------------------------------------------------
743 sal_Bool SAL_CALL
OResultSet::moveRelativeToBookmark( const Any
& bookmark
, sal_Int32 rows
) throw( SQLException
, RuntimeException
)
745 ::osl::MutexGuard
aGuard( m_aMutex
);
746 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
750 // -------------------------------------------------------------------------
751 sal_Int32 SAL_CALL
OResultSet::compareBookmarks( const Any
& first
, const Any
& second
) throw( SQLException
, RuntimeException
)
753 ::osl::MutexGuard
aGuard( m_aMutex
);
754 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
757 return CompareBookmark::NOT_EQUAL
;
759 // -------------------------------------------------------------------------
760 sal_Bool SAL_CALL
OResultSet::hasOrderedBookmarks( ) throw( SQLException
, RuntimeException
)
764 // -------------------------------------------------------------------------
765 sal_Int32 SAL_CALL
OResultSet::hashBookmark( const Any
& bookmark
) throw( SQLException
, RuntimeException
)
767 throw SQLException();
769 // -------------------------------------------------------------------------
771 Sequence
< sal_Int32
> SAL_CALL
OResultSet::deleteRows( const Sequence
< Any
>& rows
) throw( SQLException
, RuntimeException
)
773 ::osl::MutexGuard
aGuard( m_aMutex
);
774 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
776 return Sequence
< sal_Int32
>();
778 // -------------------------------------------------------------------------
779 IPropertyArrayHelper
* OResultSet::createArrayHelper( ) const
781 Sequence
< Property
> aProps(6);
782 Property
* pProperties
= aProps
.getArray();
784 DECL_PROP1IMPL(CURSORNAME
, ::rtl::OUString
) PropertyAttribute::READONLY
);
785 DECL_PROP0(FETCHDIRECTION
, sal_Int32
);
786 DECL_PROP0(FETCHSIZE
, sal_Int32
);
787 DECL_BOOL_PROP1IMPL(ISBOOKMARKABLE
) PropertyAttribute::READONLY
);
788 DECL_PROP1IMPL(RESULTSETCONCURRENCY
,sal_Int32
) PropertyAttribute::READONLY
);
789 DECL_PROP1IMPL(RESULTSETTYPE
, sal_Int32
) PropertyAttribute::READONLY
);
791 return new OPropertyArrayHelper(aProps
);
793 // -------------------------------------------------------------------------
794 IPropertyArrayHelper
& OResultSet::getInfoHelper()
796 return *const_cast<OResultSet
*>(this)->getArrayHelper();
798 // -------------------------------------------------------------------------
799 sal_Bool
OResultSet::convertFastPropertyValue(
800 Any
& rConvertedValue
,
804 throw (::com::sun::star::lang::IllegalArgumentException
)
808 case PROPERTY_ID_ISBOOKMARKABLE
:
809 case PROPERTY_ID_CURSORNAME
:
810 case PROPERTY_ID_RESULTSETCONCURRENCY
:
811 case PROPERTY_ID_RESULTSETTYPE
:
812 throw ::com::sun::star::lang::IllegalArgumentException();
814 case PROPERTY_ID_FETCHDIRECTION
:
815 case PROPERTY_ID_FETCHSIZE
:
821 // -------------------------------------------------------------------------
822 void OResultSet::setFastPropertyValue_NoBroadcast(
830 case PROPERTY_ID_ISBOOKMARKABLE
:
831 case PROPERTY_ID_CURSORNAME
:
832 case PROPERTY_ID_RESULTSETCONCURRENCY
:
833 case PROPERTY_ID_RESULTSETTYPE
:
836 case PROPERTY_ID_FETCHDIRECTION
:
838 case PROPERTY_ID_FETCHSIZE
:
844 // -------------------------------------------------------------------------
845 void OResultSet::getFastPropertyValue(
852 case PROPERTY_ID_ISBOOKMARKABLE
:
853 case PROPERTY_ID_CURSORNAME
:
854 case PROPERTY_ID_RESULTSETCONCURRENCY
:
855 case PROPERTY_ID_RESULTSETTYPE
:
856 case PROPERTY_ID_FETCHDIRECTION
:
857 case PROPERTY_ID_FETCHSIZE
:
861 // -----------------------------------------------------------------------------
862 void SAL_CALL
OResultSet::acquire() throw()
864 OResultSet_BASE::acquire();
866 // -----------------------------------------------------------------------------
867 void SAL_CALL
OResultSet::release() throw()
869 OResultSet_BASE::release();
871 // -----------------------------------------------------------------------------
872 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
OResultSet::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException
)
874 return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
876 // -----------------------------------------------------------------------------