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