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 #include "mysqlc_propertyids.hxx"
23 #include "mysqlc_general.hxx"
24 #include "mysqlc_resultset.hxx"
25 #include "mysqlc_resultsetmetadata.hxx"
26
27 #include <com/sun/star/sdbc/DataType.hpp>
28 #include <com/sun/star/beans/PropertyAttribute.hpp>
29 #include <com/sun/star/sdbcx/CompareBookmark.hpp>
30 #include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
31 #include <com/sun/star/sdbc/ResultSetType.hpp>
32 #include <com/sun/star/sdbc/FetchDirection.hpp>
33 #include <cppuhelper/typeprovider.hxx>
34 #include <com/sun/star/lang/DisposedException.hpp>
35
36 using namespace connectivity::mysqlc;
37 using namespace cppu;
38 using namespace com::sun::star::uno;
39 using namespace com::sun::star::lang;
40 using namespace com::sun::star::beans;
41 using namespace com::sun::star::sdbc;
42 using namespace com::sun::star::sdbcx;
43 using namespace com::sun::star::container;
44 using namespace com::sun::star::io;
45 using namespace com::sun::star::util;
46 using ::osl::MutexGuard;
47 using ::rtl::OUString;
48
49 #include <cppconn/resultset.h>
50 #include <cppconn/resultset_metadata.h>
51
52 #include <stdio.h>
53
54
55 // IMPLEMENT_SERVICE_INFO(OResultSet,"com.sun.star.sdbcx.OResultSet","com.sun.star.sdbc.ResultSet");
56 /* {{{ OResultSet::getImplementationName() -I- */
getImplementationName()57 OUString SAL_CALL OResultSet::getImplementationName()
58 {
59 OSL_TRACE("OResultSet::getImplementationName");
60 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdbcx.mysqlc.ResultSet" ) );
61 }
62 /* }}} */
63
64
65 /* {{{ OResultSet::getSupportedServiceNames() -I- */
getSupportedServiceNames()66 Sequence< OUString > SAL_CALL OResultSet::getSupportedServiceNames()
67 {
68 OSL_TRACE("OResultSet::getSupportedServiceNames");
69 Sequence< OUString > aSupported(2);
70 aSupported[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdbc.ResultSet" ) );
71 aSupported[1] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdbcx.ResultSet" ) );
72 return (aSupported);
73 }
74 /* }}} */
75
76
77 /* {{{ OResultSet::supportsService() -I- */
supportsService(const OUString & _rServiceName)78 sal_Bool SAL_CALL OResultSet::supportsService(const OUString& _rServiceName)
79 {
80 OSL_TRACE("OResultSet::supportsService");
81 Sequence< OUString > aSupported(getSupportedServiceNames());
82 const OUString* pSupported = aSupported.getConstArray();
83 const OUString* pEnd = pSupported + aSupported.getLength();
84 for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) {}
85
86 return (pSupported != pEnd);
87 }
88 /* }}} */
89
90
91 /* {{{ OResultSet::OResultSet() -I- */
OResultSet(OCommonStatement * pStmt,sql::ResultSet * result,rtl_TextEncoding _encoding)92 OResultSet::OResultSet(OCommonStatement * pStmt, sql::ResultSet * result, rtl_TextEncoding _encoding )
93 : OResultSet_BASE(m_aMutex)
94 ,OPropertySetHelper(OResultSet_BASE::rBHelper)
95 ,m_aStatement((OWeakObject*)pStmt)
96 ,m_xMetaData(NULL)
97 ,m_result(result)
98 ,fieldCount( 0 )
99 ,m_encoding( _encoding )
100 {
101 OSL_TRACE("OResultSet::OResultSet");
102 try {
103 sql::ResultSetMetaData * rs_meta = m_result->getMetaData();
104 fieldCount = rs_meta->getColumnCount();
105 } catch (sql::SQLException &e) {
106 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
107 }
108 }
109 /* }}} */
110
111
112 /* {{{ OResultSet::~OResultSet() -I- */
~OResultSet()113 OResultSet::~OResultSet()
114 {
115 OSL_TRACE("OResultSet::~OResultSet");
116 }
117 /* }}} */
118
119
120 /* {{{ OResultSet::disposing() -I- */
disposing()121 void OResultSet::disposing()
122 {
123 OSL_TRACE("OResultSet::disposing");
124 OPropertySetHelper::disposing();
125
126 MutexGuard aGuard(m_aMutex);
127
128 m_aStatement = NULL;
129 m_xMetaData = NULL;
130 }
131 /* }}} */
132
133
134 /* {{{ OResultSet::queryInterface() -I- */
queryInterface(const Type & rType)135 Any SAL_CALL OResultSet::queryInterface(const Type & rType)
136 {
137 OSL_TRACE("OResultSet::queryInterface");
138 Any aRet = OPropertySetHelper::queryInterface(rType);
139 if (!aRet.hasValue()) {
140 aRet = OResultSet_BASE::queryInterface(rType);
141 }
142 return aRet;
143 }
144 /* }}} */
145
146
147 /* {{{ OResultSet::getTypes() -I- */
getTypes()148 Sequence< Type > SAL_CALL OResultSet::getTypes()
149 {
150 OSL_TRACE("OResultSet::getTypes");
151 OTypeCollection aTypes( ::getCppuType((const Reference< XMultiPropertySet > *) NULL),
152 ::getCppuType((const Reference< XFastPropertySet > *) NULL),
153 ::getCppuType((const Reference< XPropertySet > *) NULL));
154
155 return concatSequences(aTypes.getTypes(), OResultSet_BASE::getTypes());
156 }
157 /* }}} */
158
159
160 /* {{{ OResultSet::findColumn() -I- */
findColumn(const OUString & columnName)161 sal_Int32 SAL_CALL OResultSet::findColumn(const OUString& columnName)
162 {
163 OSL_TRACE("OResultSet::findColumn");
164 MutexGuard aGuard(m_aMutex);
165 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
166
167 try {
168 // find the first column with the name columnName
169 sql::ResultSetMetaData * meta = m_result->getMetaData();
170 for (sal_uInt32 i = 1; i <= fieldCount; i++) {
171 if (columnName.equalsIgnoreAsciiCaseAscii(meta->getColumnName(i).c_str())) {
172 /* SDBC knows them indexed from 1 */
173 return i;
174 }
175 }
176 } catch (sql::SQLException &e) {
177 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
178 }
179 return 0;
180 }
181 /* }}} */
182
183
184 /* {{{ OResultSet::getBinaryStream() -U- */
getBinaryStream(sal_Int32 column)185 Reference< XInputStream > SAL_CALL OResultSet::getBinaryStream(sal_Int32 column)
186 {
187 OSL_TRACE("OResultSet::getBinaryStream");
188 MutexGuard aGuard(m_aMutex);
189 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
190 checkColumnIndex(column);
191
192 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getBinaryStream", *this);
193 return NULL;
194 }
195 /* }}} */
196
197
198 /* {{{ OResultSet::getCharacterStream() -U- */
getCharacterStream(sal_Int32 column)199 Reference< XInputStream > SAL_CALL OResultSet::getCharacterStream(sal_Int32 column)
200 {
201 OSL_TRACE("OResultSet::getCharacterStream");
202 MutexGuard aGuard(m_aMutex);
203 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
204 checkColumnIndex(column);
205
206 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getCharacterStream", *this);
207 return NULL;
208 }
209 /* }}} */
210
211
212 /* {{{ OResultSet::getBoolean() -I- */
getBoolean(sal_Int32 column)213 sal_Bool SAL_CALL OResultSet::getBoolean(sal_Int32 column)
214 {
215 OSL_TRACE("OResultSet::getBoolean");
216 MutexGuard aGuard(m_aMutex);
217 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
218
219 checkColumnIndex(column);
220 try {
221 return m_result->getBoolean(column)? sal_True:sal_False;
222 } catch (sql::SQLException &e) {
223 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
224 }
225 return sal_False;
226 #if 0
227 OUString str = getString(column);
228 switch (str[0]) {
229 case '1':
230 case 't':
231 case 'T':
232 case 'y':
233 case 'Y':
234 return sal_True;
235 }
236 return sal_False;
237 #endif
238 }
239 /* }}} */
240
241
242 /* {{{ OResultSet::getByte() -I- */
getByte(sal_Int32 column)243 sal_Int8 SAL_CALL OResultSet::getByte(sal_Int32 column)
244 {
245 OSL_TRACE("OResultSet::getByte");
246 MutexGuard aGuard(m_aMutex);
247 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
248
249 checkColumnIndex(column);
250 try {
251 return m_result->getInt(column);
252 } catch (sql::SQLException &e) {
253 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
254 }
255 return 0; // fool compiler
256 }
257 /* }}} */
258
259
260 /* {{{ OResultSet::getBytes() -I- */
getBytes(sal_Int32 column)261 Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes(sal_Int32 column)
262 {
263 OSL_TRACE("OResultSet::getBytes");
264
265 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
266 MutexGuard aGuard(m_aMutex);
267
268
269 sql::SQLString val = m_result->getString(column);
270 if (!val.length()) {
271 return Sequence< sal_Int8>();
272 } else {
273 return Sequence< sal_Int8 > ((sal_Int8*)val.c_str(), val.length());
274 }
275 }
276 /* }}} */
277
278
279 /* {{{ OResultSet::getDate() -I- */
getDate(sal_Int32 column)280 Date SAL_CALL OResultSet::getDate(sal_Int32 column)
281 {
282 OSL_TRACE("OResultSet::getDate");
283 MutexGuard aGuard(m_aMutex);
284 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
285 checkColumnIndex(column);
286
287 Date d;
288 try {
289 OUString dateString = getString(column);
290 OUString token;
291 sal_Int32 nIndex = 0, i=0;
292
293 do {
294 token = dateString.getToken (0, '-', nIndex);
295 switch (i) {
296 case 0:
297 d.Year = static_cast<sal_uInt16>(token.toInt32(10));
298 break;
299 case 1:
300 d.Month = static_cast<sal_uInt16>(token.toInt32(10));
301 break;
302 case 2:
303 d.Day = static_cast<sal_uInt16>(token.toInt32(10));
304 break;
305 default:;
306 }
307 i++;
308 } while (nIndex >= 0);
309 } catch (sql::SQLException &e) {
310 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
311 }
312 return d;
313 }
314 /* }}} */
315
316
317 /* {{{ OResultSet::getDouble() -I- */
getDouble(sal_Int32 column)318 double SAL_CALL OResultSet::getDouble(sal_Int32 column)
319 {
320 OSL_TRACE("OResultSet::getDouble");
321 MutexGuard aGuard(m_aMutex);
322 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
323
324 checkColumnIndex(column);
325 try {
326 return m_result->getDouble(column);
327 } catch (sql::SQLException &e) {
328 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
329 }
330 return 0.0; // fool compiler
331 }
332 /* }}} */
333
334
335 /* {{{ OResultSet::getFloat() -I- */
getFloat(sal_Int32 column)336 float SAL_CALL OResultSet::getFloat(sal_Int32 column)
337 {
338 OSL_TRACE("OResultSet::getFloat");
339 MutexGuard aGuard(m_aMutex);
340 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
341
342 checkColumnIndex(column);
343 try {
344 return m_result->getDouble(column);
345 } catch (sql::SQLException &e) {
346 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
347 }
348 return 0.0; // fool compiler
349 }
350 /* }}} */
351
352
353 /* {{{ OResultSet::getInt() -I- */
getInt(sal_Int32 column)354 sal_Int32 SAL_CALL OResultSet::getInt(sal_Int32 column)
355 {
356 OSL_TRACE("OResultSet::getInt");
357 MutexGuard aGuard(m_aMutex);
358 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
359
360 checkColumnIndex(column);
361 try {
362 return m_result->getInt(column);
363 } catch (sql::SQLException &e) {
364 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
365 }
366 return 0; // fool compiler
367 }
368 /* }}} */
369
370
371 /* {{{ OResultSet::getRow() -I- */
getRow()372 sal_Int32 SAL_CALL OResultSet::getRow()
373 {
374 OSL_TRACE("OResultSet::getRow");
375 MutexGuard aGuard(m_aMutex);
376 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
377
378 try {
379 return m_result->getRow();
380 } catch (sql::SQLException &e) {
381 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
382 }
383 return 0; // fool compiler
384 }
385 /* }}} */
386
387
388 /* {{{ OResultSet::getLong() -I- */
getLong(sal_Int32 column)389 sal_Int64 SAL_CALL OResultSet::getLong(sal_Int32 column)
390 {
391 OSL_TRACE("OResultSet::getLong");
392 MutexGuard aGuard(m_aMutex);
393 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
394
395 checkColumnIndex(column);
396 try {
397 return m_result->getInt64(column);
398 } catch (sql::SQLException &e) {
399 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
400 }
401 return 0; // fool compiler
402 }
403 /* }}} */
404
405
406 /* {{{ OResultSet::getMetaData() -I- */
getMetaData()407 Reference< XResultSetMetaData > SAL_CALL OResultSet::getMetaData()
408 {
409 OSL_TRACE("OResultSet::getMetaData");
410 MutexGuard aGuard(m_aMutex);
411 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
412 try {
413 if (!m_xMetaData.is()) {
414 m_xMetaData = new OResultSetMetaData(m_result->getMetaData(), m_encoding);
415 }
416 } catch (sql::MethodNotImplementedException) {
417 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getMetaData", *this);
418 } catch (sql::SQLException &e) {
419 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
420 }
421 return m_xMetaData;
422 }
423 /* }}} */
424
425
426 /* {{{ OResultSet::getArray() -U- */
getArray(sal_Int32 column)427 Reference< XArray > SAL_CALL OResultSet::getArray(sal_Int32 column)
428 {
429 OSL_TRACE("OResultSet::getArray");
430 MutexGuard aGuard(m_aMutex);
431 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
432 checkColumnIndex(column);
433
434 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getArray", *this);
435 return NULL;
436 }
437 /* }}} */
438
439
440 /* {{{ OResultSet::getClob() -U- */
getClob(sal_Int32 column)441 Reference< XClob > SAL_CALL OResultSet::getClob(sal_Int32 column)
442 {
443 OSL_TRACE("OResultSet::getClob");
444 MutexGuard aGuard(m_aMutex);
445 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
446 checkColumnIndex(column);
447
448 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getClob", *this);
449 return NULL;
450 }
451 /* }}} */
452
453
454 /* {{{ OResultSet::getBlob() -U- */
getBlob(sal_Int32 column)455 Reference< XBlob > SAL_CALL OResultSet::getBlob(sal_Int32 column)
456 {
457 OSL_TRACE("OResultSet::getBlob");
458 MutexGuard aGuard(m_aMutex);
459 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
460 checkColumnIndex(column);
461
462 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getBlob", *this);
463 return NULL;
464 }
465 /* }}} */
466
467
468 /* {{{ OResultSet::getRef() -U- */
getRef(sal_Int32 column)469 Reference< XRef > SAL_CALL OResultSet::getRef(sal_Int32 column)
470 {
471 OSL_TRACE("OResultSet::getRef");
472 MutexGuard aGuard(m_aMutex);
473 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
474 checkColumnIndex(column);
475
476 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getRef", *this);
477 return NULL;
478 }
479 /* }}} */
480
481
482 /* {{{ OResultSet::getObject() -U- */
getObject(sal_Int32 column,const Reference<XNameAccess> &)483 Any SAL_CALL OResultSet::getObject(sal_Int32 column, const Reference< XNameAccess >& /* typeMap */)
484 {
485 OSL_TRACE("OResultSet::getObject");
486 MutexGuard aGuard(m_aMutex);
487 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
488 checkColumnIndex(column);
489
490 Any aRet= Any();
491
492 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getObject", *this);
493 return aRet;
494 }
495 /* }}} */
496
497
498 /* {{{ OResultSet::getShort() -I- */
getShort(sal_Int32 column)499 sal_Int16 SAL_CALL OResultSet::getShort(sal_Int32 column)
500 {
501 OSL_TRACE("OResultSet::getShort");
502 MutexGuard aGuard(m_aMutex);
503 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
504
505 try {
506 return (sal_Int16) m_result->getInt(column);
507 } catch (sql::SQLException &e) {
508 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
509 }
510 return 0; // fool compiler
511 }
512 /* }}} */
513
514
515 /* {{{ OResultSet::getString() -I- */
getString(sal_Int32 column)516 OUString SAL_CALL OResultSet::getString(sal_Int32 column)
517 {
518 OSL_TRACE("OResultSet::getString");
519 MutexGuard aGuard(m_aMutex);
520 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
521
522 checkColumnIndex(column);
523
524 try {
525 sql::SQLString val = m_result->getString(column);
526 if (!m_result->wasNull()) {
527 return OUString( val.c_str(), val.length(), m_encoding );
528 } else {
529 return OUString();
530 }
531 } catch (sql::SQLException &e) {
532 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
533 }
534 return OUString(); // fool compiler
535 }
536 /* }}} */
537
538
539 /* {{{ OResultSet::getTime() -I- */
getTime(sal_Int32 column)540 Time SAL_CALL OResultSet::getTime(sal_Int32 column)
541 {
542 OSL_TRACE("OResultSet::getTime");
543 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
544 MutexGuard aGuard(m_aMutex);
545
546 checkColumnIndex(column);
547 Time t;
548 OUString timeString = getString(column);
549 OUString token;
550 sal_Int32 nIndex, i=0;
551
552 nIndex = timeString.indexOf(' ') + 1;
553
554 do {
555 token = timeString.getToken (0, ':', nIndex);
556 switch (i) {
557 case 0:
558 t.Hours = static_cast<sal_uInt16>(token.toInt32(10));
559 break;
560 case 1:
561 t.Minutes = static_cast<sal_uInt16>(token.toInt32(10));
562 break;
563 case 2:
564 t.Seconds = static_cast<sal_uInt16>(token.toInt32(10));
565 break;
566 }
567 i++;
568 } while (nIndex >= 0);
569
570 return t;
571 }
572 /* }}} */
573
574
575 /* {{{ OResultSet::getTimestamp() -I- */
getTimestamp(sal_Int32 column)576 DateTime SAL_CALL OResultSet::getTimestamp(sal_Int32 column)
577 {
578 OSL_TRACE("OResultSet::getTimestamp");
579 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
580 MutexGuard aGuard(m_aMutex);
581
582 checkColumnIndex(column);
583 DateTime dt;
584 Date d = getDate(column);
585 Time t = getTime(column);
586
587 dt.Year = d.Year;
588 dt.Month = d.Month;
589 dt.Day = d.Day;
590 dt.Hours = t.Hours;
591 dt.Minutes = t.Minutes;
592 dt.Seconds = t.Seconds;
593 return dt;
594 }
595 /* }}} */
596
597
598 /* {{{ OResultSet::isBeforeFirst() -I- */
isBeforeFirst()599 sal_Bool SAL_CALL OResultSet::isBeforeFirst()
600 {
601 OSL_TRACE("OResultSet::isBeforeFirst");
602 MutexGuard aGuard(m_aMutex);
603 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
604
605 try {
606 return m_result->isBeforeFirst()? sal_True:sal_False;
607 } catch (sql::SQLException &e) {
608 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
609 }
610 return sal_False; //fool
611 }
612 /* }}} */
613
614
615 /* {{{ OResultSet::isAfterLast() -I- */
isAfterLast()616 sal_Bool SAL_CALL OResultSet::isAfterLast()
617 {
618 OSL_TRACE("OResultSet::isAfterLast");
619 MutexGuard aGuard(m_aMutex);
620 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
621
622 try {
623 return m_result->isAfterLast()? sal_True:sal_False;
624 } catch (sql::SQLException &e) {
625 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
626 }
627 return sal_False; //fool
628 }
629 /* }}} */
630
631
632 /* {{{ OResultSet::isFirst() -I- */
isFirst()633 sal_Bool SAL_CALL OResultSet::isFirst()
634 {
635 OSL_TRACE("OResultSet::isFirst");
636 MutexGuard aGuard(m_aMutex);
637 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
638
639 try {
640 return m_result->isFirst();
641 } catch (sql::SQLException &e) {
642 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
643 }
644 return sal_False; //fool
645 }
646 /* }}} */
647
648
649 /* {{{ OResultSet::isLast() -I- */
isLast()650 sal_Bool SAL_CALL OResultSet::isLast()
651 {
652 OSL_TRACE("OResultSet::isLast");
653 MutexGuard aGuard(m_aMutex);
654 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
655
656 try {
657 return m_result->isLast()? sal_True:sal_False;
658 } catch (sql::SQLException &e) {
659 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
660 }
661 return sal_False; //fool
662 }
663 /* }}} */
664
665
666 /* {{{ OResultSet::beforeFirst() -I- */
beforeFirst()667 void SAL_CALL OResultSet::beforeFirst()
668 {
669 OSL_TRACE("OResultSet::beforeFirst");
670 MutexGuard aGuard(m_aMutex);
671 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
672
673 try {
674 m_result->beforeFirst();
675 } catch (sql::SQLException &e) {
676 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
677 }
678 }
679 /* }}} */
680
681
682 /* {{{ OResultSet::afterLast() -I- */
afterLast()683 void SAL_CALL OResultSet::afterLast()
684 {
685 OSL_TRACE("OResultSet::afterLast");
686 MutexGuard aGuard(m_aMutex);
687 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
688
689 try {
690 m_result->afterLast();
691 } catch (sql::SQLException &e) {
692 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
693 }
694 }
695 /* }}} */
696
697
698 /* {{{ OResultSet::close() -I- */
close()699 void SAL_CALL OResultSet::close()
700 {
701 OSL_TRACE("OResultSet::close");
702 MutexGuard aGuard(m_aMutex);
703 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
704
705 try {
706 m_result->close();
707 } catch (sql::SQLException &e) {
708 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
709 }
710
711 dispose();
712 }
713 /* }}} */
714
715
716 /* {{{ OResultSet::first() -I- */
first()717 sal_Bool SAL_CALL OResultSet::first()
718 {
719 OSL_TRACE("OResultSet::first");
720 MutexGuard aGuard(m_aMutex);
721 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
722
723 try {
724 return m_result->first()? sal_True:sal_False;
725 } catch (sql::SQLException &e) {
726 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
727 }
728 return sal_False; //fool
729 }
730 /* }}} */
731
732
733 /* {{{ OResultSet::last() -I- */
last()734 sal_Bool SAL_CALL OResultSet::last()
735 {
736 OSL_TRACE("OResultSet::last");
737 MutexGuard aGuard(m_aMutex);
738 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
739
740 try {
741 return m_result->last()? sal_True:sal_False;
742 } catch (sql::SQLException &e) {
743 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
744 }
745 return sal_False; //fool
746 }
747 /* }}} */
748
749
750 /* {{{ OResultSet::absolute() -I- */
absolute(sal_Int32 row)751 sal_Bool SAL_CALL OResultSet::absolute(sal_Int32 row)
752 {
753 OSL_TRACE("OResultSet::absolute");
754 MutexGuard aGuard(m_aMutex);
755 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
756
757 try {
758 return m_result->absolute(row)? sal_True:sal_False;
759 } catch (sql::SQLException &e) {
760 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
761 }
762 return sal_False; //fool
763 }
764 /* }}} */
765
766
767 /* {{{ OResultSet::relative() -I- */
relative(sal_Int32 row)768 sal_Bool SAL_CALL OResultSet::relative(sal_Int32 row)
769 {
770 OSL_TRACE("OResultSet::relative");
771 MutexGuard aGuard(m_aMutex);
772 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
773
774 try {
775 return m_result->relative(row)? sal_True:sal_False;
776 } catch (sql::SQLException &e) {
777 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
778 }
779 return sal_False; //fool
780 }
781 /* }}} */
782
783
784 /* {{{ OResultSet::previous() -I- */
previous()785 sal_Bool SAL_CALL OResultSet::previous()
786 {
787 OSL_TRACE("OResultSet::previous");
788 MutexGuard aGuard(m_aMutex);
789 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
790
791 try {
792 return m_result->previous()? sal_True:sal_False;
793 } catch (sql::SQLException &e) {
794 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
795 }
796 return sal_False; //fool
797 }
798 /* }}} */
799
800
801 /* {{{ OResultSet::getStatement() -I- */
getStatement()802 Reference< XInterface > SAL_CALL OResultSet::getStatement()
803 {
804 OSL_TRACE("OResultSet::getStatement");
805 MutexGuard aGuard(m_aMutex);
806 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
807
808 return m_aStatement.get();
809 }
810 /* }}} */
811
812
813 /* {{{ OResultSet::rowDeleted() -I- */
rowDeleted()814 sal_Bool SAL_CALL OResultSet::rowDeleted()
815 {
816 OSL_TRACE("OResultSet::rowDeleted");
817 MutexGuard aGuard(m_aMutex);
818 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
819
820 return sal_False;
821 }
822 /* }}} */
823
824
825 /* {{{ OResultSet::rowInserted() -I- */
rowInserted()826 sal_Bool SAL_CALL OResultSet::rowInserted()
827 {
828 OSL_TRACE("OResultSet::rowInserted");
829 MutexGuard aGuard(m_aMutex);
830 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
831
832 return sal_False;
833 }
834 /* }}} */
835
836
837 /* {{{ OResultSet::rowUpdated() -I- */
rowUpdated()838 sal_Bool SAL_CALL OResultSet::rowUpdated()
839 {
840 OSL_TRACE("OResultSet::rowUpdated");
841 MutexGuard aGuard(m_aMutex);
842 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
843
844 return sal_False;
845 }
846 /* }}} */
847
848
849 /* {{{ OResultSet::next() -I- */
next()850 sal_Bool SAL_CALL OResultSet::next()
851 {
852 OSL_TRACE("OResultSet::next");
853 MutexGuard aGuard(m_aMutex);
854 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
855
856 try {
857 return m_result->next()? sal_True:sal_False;
858 } catch (sql::SQLException &e) {
859 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
860 }
861 return sal_False; //fool
862 }
863 /* }}} */
864
865
866 /* {{{ OResultSet::wasNull() -I- */
wasNull()867 sal_Bool SAL_CALL OResultSet::wasNull()
868 {
869 OSL_TRACE("OResultSet::wasNull");
870 MutexGuard aGuard(m_aMutex);
871 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
872
873 try {
874 return m_result->wasNull()? sal_True:sal_False;
875 } catch (sql::SQLException &e) {
876 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
877 }
878 return sal_False; //fool
879 }
880 /* }}} */
881
882
883 /* {{{ OResultSet::cancel() -I- */
cancel()884 void SAL_CALL OResultSet::cancel()
885 {
886 OSL_TRACE("OResultSet::cancel");
887 MutexGuard aGuard(m_aMutex);
888 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
889 }
890 /* }}} */
891
892
893 /* {{{ OResultSet::clearWarnings() -I- */
clearWarnings()894 void SAL_CALL OResultSet::clearWarnings()
895 {
896 OSL_TRACE("OResultSet::clearWarnings");
897 }
898 /* }}} */
899
900
901 /* {{{ OResultSet::getWarnings() -I- */
getWarnings()902 Any SAL_CALL OResultSet::getWarnings()
903 {
904 OSL_TRACE("OResultSet::getWarnings");
905 Any aRet= Any();
906 return aRet;
907 }
908 /* }}} */
909
910
911 /* {{{ OResultSet::insertRow() -I- */
insertRow()912 void SAL_CALL OResultSet::insertRow()
913 {
914 OSL_TRACE("OResultSet::insertRow");
915 MutexGuard aGuard(m_aMutex);
916 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
917 // you only have to implement this if you want to insert new rows
918 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::insertRow", *this);
919 }
920 /* }}} */
921
922
923 /* {{{ OResultSet::updateRow() -I- */
updateRow()924 void SAL_CALL OResultSet::updateRow()
925 {
926 OSL_TRACE("OResultSet::updateRow");
927 MutexGuard aGuard(m_aMutex);
928 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
929
930 // only when you allow updates
931 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateRow", *this);
932 }
933 /* }}} */
934
935
936 /* {{{ OResultSet::deleteRow() -I- */
deleteRow()937 void SAL_CALL OResultSet::deleteRow()
938 {
939 OSL_TRACE("OResultSet::deleteRow");
940 MutexGuard aGuard(m_aMutex);
941 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
942 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::deleteRow", *this);
943 }
944 /* }}} */
945
946
947 /* {{{ OResultSet::cancelRowUpdates() -I- */
cancelRowUpdates()948 void SAL_CALL OResultSet::cancelRowUpdates()
949 {
950 OSL_TRACE("OResultSet::cancelRowUpdates");
951 MutexGuard aGuard(m_aMutex);
952 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
953 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::cancelRowUpdates", *this);
954 }
955 /* }}} */
956
957
958 /* {{{ OResultSet::moveToInsertRow() -I- */
moveToInsertRow()959 void SAL_CALL OResultSet::moveToInsertRow()
960 {
961 OSL_TRACE("OResultSet::moveToInsertRow");
962 MutexGuard aGuard(m_aMutex);
963 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
964
965 // only when you allow insert's
966 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::moveToInsertRow", *this);
967 }
968 /* }}} */
969
970
971 /* {{{ OResultSet::moveToCurrentRow() -I- */
moveToCurrentRow()972 void SAL_CALL OResultSet::moveToCurrentRow()
973 {
974 OSL_TRACE("OResultSet::moveToCurrentRow");
975 MutexGuard aGuard(m_aMutex);
976 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
977 }
978 /* }}} */
979
980
981 /* {{{ OResultSet::updateNull() -U- */
updateNull(sal_Int32 column)982 void SAL_CALL OResultSet::updateNull(sal_Int32 column)
983 {
984 OSL_TRACE("OResultSet::updateNull");
985 MutexGuard aGuard(m_aMutex);
986 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
987 checkColumnIndex(column);
988 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateNull", *this);
989 }
990 /* }}} */
991
992
993 /* {{{ OResultSet::updateBoolean() -U- */
updateBoolean(sal_Int32 column,sal_Bool)994 void SAL_CALL OResultSet::updateBoolean(sal_Int32 column, sal_Bool /* x */)
995 {
996 OSL_TRACE("OResultSet::updateBoolean");
997 MutexGuard aGuard(m_aMutex);
998 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
999 checkColumnIndex(column);
1000 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateBoolean", *this);
1001 }
1002 /* }}} */
1003
1004
1005 /* {{{ OResultSet::updateByte() -U- */
updateByte(sal_Int32 column,sal_Int8)1006 void SAL_CALL OResultSet::updateByte(sal_Int32 column, sal_Int8 /* x */)
1007 {
1008 OSL_TRACE("OResultSet::updateByte");
1009 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1010 MutexGuard aGuard(m_aMutex);
1011 checkColumnIndex(column);
1012 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateByte", *this);
1013 }
1014 /* }}} */
1015
1016
1017 /* {{{ OResultSet::updateShort() -U- */
updateShort(sal_Int32 column,sal_Int16)1018 void SAL_CALL OResultSet::updateShort(sal_Int32 column, sal_Int16 /* x */)
1019 {
1020 OSL_TRACE("OResultSet::updateShort");
1021 MutexGuard aGuard(m_aMutex);
1022 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1023 checkColumnIndex(column);
1024 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateShort", *this);
1025 }
1026 /* }}} */
1027
1028
1029 /* {{{ OResultSet::updateInt() -U- */
updateInt(sal_Int32 column,sal_Int32)1030 void SAL_CALL OResultSet::updateInt(sal_Int32 column, sal_Int32 /* x */)
1031 {
1032 OSL_TRACE("OResultSet::updateInt");
1033 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1034 MutexGuard aGuard(m_aMutex);
1035 checkColumnIndex(column);
1036 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateInt", *this);
1037 }
1038 /* }}} */
1039
1040
1041 /* {{{ OResultSet::updateLong() -U- */
updateLong(sal_Int32 column,sal_Int64)1042 void SAL_CALL OResultSet::updateLong(sal_Int32 column, sal_Int64 /* x */)
1043 {
1044 OSL_TRACE("OResultSet::updateLong");
1045 MutexGuard aGuard(m_aMutex);
1046 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1047 checkColumnIndex(column);
1048 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateLong", *this);
1049 }
1050 /* }}} */
1051
1052
1053 /* {{{ OResultSet::updateFloat() -U- */
updateFloat(sal_Int32 column,float)1054 void SAL_CALL OResultSet::updateFloat(sal_Int32 column, float /* x */)
1055 {
1056 OSL_TRACE("OResultSet::updateFloat");
1057 MutexGuard aGuard(m_aMutex);
1058 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1059 checkColumnIndex(column);
1060 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateFloat", *this);
1061 }
1062 /* }}} */
1063
1064
1065 /* {{{ OResultSet::updateDouble() -U- */
updateDouble(sal_Int32 column,double)1066 void SAL_CALL OResultSet::updateDouble(sal_Int32 column, double /* x */)
1067 {
1068 OSL_TRACE("OResultSet::updateDouble");
1069 MutexGuard aGuard(m_aMutex);
1070 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1071 checkColumnIndex(column);
1072 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateDouble", *this);
1073 }
1074 /* }}} */
1075
1076
1077 /* {{{ OResultSet::updateString() -U- */
updateString(sal_Int32 column,const OUString &)1078 void SAL_CALL OResultSet::updateString(sal_Int32 column, const OUString& /* x */)
1079 {
1080 OSL_TRACE("OResultSet::updateString");
1081 MutexGuard aGuard(m_aMutex);
1082 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1083 checkColumnIndex(column);
1084 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateString", *this);
1085 }
1086 /* }}} */
1087
1088
1089 /* {{{ OResultSet::updateBytes() -U- */
updateBytes(sal_Int32 column,const Sequence<sal_Int8> &)1090 void SAL_CALL OResultSet::updateBytes(sal_Int32 column, const Sequence< sal_Int8 >& /* x */)
1091 {
1092 OSL_TRACE("OResultSet::updateBytes");
1093 MutexGuard aGuard(m_aMutex);
1094 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1095 checkColumnIndex(column);
1096 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateBytes", *this);
1097 }
1098 /* }}} */
1099
1100
1101 /* {{{ OResultSet::updateDate() -U- */
updateDate(sal_Int32 column,const Date &)1102 void SAL_CALL OResultSet::updateDate(sal_Int32 column, const Date& /* x */)
1103 {
1104 OSL_TRACE("OResultSet::updateDate");
1105 MutexGuard aGuard(m_aMutex);
1106 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1107 checkColumnIndex(column);
1108 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateDate", *this);
1109 }
1110 /* }}} */
1111
1112
1113 /* {{{ OResultSet::updateTime() -U- */
updateTime(sal_Int32 column,const Time &)1114 void SAL_CALL OResultSet::updateTime(sal_Int32 column, const Time& /* x */)
1115 {
1116 OSL_TRACE("OResultSet::updateTime");
1117 MutexGuard aGuard(m_aMutex);
1118 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1119 checkColumnIndex(column);
1120 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateTime", *this);
1121 }
1122 /* }}} */
1123
1124
1125 /* {{{ OResultSet::updateTimestamp() -U- */
updateTimestamp(sal_Int32 column,const DateTime &)1126 void SAL_CALL OResultSet::updateTimestamp(sal_Int32 column, const DateTime& /* x */)
1127 {
1128 OSL_TRACE("OResultSet::updateTimestamp");
1129 MutexGuard aGuard(m_aMutex);
1130 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1131 checkColumnIndex(column);
1132 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateTimestamp", *this);
1133 }
1134 /* }}} */
1135
1136
1137 /* {{{ OResultSet::updateBinaryStream() -U- */
updateBinaryStream(sal_Int32 column,const Reference<XInputStream> &,sal_Int32)1138 void SAL_CALL OResultSet::updateBinaryStream(sal_Int32 column, const Reference< XInputStream >& /* x */,
1139 sal_Int32 /* length */)
1140 {
1141 OSL_TRACE("OResultSet::updateBinaryStream");
1142 MutexGuard aGuard(m_aMutex);
1143 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1144 checkColumnIndex(column);
1145 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateBinaryStream", *this);
1146 }
1147 /* }}} */
1148
1149
1150 /* {{{ OResultSet::updateCharacterStream() -U- */
updateCharacterStream(sal_Int32 column,const Reference<XInputStream> &,sal_Int32)1151 void SAL_CALL OResultSet::updateCharacterStream(sal_Int32 column, const Reference< XInputStream >& /* x */,
1152 sal_Int32 /* length */)
1153 {
1154 OSL_TRACE("OResultSet::updateCharacterStream");
1155 MutexGuard aGuard(m_aMutex);
1156 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1157 checkColumnIndex(column);
1158 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateCharacterStream", *this);
1159 }
1160 /* }}} */
1161
1162
1163 /* {{{ OResultSet::refreshRow() -U- */
refreshRow()1164 void SAL_CALL OResultSet::refreshRow()
1165 {
1166 OSL_TRACE("OResultSet::refreshRow");
1167 MutexGuard aGuard(m_aMutex);
1168 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1169 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::refreshRow", *this);
1170 }
1171 /* }}} */
1172
1173
1174 /* {{{ OResultSet::updateObject() -U- */
updateObject(sal_Int32 column,const Any &)1175 void SAL_CALL OResultSet::updateObject(sal_Int32 column, const Any& /* x */)
1176 {
1177 OSL_TRACE("OResultSet::updateObject");
1178 MutexGuard aGuard(m_aMutex);
1179 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1180 checkColumnIndex(column);
1181 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateObject", *this);
1182 }
1183 /* }}} */
1184
1185
1186 /* {{{ OResultSet::updateNumericObject() -U- */
updateNumericObject(sal_Int32 column,const Any &,sal_Int32)1187 void SAL_CALL OResultSet::updateNumericObject(sal_Int32 column, const Any& /* x */, sal_Int32 /* scale */)
1188 {
1189 OSL_TRACE("OResultSet::updateNumericObject");
1190 MutexGuard aGuard(m_aMutex);
1191 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1192 checkColumnIndex(column);
1193 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateNumericObject", *this);
1194 }
1195 /* }}} */
1196
1197
1198 // XRowLocate
1199 /* {{{ OResultSet::getBookmark() -U- */
getBookmark()1200 Any SAL_CALL OResultSet::getBookmark()
1201 {
1202 OSL_TRACE("OResultSet::getBookmark");
1203 MutexGuard aGuard(m_aMutex);
1204 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1205 Any aRet = Any();
1206
1207 // if you don't want to support bookmark you must remove the XRowLocate interface
1208 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getBookmark", *this);
1209
1210 return aRet;
1211 }
1212 /* }}} */
1213
1214
1215 /* {{{ OResultSet::moveToBookmark() -U- */
moveToBookmark(const Any &)1216 sal_Bool SAL_CALL OResultSet::moveToBookmark(const Any& /* bookmark */)
1217 {
1218 OSL_TRACE("OResultSet::moveToBookmark");
1219 MutexGuard aGuard(m_aMutex);
1220 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1221
1222 return sal_False;
1223 }
1224 /* }}} */
1225
1226
1227 /* {{{ OResultSet::moveRelativeToBookmark() -U- */
moveRelativeToBookmark(const Any &,sal_Int32)1228 sal_Bool SAL_CALL OResultSet::moveRelativeToBookmark(const Any& /* bookmark */, sal_Int32 /* rows */)
1229 {
1230 OSL_TRACE("OResultSet::moveRelativeToBookmark");
1231 MutexGuard aGuard(m_aMutex);
1232 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1233
1234 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::moveRelativeToBookmark", *this);
1235 return sal_False;
1236 }
1237 /* }}} */
1238
1239
1240 /* {{{ OResultSet::compareBookmarks() -I- */
compareBookmarks(const Any &,const Any &)1241 sal_Int32 SAL_CALL OResultSet::compareBookmarks(const Any& /* n1 */, const Any& /* n2 */)
1242 {
1243 OSL_TRACE("OResultSet::compareBookmarks");
1244 MutexGuard aGuard(m_aMutex);
1245 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1246
1247 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::compareBookmarks", *this);
1248
1249 return CompareBookmark::NOT_EQUAL;
1250 }
1251 /* }}} */
1252
1253
1254 /* {{{ OResultSet::hasOrderedBookmarks() -I- */
hasOrderedBookmarks()1255 sal_Bool SAL_CALL OResultSet::hasOrderedBookmarks()
1256 {
1257 OSL_TRACE("OResultSet::hasOrderedBookmarks");
1258 return sal_False;
1259 }
1260 /* }}} */
1261
1262
1263 /* {{{ OResultSet::hashBookmark() -U- */
hashBookmark(const Any &)1264 sal_Int32 SAL_CALL OResultSet::hashBookmark(const Any& /* bookmark */)
1265 {
1266 OSL_TRACE("OResultSet::hashBookmark");
1267 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::hashBookmark", *this);
1268 return 0;
1269 }
1270 /* }}} */
1271
1272
1273 // XDeleteRows
1274 /* {{{ OResultSet::deleteRows() -U- */
deleteRows(const Sequence<Any> &)1275 Sequence< sal_Int32 > SAL_CALL OResultSet::deleteRows(const Sequence< Any >& /* rows */)
1276 {
1277 OSL_TRACE("OResultSet::deleteRows");
1278 MutexGuard aGuard(m_aMutex);
1279 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1280 Sequence< sal_Int32 > aRet = Sequence< sal_Int32 >();
1281
1282 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::deleteRows", *this);
1283 return aRet;
1284 }
1285 /* }}} */
1286
1287
1288 /* {{{ OResultSet::createArrayHelper() -I- */
createArrayHelper() const1289 IPropertyArrayHelper * OResultSet::createArrayHelper() const
1290 {
1291 OSL_TRACE("OResultSet::createArrayHelper");
1292 Sequence< Property > aProps(5);
1293 Property* pProperties = aProps.getArray();
1294 sal_Int32 nPos = 0;
1295 DECL_PROP0(FETCHDIRECTION, sal_Int32);
1296 DECL_PROP0(FETCHSIZE, sal_Int32);
1297 DECL_BOOL_PROP1IMPL(ISBOOKMARKABLE) PropertyAttribute::READONLY);
1298 DECL_PROP1IMPL(RESULTSETCONCURRENCY,sal_Int32) PropertyAttribute::READONLY);
1299 DECL_PROP1IMPL(RESULTSETTYPE, sal_Int32) PropertyAttribute::READONLY);
1300
1301 return new OPropertyArrayHelper(aProps);
1302 }
1303 /* }}} */
1304
1305
1306 /* {{{ OResultSet::getInfoHelper() -I- */
getInfoHelper()1307 IPropertyArrayHelper & OResultSet::getInfoHelper()
1308 {
1309 OSL_TRACE("OResultSet::getInfoHelper");
1310 return (*const_cast<OResultSet*>(this)->getArrayHelper());
1311 }
1312 /* }}} */
1313
1314
1315 /* {{{ OResultSet::convertFastPropertyValue() -I- */
convertFastPropertyValue(Any &,Any &,sal_Int32 nHandle,const Any &)1316 sal_Bool OResultSet::convertFastPropertyValue(Any & /* rConvertedValue */,
1317 Any & /* rOldValue */,
1318 sal_Int32 nHandle,
1319 const Any& /* rValue */)
1320 {
1321 OSL_TRACE("OResultSet::convertFastPropertyValue");
1322 switch (nHandle) {
1323 case PROPERTY_ID_ISBOOKMARKABLE:
1324 case PROPERTY_ID_CURSORNAME:
1325 case PROPERTY_ID_RESULTSETCONCURRENCY:
1326 case PROPERTY_ID_RESULTSETTYPE:
1327 throw ::com::sun::star::lang::IllegalArgumentException();
1328 case PROPERTY_ID_FETCHDIRECTION:
1329 case PROPERTY_ID_FETCHSIZE:
1330 default:
1331 ;
1332 }
1333 return sal_False;
1334 }
1335 /* }}} */
1336
1337
1338 /* {{{ OResultSet::setFastPropertyValue_NoBroadcast() -I- */
setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any &)1339 void OResultSet::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const Any& /* rValue */)
1340 {
1341 OSL_TRACE("OResultSet::setFastPropertyValue_NoBroadcast");
1342 switch (nHandle) {
1343 case PROPERTY_ID_ISBOOKMARKABLE:
1344 case PROPERTY_ID_CURSORNAME:
1345 case PROPERTY_ID_RESULTSETCONCURRENCY:
1346 case PROPERTY_ID_RESULTSETTYPE:
1347 throw Exception();
1348 case PROPERTY_ID_FETCHDIRECTION:
1349 break;
1350 case PROPERTY_ID_FETCHSIZE:
1351 break;
1352 default:
1353 ;
1354 }
1355 }
1356 /* }}} */
1357
1358
1359 /* {{{ OResultSet::getFastPropertyValue() -I- */
getFastPropertyValue(Any & _rValue,sal_Int32 nHandle) const1360 void OResultSet::getFastPropertyValue(Any& _rValue, sal_Int32 nHandle) const
1361 {
1362 OSL_TRACE("OResultSet::getFastPropertyValue");
1363 switch (nHandle) {
1364 case PROPERTY_ID_ISBOOKMARKABLE:
1365 _rValue <<= sal_False;
1366 break;
1367 case PROPERTY_ID_CURSORNAME:
1368 break;
1369 case PROPERTY_ID_RESULTSETCONCURRENCY:
1370 _rValue <<= ResultSetConcurrency::READ_ONLY;
1371 break;
1372 case PROPERTY_ID_RESULTSETTYPE:
1373 _rValue <<= ResultSetType::SCROLL_INSENSITIVE;
1374 break;
1375 case PROPERTY_ID_FETCHDIRECTION:
1376 _rValue <<= FetchDirection::FORWARD;
1377 break;
1378 case PROPERTY_ID_FETCHSIZE:
1379 _rValue <<= sal_Int32(50);
1380 break;
1381 ;
1382 default:
1383 ;
1384 }
1385 }
1386 /* }}} */
1387
1388
1389 /* {{{ OResultSet::acquire() -I- */
acquire()1390 void SAL_CALL OResultSet::acquire()
1391 throw()
1392 {
1393 OSL_TRACE("OResultSet::acquire");
1394 OResultSet_BASE::acquire();
1395 }
1396 /* }}} */
1397
1398
1399 /* {{{ OResultSet::release() -I- */
release()1400 void SAL_CALL OResultSet::release()
1401 throw()
1402 {
1403 OSL_TRACE("OResultSet::release");
1404 OResultSet_BASE::release();
1405 }
1406 /* }}} */
1407
1408
1409 /* {{{ OResultSet::getPropertySetInfo() -I- */
getPropertySetInfo()1410 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OResultSet::getPropertySetInfo()
1411 {
1412 OSL_TRACE("OResultSet::getPropertySetInfo");
1413 return (::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper()));
1414 }
1415 /* }}} */
1416
1417
1418 /* {{{ OResultSet::checkColumnIndex() -I- */
checkColumnIndex(sal_Int32 index)1419 void OResultSet::checkColumnIndex(sal_Int32 index)
1420 {
1421 OSL_TRACE("OResultSet::checkColumnIndex");
1422 if ((index < 1 || index > (int) fieldCount)) {
1423 /* static object for efficiency or thread safety is a problem ? */
1424 OUString buf( RTL_CONSTASCII_USTRINGPARAM( "index out of range" ) );
1425 throw SQLException(buf, *this, OUString(), 1, Any());
1426 }
1427 }
1428 /* }}} */
1429
1430
1431 /*
1432 * Local variables:
1433 * tab-width: 4
1434 * c-basic-offset: 4
1435 * End:
1436 * vim600: noet sw=4 ts=4 fdm=marker
1437 * vim<600: noet sw=4 ts=4
1438 */
1439