xref: /trunk/main/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1 /*************************************************************************
2  *
3  *  The Contents of this file are made available subject to the terms of
4  *  the BSD license.
5  *
6  *  Copyright 2000, 2010 Oracle and/or its affiliates.
7  *  All rights reserved.
8  *
9  *  Redistribution and use in source and binary forms, with or without
10  *  modification, are permitted provided that the following conditions
11  *  are met:
12  *  1. Redistributions of source code must retain the above copyright
13  *     notice, this list of conditions and the following disclaimer.
14  *  2. Redistributions in binary form must reproduce the above copyright
15  *     notice, this list of conditions and the following disclaimer in the
16  *     documentation and/or other materials provided with the distribution.
17  *  3. Neither the name of Sun Microsystems, Inc. nor the names of its
18  *     contributors may be used to endorse or promote products derived
19  *     from this software without specific prior written permission.
20  *
21  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28  *  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29  *  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
30  *  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
31  *  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  *
33  *************************************************************************/
34 
35 #include "SResultSet.hxx"
36 #include "SResultSetMetaData.hxx"
37 #include <com/sun/star/sdbc/DataType.hpp>
38 #include <com/sun/star/beans/PropertyAttribute.hpp>
39 #include <com/sun/star/sdbcx/CompareBookmark.hpp>
40 #include <cppuhelper/typeprovider.hxx>
41 #include <com/sun/star/lang/DisposedException.hpp>
42 #include "propertyids.hxx"
43 
44 using namespace connectivity::skeleton;
45 using namespace cppu;
46 using namespace com::sun::star::uno;
47 using namespace com::sun::star::lang;
48 using namespace com::sun::star::beans;
49 using namespace com::sun::star::sdbc;
50 using namespace com::sun::star::sdbcx;
51 using namespace com::sun::star::container;
52 using namespace com::sun::star::io;
53 using namespace com::sun::star::util;
54 
55 //------------------------------------------------------------------------------
56 //  IMPLEMENT_SERVICE_INFO(OResultSet,"com.sun.star.sdbcx.OResultSet","com.sun.star.sdbc.ResultSet");
57 ::rtl::OUString SAL_CALL OResultSet::getImplementationName(  ) throw ( RuntimeException)    \
58 {
59     return ::rtl::OUString::createFromAscii("com.sun.star.sdbcx.skeleton.ResultSet");
60 }
61 // -------------------------------------------------------------------------
62  Sequence< ::rtl::OUString > SAL_CALL OResultSet::getSupportedServiceNames(  ) throw( RuntimeException)
63 {
64      Sequence< ::rtl::OUString > aSupported(2);
65     aSupported[0] = ::rtl::OUString::createFromAscii("com.sun.star.sdbc.ResultSet");
66     aSupported[1] = ::rtl::OUString::createFromAscii("com.sun.star.sdbcx.ResultSet");
67     return aSupported;
68 }
69 // -------------------------------------------------------------------------
70 sal_Bool SAL_CALL OResultSet::supportsService( const ::rtl::OUString& _rServiceName ) throw( RuntimeException)
71 {
72     Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
73     const ::rtl::OUString* pSupported = aSupported.getConstArray();
74     const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
75     for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
76         ;
77 
78     return pSupported != pEnd;
79 }
80 
81 // -------------------------------------------------------------------------
82 OResultSet::OResultSet(OStatement_Base* pStmt)
83     : OResultSet_BASE(m_aMutex)
84     ,OPropertySetHelper(OResultSet_BASE::rBHelper)
85     ,m_aStatement((OWeakObject*)pStmt)
86     ,m_xMetaData(NULL)
87     ,m_nTextEncoding(pStmt->getOwnConnection()->getTextEncoding())
88     ,m_pStatement(pStmt)
89     ,m_bWasNull(sal_True)
90 {
91 }
92 // -------------------------------------------------------------------------
93 OResultSet::~OResultSet()
94 {
95 }
96 // -------------------------------------------------------------------------
97 void OResultSet::disposing(void)
98 {
99     OPropertySetHelper::disposing();
100 
101     ::osl::MutexGuard aGuard(m_aMutex);
102 
103     m_aStatement    = NULL;
104     m_xMetaData     = NULL;
105 }
106 // -------------------------------------------------------------------------
107 Any SAL_CALL OResultSet::queryInterface( const Type & rType ) throw(RuntimeException)
108 {
109     Any aRet = OPropertySetHelper::queryInterface(rType);
110     if(!aRet.hasValue())
111         aRet = OResultSet_BASE::queryInterface(rType);
112     return aRet;
113 }
114 // -------------------------------------------------------------------------
115  Sequence<  Type > SAL_CALL OResultSet::getTypes(  ) throw( RuntimeException)
116 {
117     OTypeCollection aTypes(
118         ::cppu::UnoType< Reference< ::com::sun::star::beans::XMultiPropertySet > >::get(),
119         ::cppu::UnoType< Reference< ::com::sun::star::beans::XFastPropertySet > >::get(),
120         ::cppu::UnoType< Reference< ::com::sun::star::beans::XPropertySet > >::get());
121 
122     return concatSequences(aTypes.getTypes(),OResultSet_BASE::getTypes());
123 }
124 // -------------------------------------------------------------------------
125 
126 sal_Int32 SAL_CALL OResultSet::findColumn( const ::rtl::OUString& columnName ) throw(SQLException, RuntimeException)
127 {
128 
129     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
130 
131     // find the first column with the name columnName
132 
133     ::osl::MutexGuard aGuard( m_aMutex );
134 
135     Reference< XResultSetMetaData > xMeta = getMetaData();
136     sal_Int32 nLen = xMeta->getColumnCount();
137     sal_Int32 i = 1;
138     for(;i<=nLen;++i)
139         if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
140                 columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
141             break;
142     return i;
143 }
144 // -------------------------------------------------------------------------
145 Reference< XInputStream > SAL_CALL OResultSet::getBinaryStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
146 {
147     ::osl::MutexGuard aGuard( m_aMutex );
148     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
149 
150 
151     return NULL;
152 }
153 // -------------------------------------------------------------------------
154 Reference< XInputStream > SAL_CALL OResultSet::getCharacterStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
155 {
156     ::osl::MutexGuard aGuard( m_aMutex );
157     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
158 
159 
160     return NULL;
161 }
162 
163 // -------------------------------------------------------------------------
164 sal_Bool SAL_CALL OResultSet::getBoolean( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
165 {
166     ::osl::MutexGuard aGuard( m_aMutex );
167     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
168 
169     return sal_False;
170 }
171 // -------------------------------------------------------------------------
172 
173 sal_Int8 SAL_CALL OResultSet::getByte( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
174 {
175     ::osl::MutexGuard aGuard( m_aMutex );
176     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
177 
178 
179     sal_Int8 nRet = 0;
180     return nRet;
181 }
182 // -------------------------------------------------------------------------
183 
184 Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
185 {
186 
187     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
188     ::osl::MutexGuard aGuard( m_aMutex );
189 
190     return Sequence< sal_Int8 >();
191 }
192 // -------------------------------------------------------------------------
193 
194 Date SAL_CALL OResultSet::getDate( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
195 {
196     ::osl::MutexGuard aGuard( m_aMutex );
197     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
198 
199 
200     Date nRet;
201     return nRet;
202 }
203 // -------------------------------------------------------------------------
204 
205 double SAL_CALL OResultSet::getDouble( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
206 {
207     ::osl::MutexGuard aGuard( m_aMutex );
208     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
209 
210 
211     double nRet = 0;
212     return nRet;
213 }
214 // -------------------------------------------------------------------------
215 
216 float SAL_CALL OResultSet::getFloat( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
217 {
218     ::osl::MutexGuard aGuard( m_aMutex );
219     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
220 
221 
222     float nVal(0);
223     return nVal;
224 }
225 // -------------------------------------------------------------------------
226 
227 sal_Int32 SAL_CALL OResultSet::getInt( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
228 {
229     ::osl::MutexGuard aGuard( m_aMutex );
230     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
231 
232     sal_Int32 nRet=0;
233     return nRet;
234 }
235 // -------------------------------------------------------------------------
236 
237 sal_Int32 SAL_CALL OResultSet::getRow(  ) throw(SQLException, RuntimeException)
238 {
239     ::osl::MutexGuard aGuard( m_aMutex );
240     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
241 
242     sal_Int32 nValue = 0;
243     return nValue;
244 }
245 // -------------------------------------------------------------------------
246 
247 sal_Int64 SAL_CALL OResultSet::getLong( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
248 {
249     ::osl::MutexGuard aGuard( m_aMutex );
250     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
251 
252     return sal_Int64();
253 }
254 // -------------------------------------------------------------------------
255 
256 Reference< XResultSetMetaData > SAL_CALL OResultSet::getMetaData(  ) throw(SQLException, RuntimeException)
257 {
258     ::osl::MutexGuard aGuard( m_aMutex );
259     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
260 
261 
262     if(!m_xMetaData.is())
263         m_xMetaData = new OResultSetMetaData(m_pStatement->getOwnConnection());
264     return m_xMetaData;
265 }
266 // -------------------------------------------------------------------------
267 Reference< XArray > SAL_CALL OResultSet::getArray( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
268 {
269     ::osl::MutexGuard aGuard( m_aMutex );
270     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
271 
272     return NULL;
273 }
274 
275 // -------------------------------------------------------------------------
276 
277 Reference< XClob > SAL_CALL OResultSet::getClob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
278 {
279     ::osl::MutexGuard aGuard( m_aMutex );
280     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
281 
282     return NULL;
283 }
284 // -------------------------------------------------------------------------
285 Reference< XBlob > SAL_CALL OResultSet::getBlob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
286 {
287     ::osl::MutexGuard aGuard( m_aMutex );
288     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
289 
290     return NULL;
291 }
292 // -------------------------------------------------------------------------
293 
294 Reference< XRef > SAL_CALL OResultSet::getRef( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
295 {
296     ::osl::MutexGuard aGuard( m_aMutex );
297     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
298 
299     return NULL;
300 }
301 // -------------------------------------------------------------------------
302 
303 Any SAL_CALL OResultSet::getObject( sal_Int32 columnIndex, const Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(SQLException, RuntimeException)
304 {
305     ::osl::MutexGuard aGuard( m_aMutex );
306     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
307 
308     return Any();
309 }
310 // -------------------------------------------------------------------------
311 
312 sal_Int16 SAL_CALL OResultSet::getShort( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
313 {
314     ::osl::MutexGuard aGuard( m_aMutex );
315     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
316 
317 
318     sal_Int16 nRet=0;
319     return nRet;
320 }
321 // -------------------------------------------------------------------------
322 
323 
324 ::rtl::OUString SAL_CALL OResultSet::getString( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
325 {
326     ::osl::MutexGuard aGuard( m_aMutex );
327     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
328 
329 
330     ::rtl::OUString nRet;
331     return nRet;
332 }
333 // -------------------------------------------------------------------------
334 
335 Time SAL_CALL OResultSet::getTime( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
336 {
337     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
338 
339     ::osl::MutexGuard aGuard( m_aMutex );
340 
341     Time nRet;
342     return nRet;
343 }
344 // -------------------------------------------------------------------------
345 
346 
347 DateTime SAL_CALL OResultSet::getTimestamp( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
348 {
349     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
350 
351 
352     ::osl::MutexGuard aGuard( m_aMutex );
353 
354     DateTime nRet;
355     return nRet;
356 }
357 // -------------------------------------------------------------------------
358 
359 sal_Bool SAL_CALL OResultSet::isBeforeFirst(  ) throw(SQLException, RuntimeException)
360 {
361     ::osl::MutexGuard aGuard( m_aMutex );
362     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
363 
364 
365     // here you have to implement your movements
366     // return true means there is no data
367     return sal_True;
368 }
369 // -------------------------------------------------------------------------
370 sal_Bool SAL_CALL OResultSet::isAfterLast(  ) throw(SQLException, RuntimeException)
371 {
372     ::osl::MutexGuard aGuard( m_aMutex );
373     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
374 
375     return sal_True;
376 }
377 // -------------------------------------------------------------------------
378 sal_Bool SAL_CALL OResultSet::isFirst(  ) throw(SQLException, RuntimeException)
379 {
380     ::osl::MutexGuard aGuard( m_aMutex );
381     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
382 
383 
384     return sal_False;
385 }
386 // -------------------------------------------------------------------------
387 sal_Bool SAL_CALL OResultSet::isLast(  ) throw(SQLException, RuntimeException)
388 {
389     ::osl::MutexGuard aGuard( m_aMutex );
390     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
391 
392 
393     return sal_False;
394 }
395 // -------------------------------------------------------------------------
396 void SAL_CALL OResultSet::beforeFirst(  ) throw(SQLException, RuntimeException)
397 {
398     ::osl::MutexGuard aGuard( m_aMutex );
399     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
400 
401     // move before the first row so that isBeforeFirst returns false
402     // the smae for other movement methods
403 }
404 // -------------------------------------------------------------------------
405 void SAL_CALL OResultSet::afterLast(  ) throw(SQLException, RuntimeException)
406 {
407     ::osl::MutexGuard aGuard( m_aMutex );
408     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
409 }
410 // -------------------------------------------------------------------------
411 
412 void SAL_CALL OResultSet::close(  ) throw(SQLException, RuntimeException)
413 {
414     {
415         ::osl::MutexGuard aGuard( m_aMutex );
416         checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
417 
418     }
419     dispose();
420 }
421 // -------------------------------------------------------------------------
422 
423 sal_Bool SAL_CALL OResultSet::first(  ) throw(SQLException, RuntimeException)
424 {
425     ::osl::MutexGuard aGuard( m_aMutex );
426     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
427 
428     return sal_False;
429 }
430 // -------------------------------------------------------------------------
431 
432 sal_Bool SAL_CALL OResultSet::last(  ) throw(SQLException, RuntimeException)
433 {
434     ::osl::MutexGuard aGuard( m_aMutex );
435     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
436 
437     return sal_False;
438 }
439 // -------------------------------------------------------------------------
440 sal_Bool SAL_CALL OResultSet::absolute( sal_Int32 row ) throw(SQLException, RuntimeException)
441 {
442     ::osl::MutexGuard aGuard( m_aMutex );
443     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
444 
445     return sal_False;
446 }
447 // -------------------------------------------------------------------------
448 sal_Bool SAL_CALL OResultSet::relative( sal_Int32 row ) throw(SQLException, RuntimeException)
449 {
450     ::osl::MutexGuard aGuard( m_aMutex );
451     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
452 
453     return sal_False;
454 }
455 // -------------------------------------------------------------------------
456 sal_Bool SAL_CALL OResultSet::previous(  ) throw(SQLException, RuntimeException)
457 {
458     ::osl::MutexGuard aGuard( m_aMutex );
459     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
460 
461     return sal_False;
462 }
463 // -------------------------------------------------------------------------
464 Reference< XInterface > SAL_CALL OResultSet::getStatement(  ) throw(SQLException, RuntimeException)
465 {
466     ::osl::MutexGuard aGuard( m_aMutex );
467     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
468 
469 
470     return m_aStatement.get();
471 }
472 // -------------------------------------------------------------------------
473 
474 sal_Bool SAL_CALL OResultSet::rowDeleted(  ) throw(SQLException, RuntimeException)
475 {
476     ::osl::MutexGuard aGuard( m_aMutex );
477     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
478 
479 
480     return sal_False;
481 }
482 // -------------------------------------------------------------------------
483 sal_Bool SAL_CALL OResultSet::rowInserted(  ) throw(SQLException, RuntimeException)
484 {
485     ::osl::MutexGuard aGuard( m_aMutex );
486     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
487 
488 
489     return sal_False;
490 }
491 // -------------------------------------------------------------------------
492 sal_Bool SAL_CALL OResultSet::rowUpdated(  ) throw(SQLException, RuntimeException)
493 {
494     ::osl::MutexGuard aGuard( m_aMutex );
495     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
496 
497 
498     return sal_False;
499 }
500 // -------------------------------------------------------------------------
501 
502 sal_Bool SAL_CALL OResultSet::next(  ) throw(SQLException, RuntimeException)
503 {
504     ::osl::MutexGuard aGuard( m_aMutex );
505     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
506 
507 
508     return sal_False;
509 }
510 // -------------------------------------------------------------------------
511 
512 sal_Bool SAL_CALL OResultSet::wasNull(  ) throw(SQLException, RuntimeException)
513 {
514     ::osl::MutexGuard aGuard( m_aMutex );
515     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
516 
517 
518     return m_bWasNull;
519 }
520 // -------------------------------------------------------------------------
521 
522 void SAL_CALL OResultSet::cancel(  ) throw(RuntimeException)
523 {
524     ::osl::MutexGuard aGuard( m_aMutex );
525     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
526 
527 }
528 // -------------------------------------------------------------------------
529 void SAL_CALL OResultSet::clearWarnings(  ) throw(SQLException, RuntimeException)
530 {
531 }
532 // -------------------------------------------------------------------------
533 Any SAL_CALL OResultSet::getWarnings(  ) throw(SQLException, RuntimeException)
534 {
535     return Any();
536 }
537 // -------------------------------------------------------------------------
538 void SAL_CALL OResultSet::insertRow(  ) throw(SQLException, RuntimeException)
539 {
540     ::osl::MutexGuard aGuard( m_aMutex );
541     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
542 
543     // you only have to implement this if you want to insert new rows
544 }
545 // -------------------------------------------------------------------------
546 void SAL_CALL OResultSet::updateRow(  ) throw(SQLException, RuntimeException)
547 {
548     ::osl::MutexGuard aGuard( m_aMutex );
549     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
550 
551 
552     // only when you allow updates
553 }
554 // -------------------------------------------------------------------------
555 void SAL_CALL OResultSet::deleteRow(  ) throw(SQLException, RuntimeException)
556 {
557     ::osl::MutexGuard aGuard( m_aMutex );
558     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
559 }
560 // -------------------------------------------------------------------------
561 
562 void SAL_CALL OResultSet::cancelRowUpdates(  ) throw(SQLException, RuntimeException)
563 {
564     ::osl::MutexGuard aGuard( m_aMutex );
565     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
566 }
567 // -------------------------------------------------------------------------
568 
569 void SAL_CALL OResultSet::moveToInsertRow(  ) throw(SQLException, RuntimeException)
570 {
571     ::osl::MutexGuard aGuard( m_aMutex );
572     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
573 
574 
575     // only when you allow insert's
576 }
577 // -------------------------------------------------------------------------
578 
579 void SAL_CALL OResultSet::moveToCurrentRow(  ) throw(SQLException, RuntimeException)
580 {
581     ::osl::MutexGuard aGuard( m_aMutex );
582     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
583 }
584 // -------------------------------------------------------------------------
585 
586 void SAL_CALL OResultSet::updateNull( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
587 {
588     ::osl::MutexGuard aGuard( m_aMutex );
589     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
590 }
591 // -------------------------------------------------------------------------
592 
593 void SAL_CALL OResultSet::updateBoolean( sal_Int32 columnIndex, sal_Bool x ) throw(SQLException, RuntimeException)
594 {
595     ::osl::MutexGuard aGuard( m_aMutex );
596     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
597 
598 }
599 // -------------------------------------------------------------------------
600 void SAL_CALL OResultSet::updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(SQLException, RuntimeException)
601 {
602     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
603     ::osl::MutexGuard aGuard( m_aMutex );
604 
605 }
606 // -------------------------------------------------------------------------
607 
608 void SAL_CALL OResultSet::updateShort( sal_Int32 columnIndex, sal_Int16 x ) throw(SQLException, RuntimeException)
609 {
610     ::osl::MutexGuard aGuard( m_aMutex );
611     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
612 
613 }
614 // -------------------------------------------------------------------------
615 void SAL_CALL OResultSet::updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(SQLException, RuntimeException)
616 {
617     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
618     ::osl::MutexGuard aGuard( m_aMutex );
619 
620 }
621 // -------------------------------------------------------------------------
622 void SAL_CALL OResultSet::updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw(SQLException, RuntimeException)
623 {
624     ::osl::MutexGuard aGuard( m_aMutex );
625     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
626 
627 }
628 // -----------------------------------------------------------------------
629 void SAL_CALL OResultSet::updateFloat( sal_Int32 columnIndex, float x ) throw(SQLException, RuntimeException)
630 {
631     ::osl::MutexGuard aGuard( m_aMutex );
632     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
633 
634 }
635 // -------------------------------------------------------------------------
636 
637 void SAL_CALL OResultSet::updateDouble( sal_Int32 columnIndex, double x ) throw(SQLException, RuntimeException)
638 {
639     ::osl::MutexGuard aGuard( m_aMutex );
640     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
641 
642 }
643 // -------------------------------------------------------------------------
644 void SAL_CALL OResultSet::updateString( sal_Int32 columnIndex, const ::rtl::OUString& x ) throw(SQLException, RuntimeException)
645 {
646     ::osl::MutexGuard aGuard( m_aMutex );
647     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
648 
649 }
650 // -------------------------------------------------------------------------
651 void SAL_CALL OResultSet::updateBytes( sal_Int32 columnIndex, const Sequence< sal_Int8 >& x ) throw(SQLException, RuntimeException)
652 {
653     ::osl::MutexGuard aGuard( m_aMutex );
654     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
655 
656 }
657 // -------------------------------------------------------------------------
658 void SAL_CALL OResultSet::updateDate( sal_Int32 columnIndex, const Date& x ) throw(SQLException, RuntimeException)
659 {
660     ::osl::MutexGuard aGuard( m_aMutex );
661     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
662 
663 }
664 // -------------------------------------------------------------------------
665 
666 void SAL_CALL OResultSet::updateTime( sal_Int32 columnIndex, const Time& x ) throw(SQLException, RuntimeException)
667 {
668     ::osl::MutexGuard aGuard( m_aMutex );
669     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
670 
671 }
672 // -------------------------------------------------------------------------
673 
674 void SAL_CALL OResultSet::updateTimestamp( sal_Int32 columnIndex, const DateTime& x ) throw(SQLException, RuntimeException)
675 {
676     ::osl::MutexGuard aGuard( m_aMutex );
677     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
678 
679 }
680 // -------------------------------------------------------------------------
681 
682 void SAL_CALL OResultSet::updateBinaryStream( sal_Int32 columnIndex, const Reference< XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException)
683 {
684     ::osl::MutexGuard aGuard( m_aMutex );
685     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
686 
687 }
688 // -------------------------------------------------------------------------
689 void SAL_CALL OResultSet::updateCharacterStream( sal_Int32 columnIndex, const Reference< XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException)
690 {
691     ::osl::MutexGuard aGuard( m_aMutex );
692     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
693 
694 }
695 // -------------------------------------------------------------------------
696 void SAL_CALL OResultSet::refreshRow(  ) throw(SQLException, RuntimeException)
697 {
698     ::osl::MutexGuard aGuard( m_aMutex );
699     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
700 
701 }
702 // -------------------------------------------------------------------------
703 void SAL_CALL OResultSet::updateObject( sal_Int32 columnIndex, const Any& x ) throw(SQLException, RuntimeException)
704 {
705     ::osl::MutexGuard aGuard( m_aMutex );
706     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
707 
708 }
709 // -------------------------------------------------------------------------
710 
711 void SAL_CALL OResultSet::updateNumericObject( sal_Int32 columnIndex, const Any& x, sal_Int32 scale ) throw(SQLException, RuntimeException)
712 {
713     ::osl::MutexGuard aGuard( m_aMutex );
714     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
715 
716 }
717 // -------------------------------------------------------------------------
718 // XRowLocate
719 Any SAL_CALL OResultSet::getBookmark(  ) throw( SQLException,  RuntimeException)
720 {
721      ::osl::MutexGuard aGuard( m_aMutex );
722     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
723 
724     // if you don't want to support bookmark you must remove the XRowLocate interface
725 
726      return Any();
727 }
728 // -------------------------------------------------------------------------
729 sal_Bool SAL_CALL OResultSet::moveToBookmark( const  Any& bookmark ) throw( SQLException,  RuntimeException)
730 {
731     ::osl::MutexGuard aGuard( m_aMutex );
732     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
733 
734     return sal_False;
735 }
736 // -------------------------------------------------------------------------
737 sal_Bool SAL_CALL OResultSet::moveRelativeToBookmark( const  Any& bookmark, sal_Int32 rows ) throw( SQLException,  RuntimeException)
738 {
739     ::osl::MutexGuard aGuard( m_aMutex );
740     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
741 
742     return sal_False;
743 }
744 // -------------------------------------------------------------------------
745 sal_Int32 SAL_CALL OResultSet::compareBookmarks( const  Any& first, const  Any& second ) throw( SQLException,  RuntimeException)
746 {
747     ::osl::MutexGuard aGuard( m_aMutex );
748     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
749 
750 
751     return CompareBookmark::NOT_EQUAL;
752 }
753 // -------------------------------------------------------------------------
754 sal_Bool SAL_CALL OResultSet::hasOrderedBookmarks(  ) throw( SQLException,  RuntimeException)
755 {
756     return sal_False;
757 }
758 // -------------------------------------------------------------------------
759 sal_Int32 SAL_CALL OResultSet::hashBookmark( const  Any& bookmark ) throw( SQLException,  RuntimeException)
760 {
761     throw SQLException();
762 }
763 // -------------------------------------------------------------------------
764 // XDeleteRows
765 Sequence< sal_Int32 > SAL_CALL OResultSet::deleteRows( const  Sequence<  Any >& rows ) throw( SQLException,  RuntimeException)
766 {
767     ::osl::MutexGuard aGuard( m_aMutex );
768     checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
769 
770     return Sequence< sal_Int32 >();
771 }
772 // -------------------------------------------------------------------------
773 IPropertyArrayHelper* OResultSet::createArrayHelper( ) const
774 {
775     Sequence< Property > aProps(6);
776     Property* pProperties = aProps.getArray();
777     sal_Int32 nPos = 0;
778     DECL_PROP1IMPL(CURSORNAME,          ::rtl::OUString) PropertyAttribute::READONLY);
779     DECL_PROP0(FETCHDIRECTION,          sal_Int32);
780     DECL_PROP0(FETCHSIZE,               sal_Int32);
781     DECL_BOOL_PROP1IMPL(ISBOOKMARKABLE) PropertyAttribute::READONLY);
782     DECL_PROP1IMPL(RESULTSETCONCURRENCY,sal_Int32) PropertyAttribute::READONLY);
783     DECL_PROP1IMPL(RESULTSETTYPE,       sal_Int32) PropertyAttribute::READONLY);
784 
785     return new OPropertyArrayHelper(aProps);
786 }
787 // -------------------------------------------------------------------------
788 IPropertyArrayHelper & OResultSet::getInfoHelper()
789 {
790     return *const_cast<OResultSet*>(this)->getArrayHelper();
791 }
792 // -------------------------------------------------------------------------
793 sal_Bool OResultSet::convertFastPropertyValue(
794                             Any & rConvertedValue,
795                             Any & rOldValue,
796                             sal_Int32 nHandle,
797                             const Any& rValue )
798                                 throw (::com::sun::star::lang::IllegalArgumentException)
799 {
800     switch(nHandle)
801     {
802         case PROPERTY_ID_ISBOOKMARKABLE:
803         case PROPERTY_ID_CURSORNAME:
804         case PROPERTY_ID_RESULTSETCONCURRENCY:
805         case PROPERTY_ID_RESULTSETTYPE:
806             throw ::com::sun::star::lang::IllegalArgumentException();
807             break;
808         case PROPERTY_ID_FETCHDIRECTION:
809         case PROPERTY_ID_FETCHSIZE:
810         default:
811             ;
812     }
813     return sal_False;
814 }
815 // -------------------------------------------------------------------------
816 void OResultSet::setFastPropertyValue_NoBroadcast(
817                                 sal_Int32 nHandle,
818                                 const Any& rValue
819                                                  )
820                                                  throw (Exception)
821 {
822     switch(nHandle)
823     {
824         case PROPERTY_ID_ISBOOKMARKABLE:
825         case PROPERTY_ID_CURSORNAME:
826         case PROPERTY_ID_RESULTSETCONCURRENCY:
827         case PROPERTY_ID_RESULTSETTYPE:
828             throw Exception();
829             break;
830         case PROPERTY_ID_FETCHDIRECTION:
831             break;
832         case PROPERTY_ID_FETCHSIZE:
833             break;
834         default:
835             ;
836     }
837 }
838 // -------------------------------------------------------------------------
839 void OResultSet::getFastPropertyValue(
840                                 Any& rValue,
841                                 sal_Int32 nHandle
842                                      ) const
843 {
844     switch(nHandle)
845     {
846         case PROPERTY_ID_ISBOOKMARKABLE:
847         case PROPERTY_ID_CURSORNAME:
848         case PROPERTY_ID_RESULTSETCONCURRENCY:
849         case PROPERTY_ID_RESULTSETTYPE:
850         case PROPERTY_ID_FETCHDIRECTION:
851         case PROPERTY_ID_FETCHSIZE:
852             ;
853     }
854 }
855 // -----------------------------------------------------------------------------
856 void SAL_CALL OResultSet::acquire() throw()
857 {
858     OResultSet_BASE::acquire();
859 }
860 // -----------------------------------------------------------------------------
861 void SAL_CALL OResultSet::release() throw()
862 {
863     OResultSet_BASE::release();
864 }
865 // -----------------------------------------------------------------------------
866 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OResultSet::getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException)
867 {
868     return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
869 }
870 // -----------------------------------------------------------------------------
871 
872 
873 
874