bump product version to 4.1.6.2
[LibreOffice.git] / mysqlc / source / mysqlc_resultset.cxx
blobb0bd52881bfed8a9af550690246aa80752a7da1c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "mysqlc_propertyids.hxx"
21 #include "mysqlc_general.hxx"
22 #include "mysqlc_resultset.hxx"
23 #include "mysqlc_resultsetmetadata.hxx"
25 #include <com/sun/star/sdbc/DataType.hpp>
26 #include <com/sun/star/beans/PropertyAttribute.hpp>
27 #include <com/sun/star/sdbcx/CompareBookmark.hpp>
28 #include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
29 #include <com/sun/star/sdbc/ResultSetType.hpp>
30 #include <com/sun/star/sdbc/FetchDirection.hpp>
31 #include <cppuhelper/typeprovider.hxx>
32 #include <com/sun/star/lang/DisposedException.hpp>
34 using namespace connectivity::mysqlc;
35 using namespace cppu;
36 using namespace com::sun::star::uno;
37 using namespace com::sun::star::lang;
38 using namespace com::sun::star::beans;
39 using namespace com::sun::star::sdbc;
40 using namespace com::sun::star::sdbcx;
41 using namespace com::sun::star::container;
42 using namespace com::sun::star::io;
43 using namespace com::sun::star::util;
44 using ::osl::MutexGuard;
46 #include <cppconn/resultset.h>
47 #include <cppconn/resultset_metadata.h>
49 #include <stdio.h>
52 // IMPLEMENT_SERVICE_INFO(OResultSet,"com.sun.star.sdbcx.OResultSet","com.sun.star.sdbc.ResultSet");
53 /* {{{ OResultSet::getImplementationName() -I- */
54 OUString SAL_CALL OResultSet::getImplementationName()
55 throw (RuntimeException)
57 OSL_TRACE("OResultSet::getImplementationName");
58 return OUString( "com.sun.star.sdbcx.mysqlc.ResultSet" );
60 /* }}} */
63 /* {{{ OResultSet::getSupportedServiceNames() -I- */
64 Sequence< OUString > SAL_CALL OResultSet::getSupportedServiceNames()
65 throw(RuntimeException)
67 OSL_TRACE("OResultSet::getSupportedServiceNames");
68 Sequence< OUString > aSupported(2);
69 aSupported[0] = OUString( "com.sun.star.sdbc.ResultSet" );
70 aSupported[1] = OUString( "com.sun.star.sdbcx.ResultSet" );
71 return (aSupported);
73 /* }}} */
76 /* {{{ OResultSet::supportsService() -I- */
77 sal_Bool SAL_CALL OResultSet::supportsService(const OUString& _rServiceName)
78 throw(RuntimeException)
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) {}
86 return (pSupported != pEnd);
88 /* }}} */
91 /* {{{ OResultSet::OResultSet() -I- */
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 )
101 OSL_TRACE("OResultSet::OResultSet");
102 try {
103 sql::ResultSetMetaData * rs_meta = m_result->getMetaData();
104 fieldCount = rs_meta->getColumnCount();
105 } catch (const sql::SQLException &e) {
106 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
109 /* }}} */
112 /* {{{ OResultSet::~OResultSet() -I- */
113 OResultSet::~OResultSet()
115 OSL_TRACE("OResultSet::~OResultSet");
117 /* }}} */
120 /* {{{ OResultSet::disposing() -I- */
121 void OResultSet::disposing()
123 OSL_TRACE("OResultSet::disposing");
124 OPropertySetHelper::disposing();
126 MutexGuard aGuard(m_aMutex);
128 m_aStatement = NULL;
129 m_xMetaData = NULL;
131 /* }}} */
134 /* {{{ OResultSet::queryInterface() -I- */
135 Any SAL_CALL OResultSet::queryInterface(const Type & rType)
136 throw(RuntimeException)
138 OSL_TRACE("OResultSet::queryInterface");
139 Any aRet = OPropertySetHelper::queryInterface(rType);
140 if (!aRet.hasValue()) {
141 aRet = OResultSet_BASE::queryInterface(rType);
143 return aRet;
145 /* }}} */
148 /* {{{ OResultSet::getTypes() -I- */
149 Sequence< Type > SAL_CALL OResultSet::getTypes()
150 throw(RuntimeException)
152 OSL_TRACE("OResultSet::getTypes");
153 OTypeCollection aTypes( ::getCppuType((const Reference< XMultiPropertySet > *) NULL),
154 ::getCppuType((const Reference< XFastPropertySet > *) NULL),
155 ::getCppuType((const Reference< XPropertySet > *) NULL));
157 return concatSequences(aTypes.getTypes(), OResultSet_BASE::getTypes());
159 /* }}} */
162 /* {{{ OResultSet::findColumn() -I- */
163 sal_Int32 SAL_CALL OResultSet::findColumn(const OUString& columnName)
164 throw(SQLException, RuntimeException)
166 OSL_TRACE("OResultSet::findColumn");
167 MutexGuard aGuard(m_aMutex);
168 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
170 try {
171 // find the first column with the name columnName
172 sql::ResultSetMetaData * meta = m_result->getMetaData();
173 for (sal_uInt32 i = 1; i <= fieldCount; i++) {
174 if (columnName.equalsIgnoreAsciiCaseAscii(meta->getColumnName(i).c_str())) {
175 /* SDBC knows them indexed from 1 */
176 return i;
179 } catch (const sql::SQLException &e) {
180 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
182 return 0;
184 /* }}} */
187 /* {{{ OResultSet::getBinaryStream() -U- */
188 Reference< XInputStream > SAL_CALL OResultSet::getBinaryStream(sal_Int32 column)
189 throw(SQLException, RuntimeException)
191 OSL_TRACE("OResultSet::getBinaryStream");
192 MutexGuard aGuard(m_aMutex);
193 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
194 checkColumnIndex(column);
196 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getBinaryStream", *this);
197 return NULL;
199 /* }}} */
202 /* {{{ OResultSet::getCharacterStream() -U- */
203 Reference< XInputStream > SAL_CALL OResultSet::getCharacterStream(sal_Int32 column)
204 throw(SQLException, RuntimeException)
206 OSL_TRACE("OResultSet::getCharacterStream");
207 MutexGuard aGuard(m_aMutex);
208 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
209 checkColumnIndex(column);
211 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getCharacterStream", *this);
212 return NULL;
214 /* }}} */
217 /* {{{ OResultSet::getBoolean() -I- */
218 sal_Bool SAL_CALL OResultSet::getBoolean(sal_Int32 column)
219 throw(SQLException, RuntimeException)
221 OSL_TRACE("OResultSet::getBoolean");
222 MutexGuard aGuard(m_aMutex);
223 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
225 checkColumnIndex(column);
226 try {
227 return m_result->getBoolean(column)? sal_True:sal_False;
228 } catch (const sql::SQLException &e) {
229 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
231 return sal_False;
233 /* }}} */
236 /* {{{ OResultSet::getByte() -I- */
237 sal_Int8 SAL_CALL OResultSet::getByte(sal_Int32 column)
238 throw(SQLException, RuntimeException)
240 OSL_TRACE("OResultSet::getByte");
241 MutexGuard aGuard(m_aMutex);
242 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
244 checkColumnIndex(column);
245 try {
246 return m_result->getInt(column);
247 } catch (const sql::SQLException &e) {
248 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
250 return 0; // fool compiler
252 /* }}} */
255 /* {{{ OResultSet::getBytes() -I- */
256 Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes(sal_Int32 column)
257 throw(SQLException, RuntimeException)
259 OSL_TRACE("OResultSet::getBytes");
261 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
262 MutexGuard aGuard(m_aMutex);
265 sql::SQLString val = m_result->getString(column);
266 if (!val.length()) {
267 return Sequence< sal_Int8>();
268 } else {
269 return Sequence< sal_Int8 > ((sal_Int8*)val.c_str(), val.length());
272 /* }}} */
275 /* {{{ OResultSet::getDate() -I- */
276 Date SAL_CALL OResultSet::getDate(sal_Int32 column)
277 throw(SQLException, RuntimeException)
279 OSL_TRACE("OResultSet::getDate");
280 MutexGuard aGuard(m_aMutex);
281 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
282 checkColumnIndex(column);
284 Date d;
285 try {
286 OUString dateString = getString(column);
287 OUString token;
288 sal_Int32 nIndex = 0, i=0;
290 do {
291 token = dateString.getToken (0, '-', nIndex);
292 switch (i) {
293 case 0:
294 d.Year = static_cast<sal_uInt16>(token.toInt32(10));
295 break;
296 case 1:
297 d.Month = static_cast<sal_uInt16>(token.toInt32(10));
298 break;
299 case 2:
300 d.Day = static_cast<sal_uInt16>(token.toInt32(10));
301 break;
302 default:;
304 i++;
305 } while (nIndex >= 0);
306 } catch (const sql::SQLException &e) {
307 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
309 return d;
311 /* }}} */
314 /* {{{ OResultSet::getDouble() -I- */
315 double SAL_CALL OResultSet::getDouble(sal_Int32 column)
316 throw(SQLException, RuntimeException)
318 OSL_TRACE("OResultSet::getDouble");
319 MutexGuard aGuard(m_aMutex);
320 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
322 checkColumnIndex(column);
323 try {
324 return m_result->getDouble(column);
325 } catch (const sql::SQLException &e) {
326 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
328 return 0.0; // fool compiler
330 /* }}} */
333 /* {{{ OResultSet::getFloat() -I- */
334 float SAL_CALL OResultSet::getFloat(sal_Int32 column)
335 throw(SQLException, RuntimeException)
337 OSL_TRACE("OResultSet::getFloat");
338 MutexGuard aGuard(m_aMutex);
339 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
341 checkColumnIndex(column);
342 try {
343 return m_result->getDouble(column);
344 } catch (const sql::SQLException &e) {
345 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
347 return 0.0; // fool compiler
349 /* }}} */
352 /* {{{ OResultSet::getInt() -I- */
353 sal_Int32 SAL_CALL OResultSet::getInt(sal_Int32 column)
354 throw(SQLException, RuntimeException)
356 OSL_TRACE("OResultSet::getInt");
357 MutexGuard aGuard(m_aMutex);
358 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
360 checkColumnIndex(column);
361 try {
362 return m_result->getInt(column);
363 } catch (const sql::SQLException &e) {
364 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
366 return 0; // fool compiler
368 /* }}} */
371 /* {{{ OResultSet::getRow() -I- */
372 sal_Int32 SAL_CALL OResultSet::getRow()
373 throw(SQLException, RuntimeException)
375 OSL_TRACE("OResultSet::getRow");
376 MutexGuard aGuard(m_aMutex);
377 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
379 try {
380 return m_result->getRow();
381 } catch (const sql::SQLException &e) {
382 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
384 return 0; // fool compiler
386 /* }}} */
389 /* {{{ OResultSet::getLong() -I- */
390 sal_Int64 SAL_CALL OResultSet::getLong(sal_Int32 column)
391 throw(SQLException, RuntimeException)
393 OSL_TRACE("OResultSet::getLong");
394 MutexGuard aGuard(m_aMutex);
395 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
397 checkColumnIndex(column);
398 try {
399 return m_result->getInt64(column);
400 } catch (const sql::SQLException &e) {
401 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
403 return 0; // fool compiler
405 /* }}} */
408 /* {{{ OResultSet::getMetaData() -I- */
409 Reference< XResultSetMetaData > SAL_CALL OResultSet::getMetaData()
410 throw(SQLException, RuntimeException)
412 OSL_TRACE("OResultSet::getMetaData");
413 MutexGuard aGuard(m_aMutex);
414 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
415 try {
416 if (!m_xMetaData.is()) {
417 m_xMetaData = new OResultSetMetaData(m_result->getMetaData(), m_encoding);
419 } catch (const sql::MethodNotImplementedException &) {
420 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getMetaData", *this);
421 } catch (const sql::SQLException &e) {
422 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
424 return m_xMetaData;
426 /* }}} */
429 /* {{{ OResultSet::getArray() -U- */
430 Reference< XArray > SAL_CALL OResultSet::getArray(sal_Int32 column)
431 throw(SQLException, RuntimeException)
433 OSL_TRACE("OResultSet::getArray");
434 MutexGuard aGuard(m_aMutex);
435 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
436 checkColumnIndex(column);
438 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getArray", *this);
439 return NULL;
441 /* }}} */
444 /* {{{ OResultSet::getClob() -U- */
445 Reference< XClob > SAL_CALL OResultSet::getClob(sal_Int32 column)
446 throw(SQLException, RuntimeException)
448 OSL_TRACE("OResultSet::getClob");
449 MutexGuard aGuard(m_aMutex);
450 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
451 checkColumnIndex(column);
453 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getClob", *this);
454 return NULL;
456 /* }}} */
459 /* {{{ OResultSet::getBlob() -U- */
460 Reference< XBlob > SAL_CALL OResultSet::getBlob(sal_Int32 column)
461 throw(SQLException, RuntimeException)
463 OSL_TRACE("OResultSet::getBlob");
464 MutexGuard aGuard(m_aMutex);
465 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
466 checkColumnIndex(column);
468 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getBlob", *this);
469 return NULL;
471 /* }}} */
474 /* {{{ OResultSet::getRef() -U- */
475 Reference< XRef > SAL_CALL OResultSet::getRef(sal_Int32 column)
476 throw(SQLException, RuntimeException)
478 OSL_TRACE("OResultSet::getRef");
479 MutexGuard aGuard(m_aMutex);
480 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
481 checkColumnIndex(column);
483 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getRef", *this);
484 return NULL;
486 /* }}} */
489 /* {{{ OResultSet::getObject() -U- */
490 Any SAL_CALL OResultSet::getObject(sal_Int32 column, const Reference< XNameAccess >& /* typeMap */)
491 throw(SQLException, RuntimeException)
493 OSL_TRACE("OResultSet::getObject");
494 MutexGuard aGuard(m_aMutex);
495 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
496 checkColumnIndex(column);
498 Any aRet= Any();
500 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getObject", *this);
501 return aRet;
503 /* }}} */
506 /* {{{ OResultSet::getShort() -I- */
507 sal_Int16 SAL_CALL OResultSet::getShort(sal_Int32 column)
508 throw(SQLException, RuntimeException)
510 OSL_TRACE("OResultSet::getShort");
511 MutexGuard aGuard(m_aMutex);
512 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
514 try {
515 return (sal_Int16) m_result->getInt(column);
516 } catch (const sql::SQLException &e) {
517 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
519 return 0; // fool compiler
521 /* }}} */
524 /* {{{ OResultSet::getString() -I- */
525 OUString SAL_CALL OResultSet::getString(sal_Int32 column)
526 throw(SQLException, RuntimeException)
528 OSL_TRACE("OResultSet::getString");
529 MutexGuard aGuard(m_aMutex);
530 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
532 checkColumnIndex(column);
534 try {
535 sql::SQLString val = m_result->getString(column);
536 if (!m_result->wasNull()) {
537 return OUString( val.c_str(), val.length(), m_encoding );
538 } else {
539 return OUString();
541 } catch (const sql::SQLException &e) {
542 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
544 return OUString(); // fool compiler
546 /* }}} */
549 /* {{{ OResultSet::getTime() -I- */
550 Time SAL_CALL OResultSet::getTime(sal_Int32 column)
551 throw(SQLException, RuntimeException)
553 OSL_TRACE("OResultSet::getTime");
554 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
555 MutexGuard aGuard(m_aMutex);
557 checkColumnIndex(column);
558 Time t;
559 OUString timeString = getString(column);
560 OUString token;
561 sal_Int32 nIndex, i=0;
563 nIndex = timeString.indexOf(' ') + 1;
565 do {
566 token = timeString.getToken (0, ':', nIndex);
567 switch (i) {
568 case 0:
569 t.Hours = static_cast<sal_uInt16>(token.toInt32(10));
570 break;
571 case 1:
572 t.Minutes = static_cast<sal_uInt16>(token.toInt32(10));
573 break;
574 case 2:
575 t.Seconds = static_cast<sal_uInt16>(token.toInt32(10));
576 break;
578 i++;
579 } while (nIndex >= 0);
581 return t;
583 /* }}} */
586 /* {{{ OResultSet::getTimestamp() -I- */
587 DateTime SAL_CALL OResultSet::getTimestamp(sal_Int32 column)
588 throw(SQLException, RuntimeException)
590 OSL_TRACE("OResultSet::getTimestamp");
591 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
592 MutexGuard aGuard(m_aMutex);
594 checkColumnIndex(column);
595 DateTime dt;
596 Date d = getDate(column);
597 Time t = getTime(column);
599 dt.Year = d.Year;
600 dt.Month = d.Month;
601 dt.Day = d.Day;
602 dt.Hours = t.Hours;
603 dt.Minutes = t.Minutes;
604 dt.Seconds = t.Seconds;
605 return dt;
607 /* }}} */
610 /* {{{ OResultSet::isBeforeFirst() -I- */
611 sal_Bool SAL_CALL OResultSet::isBeforeFirst()
612 throw(SQLException, RuntimeException)
614 OSL_TRACE("OResultSet::isBeforeFirst");
615 MutexGuard aGuard(m_aMutex);
616 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
618 try {
619 return m_result->isBeforeFirst()? sal_True:sal_False;
620 } catch (const sql::SQLException &e) {
621 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
623 return sal_False; //fool
625 /* }}} */
628 /* {{{ OResultSet::isAfterLast() -I- */
629 sal_Bool SAL_CALL OResultSet::isAfterLast()
630 throw(SQLException, RuntimeException)
632 OSL_TRACE("OResultSet::isAfterLast");
633 MutexGuard aGuard(m_aMutex);
634 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
636 try {
637 return m_result->isAfterLast()? sal_True:sal_False;
638 } catch (const sql::SQLException &e) {
639 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
641 return sal_False; //fool
643 /* }}} */
646 /* {{{ OResultSet::isFirst() -I- */
647 sal_Bool SAL_CALL OResultSet::isFirst()
648 throw(SQLException, RuntimeException)
650 OSL_TRACE("OResultSet::isFirst");
651 MutexGuard aGuard(m_aMutex);
652 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
654 try {
655 return m_result->isFirst();
656 } catch (const sql::SQLException &e) {
657 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
659 return sal_False; //fool
661 /* }}} */
664 /* {{{ OResultSet::isLast() -I- */
665 sal_Bool SAL_CALL OResultSet::isLast()
666 throw(SQLException, RuntimeException)
668 OSL_TRACE("OResultSet::isLast");
669 MutexGuard aGuard(m_aMutex);
670 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
672 try {
673 return m_result->isLast()? sal_True:sal_False;
674 } catch (const sql::SQLException &e) {
675 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
677 return sal_False; //fool
679 /* }}} */
682 /* {{{ OResultSet::beforeFirst() -I- */
683 void SAL_CALL OResultSet::beforeFirst()
684 throw(SQLException, RuntimeException)
686 OSL_TRACE("OResultSet::beforeFirst");
687 MutexGuard aGuard(m_aMutex);
688 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
690 try {
691 m_result->beforeFirst();
692 } catch (const sql::SQLException &e) {
693 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
696 /* }}} */
699 /* {{{ OResultSet::afterLast() -I- */
700 void SAL_CALL OResultSet::afterLast()
701 throw(SQLException, RuntimeException)
703 OSL_TRACE("OResultSet::afterLast");
704 MutexGuard aGuard(m_aMutex);
705 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
707 try {
708 m_result->afterLast();
709 } catch (const sql::SQLException &e) {
710 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
713 /* }}} */
716 /* {{{ OResultSet::close() -I- */
717 void SAL_CALL OResultSet::close() throw(SQLException, RuntimeException)
719 OSL_TRACE("OResultSet::close");
720 MutexGuard aGuard(m_aMutex);
721 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
723 try {
724 m_result->close();
725 } catch (const sql::SQLException &e) {
726 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
729 dispose();
731 /* }}} */
734 /* {{{ OResultSet::first() -I- */
735 sal_Bool SAL_CALL OResultSet::first() throw(SQLException, RuntimeException)
737 OSL_TRACE("OResultSet::first");
738 MutexGuard aGuard(m_aMutex);
739 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
741 try {
742 return m_result->first()? sal_True:sal_False;
743 } catch (const sql::SQLException &e) {
744 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
746 return sal_False; //fool
748 /* }}} */
751 /* {{{ OResultSet::last() -I- */
752 sal_Bool SAL_CALL OResultSet::last()
753 throw(SQLException, RuntimeException)
755 OSL_TRACE("OResultSet::last");
756 MutexGuard aGuard(m_aMutex);
757 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
759 try {
760 return m_result->last()? sal_True:sal_False;
761 } catch (const sql::SQLException &e) {
762 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
764 return sal_False; //fool
766 /* }}} */
769 /* {{{ OResultSet::absolute() -I- */
770 sal_Bool SAL_CALL OResultSet::absolute(sal_Int32 row)
771 throw(SQLException, RuntimeException)
773 OSL_TRACE("OResultSet::absolute");
774 MutexGuard aGuard(m_aMutex);
775 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
777 try {
778 return m_result->absolute(row)? sal_True:sal_False;
779 } catch (const sql::SQLException &e) {
780 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
782 return sal_False; //fool
784 /* }}} */
787 /* {{{ OResultSet::relative() -I- */
788 sal_Bool SAL_CALL OResultSet::relative(sal_Int32 row)
789 throw(SQLException, RuntimeException)
791 OSL_TRACE("OResultSet::relative");
792 MutexGuard aGuard(m_aMutex);
793 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
795 try {
796 return m_result->relative(row)? sal_True:sal_False;
797 } catch (const sql::SQLException &e) {
798 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
800 return sal_False; //fool
802 /* }}} */
805 /* {{{ OResultSet::previous() -I- */
806 sal_Bool SAL_CALL OResultSet::previous()
807 throw(SQLException, RuntimeException)
809 OSL_TRACE("OResultSet::previous");
810 MutexGuard aGuard(m_aMutex);
811 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
813 try {
814 return m_result->previous()? sal_True:sal_False;
815 } catch (const sql::SQLException &e) {
816 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
818 return sal_False; //fool
820 /* }}} */
823 /* {{{ OResultSet::getStatement() -I- */
824 Reference< XInterface > SAL_CALL OResultSet::getStatement()
825 throw(SQLException, RuntimeException)
827 OSL_TRACE("OResultSet::getStatement");
828 MutexGuard aGuard(m_aMutex);
829 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
831 return m_aStatement.get();
833 /* }}} */
836 /* {{{ OResultSet::rowDeleted() -I- */
837 sal_Bool SAL_CALL OResultSet::rowDeleted()
838 throw(SQLException, RuntimeException)
840 OSL_TRACE("OResultSet::rowDeleted");
841 MutexGuard aGuard(m_aMutex);
842 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
844 return sal_False;
846 /* }}} */
849 /* {{{ OResultSet::rowInserted() -I- */
850 sal_Bool SAL_CALL OResultSet::rowInserted()
851 throw(SQLException, RuntimeException)
853 OSL_TRACE("OResultSet::rowInserted");
854 MutexGuard aGuard(m_aMutex);
855 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
857 return sal_False;
859 /* }}} */
862 /* {{{ OResultSet::rowUpdated() -I- */
863 sal_Bool SAL_CALL OResultSet::rowUpdated()
864 throw(SQLException, RuntimeException)
866 OSL_TRACE("OResultSet::rowUpdated");
867 MutexGuard aGuard(m_aMutex);
868 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
870 return sal_False;
872 /* }}} */
875 /* {{{ OResultSet::next() -I- */
876 sal_Bool SAL_CALL OResultSet::next()
877 throw(SQLException, RuntimeException)
879 OSL_TRACE("OResultSet::next");
880 MutexGuard aGuard(m_aMutex);
881 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
883 try {
884 return m_result->next()? sal_True:sal_False;
885 } catch (const sql::SQLException &e) {
886 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
888 return sal_False; //fool
890 /* }}} */
893 /* {{{ OResultSet::wasNull() -I- */
894 sal_Bool SAL_CALL OResultSet::wasNull()
895 throw(SQLException, RuntimeException)
897 OSL_TRACE("OResultSet::wasNull");
898 MutexGuard aGuard(m_aMutex);
899 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
901 try {
902 return m_result->wasNull()? sal_True:sal_False;
903 } catch (const sql::SQLException &e) {
904 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
906 return sal_False; //fool
908 /* }}} */
911 /* {{{ OResultSet::cancel() -I- */
912 void SAL_CALL OResultSet::cancel()
913 throw(RuntimeException)
915 OSL_TRACE("OResultSet::cancel");
916 MutexGuard aGuard(m_aMutex);
917 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
919 /* }}} */
922 /* {{{ OResultSet::clearWarnings() -I- */
923 void SAL_CALL OResultSet::clearWarnings()
924 throw(SQLException, RuntimeException)
926 OSL_TRACE("OResultSet::clearWarnings");
928 /* }}} */
931 /* {{{ OResultSet::getWarnings() -I- */
932 Any SAL_CALL OResultSet::getWarnings()
933 throw(SQLException, RuntimeException)
935 OSL_TRACE("OResultSet::getWarnings");
936 Any aRet= Any();
937 return aRet;
939 /* }}} */
942 /* {{{ OResultSet::insertRow() -I- */
943 void SAL_CALL OResultSet::insertRow()
944 throw(SQLException, RuntimeException)
946 OSL_TRACE("OResultSet::insertRow");
947 MutexGuard aGuard(m_aMutex);
948 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
949 // you only have to implement this if you want to insert new rows
950 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::insertRow", *this);
952 /* }}} */
955 /* {{{ OResultSet::updateRow() -I- */
956 void SAL_CALL OResultSet::updateRow()
957 throw(SQLException, RuntimeException)
959 OSL_TRACE("OResultSet::updateRow");
960 MutexGuard aGuard(m_aMutex);
961 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
963 // only when you allow updates
964 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateRow", *this);
966 /* }}} */
969 /* {{{ OResultSet::deleteRow() -I- */
970 void SAL_CALL OResultSet::deleteRow()
971 throw(SQLException, RuntimeException)
973 OSL_TRACE("OResultSet::deleteRow");
974 MutexGuard aGuard(m_aMutex);
975 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
976 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::deleteRow", *this);
978 /* }}} */
981 /* {{{ OResultSet::cancelRowUpdates() -I- */
982 void SAL_CALL OResultSet::cancelRowUpdates()
983 throw(SQLException, RuntimeException)
985 OSL_TRACE("OResultSet::cancelRowUpdates");
986 MutexGuard aGuard(m_aMutex);
987 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
988 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::cancelRowUpdates", *this);
990 /* }}} */
993 /* {{{ OResultSet::moveToInsertRow() -I- */
994 void SAL_CALL OResultSet::moveToInsertRow()
995 throw(SQLException, RuntimeException)
997 OSL_TRACE("OResultSet::moveToInsertRow");
998 MutexGuard aGuard(m_aMutex);
999 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1001 // only when you allow insert's
1002 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::moveToInsertRow", *this);
1004 /* }}} */
1007 /* {{{ OResultSet::moveToCurrentRow() -I- */
1008 void SAL_CALL OResultSet::moveToCurrentRow()
1009 throw(SQLException, RuntimeException)
1011 OSL_TRACE("OResultSet::moveToCurrentRow");
1012 MutexGuard aGuard(m_aMutex);
1013 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1015 /* }}} */
1018 /* {{{ OResultSet::updateNull() -U- */
1019 void SAL_CALL OResultSet::updateNull(sal_Int32 column)
1020 throw(SQLException, RuntimeException)
1022 OSL_TRACE("OResultSet::updateNull");
1023 MutexGuard aGuard(m_aMutex);
1024 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1025 checkColumnIndex(column);
1026 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateNull", *this);
1028 /* }}} */
1031 /* {{{ OResultSet::updateBoolean() -U- */
1032 void SAL_CALL OResultSet::updateBoolean(sal_Int32 column, sal_Bool /* x */)
1033 throw(SQLException, RuntimeException)
1035 OSL_TRACE("OResultSet::updateBoolean");
1036 MutexGuard aGuard(m_aMutex);
1037 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1038 checkColumnIndex(column);
1039 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateBoolean", *this);
1041 /* }}} */
1044 /* {{{ OResultSet::updateByte() -U- */
1045 void SAL_CALL OResultSet::updateByte(sal_Int32 column, sal_Int8 /* x */)
1046 throw(SQLException, RuntimeException)
1048 OSL_TRACE("OResultSet::updateByte");
1049 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1050 MutexGuard aGuard(m_aMutex);
1051 checkColumnIndex(column);
1052 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateByte", *this);
1054 /* }}} */
1057 /* {{{ OResultSet::updateShort() -U- */
1058 void SAL_CALL OResultSet::updateShort(sal_Int32 column, sal_Int16 /* x */)
1059 throw(SQLException, RuntimeException)
1061 OSL_TRACE("OResultSet::updateShort");
1062 MutexGuard aGuard(m_aMutex);
1063 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1064 checkColumnIndex(column);
1065 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateShort", *this);
1067 /* }}} */
1070 /* {{{ OResultSet::updateInt() -U- */
1071 void SAL_CALL OResultSet::updateInt(sal_Int32 column, sal_Int32 /* x */)
1072 throw(SQLException, RuntimeException)
1074 OSL_TRACE("OResultSet::updateInt");
1075 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1076 MutexGuard aGuard(m_aMutex);
1077 checkColumnIndex(column);
1078 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateInt", *this);
1080 /* }}} */
1083 /* {{{ OResultSet::updateLong() -U- */
1084 void SAL_CALL OResultSet::updateLong(sal_Int32 column, sal_Int64 /* x */)
1085 throw(SQLException, RuntimeException)
1087 OSL_TRACE("OResultSet::updateLong");
1088 MutexGuard aGuard(m_aMutex);
1089 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1090 checkColumnIndex(column);
1091 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateLong", *this);
1093 /* }}} */
1096 /* {{{ OResultSet::updateFloat() -U- */
1097 void SAL_CALL OResultSet::updateFloat(sal_Int32 column, float /* x */)
1098 throw(SQLException, RuntimeException)
1100 OSL_TRACE("OResultSet::updateFloat");
1101 MutexGuard aGuard(m_aMutex);
1102 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1103 checkColumnIndex(column);
1104 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateFloat", *this);
1106 /* }}} */
1109 /* {{{ OResultSet::updateDouble() -U- */
1110 void SAL_CALL OResultSet::updateDouble(sal_Int32 column, double /* x */)
1111 throw(SQLException, RuntimeException)
1113 OSL_TRACE("OResultSet::updateDouble");
1114 MutexGuard aGuard(m_aMutex);
1115 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1116 checkColumnIndex(column);
1117 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateDouble", *this);
1119 /* }}} */
1122 /* {{{ OResultSet::updateString() -U- */
1123 void SAL_CALL OResultSet::updateString(sal_Int32 column, const OUString& /* x */)
1124 throw(SQLException, RuntimeException)
1126 OSL_TRACE("OResultSet::updateString");
1127 MutexGuard aGuard(m_aMutex);
1128 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1129 checkColumnIndex(column);
1130 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateString", *this);
1132 /* }}} */
1135 /* {{{ OResultSet::updateBytes() -U- */
1136 void SAL_CALL OResultSet::updateBytes(sal_Int32 column, const Sequence< sal_Int8 >& /* x */)
1137 throw(SQLException, RuntimeException)
1139 OSL_TRACE("OResultSet::updateBytes");
1140 MutexGuard aGuard(m_aMutex);
1141 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1142 checkColumnIndex(column);
1143 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateBytes", *this);
1145 /* }}} */
1148 /* {{{ OResultSet::updateDate() -U- */
1149 void SAL_CALL OResultSet::updateDate(sal_Int32 column, const Date& /* x */)
1150 throw(SQLException, RuntimeException)
1152 OSL_TRACE("OResultSet::updateDate");
1153 MutexGuard aGuard(m_aMutex);
1154 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1155 checkColumnIndex(column);
1156 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateDate", *this);
1158 /* }}} */
1161 /* {{{ OResultSet::updateTime() -U- */
1162 void SAL_CALL OResultSet::updateTime(sal_Int32 column, const Time& /* x */)
1163 throw(SQLException, RuntimeException)
1165 OSL_TRACE("OResultSet::updateTime");
1166 MutexGuard aGuard(m_aMutex);
1167 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1168 checkColumnIndex(column);
1169 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateTime", *this);
1171 /* }}} */
1174 /* {{{ OResultSet::updateTimestamp() -U- */
1175 void SAL_CALL OResultSet::updateTimestamp(sal_Int32 column, const DateTime& /* x */)
1176 throw(SQLException, RuntimeException)
1178 OSL_TRACE("OResultSet::updateTimestamp");
1179 MutexGuard aGuard(m_aMutex);
1180 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1181 checkColumnIndex(column);
1182 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateTimestamp", *this);
1184 /* }}} */
1187 /* {{{ OResultSet::updateBinaryStream() -U- */
1188 void SAL_CALL OResultSet::updateBinaryStream(sal_Int32 column, const Reference< XInputStream >& /* x */,
1189 sal_Int32 /* length */)
1190 throw(SQLException, RuntimeException)
1192 OSL_TRACE("OResultSet::updateBinaryStream");
1193 MutexGuard aGuard(m_aMutex);
1194 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1195 checkColumnIndex(column);
1196 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateBinaryStream", *this);
1198 /* }}} */
1201 /* {{{ OResultSet::updateCharacterStream() -U- */
1202 void SAL_CALL OResultSet::updateCharacterStream(sal_Int32 column, const Reference< XInputStream >& /* x */,
1203 sal_Int32 /* length */)
1204 throw(SQLException, RuntimeException)
1206 OSL_TRACE("OResultSet::updateCharacterStream");
1207 MutexGuard aGuard(m_aMutex);
1208 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1209 checkColumnIndex(column);
1210 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateCharacterStream", *this);
1212 /* }}} */
1215 /* {{{ OResultSet::refreshRow() -U- */
1216 void SAL_CALL OResultSet::refreshRow()
1217 throw(SQLException, RuntimeException)
1219 OSL_TRACE("OResultSet::refreshRow");
1220 MutexGuard aGuard(m_aMutex);
1221 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1222 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::refreshRow", *this);
1224 /* }}} */
1227 /* {{{ OResultSet::updateObject() -U- */
1228 void SAL_CALL OResultSet::updateObject(sal_Int32 column, const Any& /* x */)
1229 throw(SQLException, RuntimeException)
1231 OSL_TRACE("OResultSet::updateObject");
1232 MutexGuard aGuard(m_aMutex);
1233 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1234 checkColumnIndex(column);
1235 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateObject", *this);
1237 /* }}} */
1240 /* {{{ OResultSet::updateNumericObject() -U- */
1241 void SAL_CALL OResultSet::updateNumericObject(sal_Int32 column, const Any& /* x */, sal_Int32 /* scale */)
1242 throw(SQLException, RuntimeException)
1244 OSL_TRACE("OResultSet::updateNumericObject");
1245 MutexGuard aGuard(m_aMutex);
1246 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1247 checkColumnIndex(column);
1248 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateNumericObject", *this);
1250 /* }}} */
1253 // XRowLocate
1254 /* {{{ OResultSet::getBookmark() -U- */
1255 Any SAL_CALL OResultSet::getBookmark()
1256 throw(SQLException, RuntimeException)
1258 OSL_TRACE("OResultSet::getBookmark");
1259 MutexGuard aGuard(m_aMutex);
1260 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1261 Any aRet = Any();
1263 // if you don't want to support bookmark you must remove the XRowLocate interface
1264 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getBookmark", *this);
1266 return aRet;
1268 /* }}} */
1271 /* {{{ OResultSet::moveToBookmark() -U- */
1272 sal_Bool SAL_CALL OResultSet::moveToBookmark(const Any& /* bookmark */)
1273 throw(SQLException, RuntimeException)
1275 OSL_TRACE("OResultSet::moveToBookmark");
1276 MutexGuard aGuard(m_aMutex);
1277 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1279 return sal_False;
1281 /* }}} */
1284 /* {{{ OResultSet::moveRelativeToBookmark() -U- */
1285 sal_Bool SAL_CALL OResultSet::moveRelativeToBookmark(const Any& /* bookmark */, sal_Int32 /* rows */)
1286 throw(SQLException, RuntimeException)
1288 OSL_TRACE("OResultSet::moveRelativeToBookmark");
1289 MutexGuard aGuard(m_aMutex);
1290 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1292 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::moveRelativeToBookmark", *this);
1293 return sal_False;
1295 /* }}} */
1298 /* {{{ OResultSet::compareBookmarks() -I- */
1299 sal_Int32 SAL_CALL OResultSet::compareBookmarks(const Any& /* n1 */, const Any& /* n2 */)
1300 throw(SQLException, RuntimeException)
1302 OSL_TRACE("OResultSet::compareBookmarks");
1303 MutexGuard aGuard(m_aMutex);
1304 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1306 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::compareBookmarks", *this);
1308 return CompareBookmark::NOT_EQUAL;
1310 /* }}} */
1313 /* {{{ OResultSet::hasOrderedBookmarks() -I- */
1314 sal_Bool SAL_CALL OResultSet::hasOrderedBookmarks()
1315 throw(SQLException, RuntimeException)
1317 OSL_TRACE("OResultSet::hasOrderedBookmarks");
1318 return sal_False;
1320 /* }}} */
1323 /* {{{ OResultSet::hashBookmark() -U- */
1324 sal_Int32 SAL_CALL OResultSet::hashBookmark(const Any& /* bookmark */)
1325 throw(SQLException, RuntimeException)
1327 OSL_TRACE("OResultSet::hashBookmark");
1328 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::hashBookmark", *this);
1329 return 0;
1331 /* }}} */
1334 // XDeleteRows
1335 /* {{{ OResultSet::deleteRows() -U- */
1336 Sequence< sal_Int32 > SAL_CALL OResultSet::deleteRows(const Sequence< Any >& /* rows */)
1337 throw(SQLException, RuntimeException)
1339 OSL_TRACE("OResultSet::deleteRows");
1340 MutexGuard aGuard(m_aMutex);
1341 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1342 Sequence< sal_Int32 > aRet = Sequence< sal_Int32 >();
1344 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::deleteRows", *this);
1345 return aRet;
1347 /* }}} */
1350 /* {{{ OResultSet::createArrayHelper() -I- */
1351 IPropertyArrayHelper * OResultSet::createArrayHelper() const
1353 OSL_TRACE("OResultSet::createArrayHelper");
1354 Sequence< Property > aProps(5);
1355 Property* pProperties = aProps.getArray();
1356 sal_Int32 nPos = 0;
1357 DECL_PROP0(FETCHDIRECTION, sal_Int32);
1358 DECL_PROP0(FETCHSIZE, sal_Int32);
1359 DECL_BOOL_PROP1IMPL(ISBOOKMARKABLE) PropertyAttribute::READONLY);
1360 DECL_PROP1IMPL(RESULTSETCONCURRENCY,sal_Int32) PropertyAttribute::READONLY);
1361 DECL_PROP1IMPL(RESULTSETTYPE, sal_Int32) PropertyAttribute::READONLY);
1363 return new OPropertyArrayHelper(aProps);
1365 /* }}} */
1368 /* {{{ OResultSet::getInfoHelper() -I- */
1369 IPropertyArrayHelper & OResultSet::getInfoHelper()
1371 OSL_TRACE("OResultSet::getInfoHelper");
1372 return (*const_cast<OResultSet*>(this)->getArrayHelper());
1374 /* }}} */
1377 /* {{{ OResultSet::convertFastPropertyValue() -I- */
1378 sal_Bool OResultSet::convertFastPropertyValue(Any & /* rConvertedValue */,
1379 Any & /* rOldValue */,
1380 sal_Int32 nHandle,
1381 const Any& /* rValue */)
1382 throw (::com::sun::star::lang::IllegalArgumentException)
1384 OSL_TRACE("OResultSet::convertFastPropertyValue");
1385 switch (nHandle) {
1386 case PROPERTY_ID_ISBOOKMARKABLE:
1387 case PROPERTY_ID_CURSORNAME:
1388 case PROPERTY_ID_RESULTSETCONCURRENCY:
1389 case PROPERTY_ID_RESULTSETTYPE:
1390 throw ::com::sun::star::lang::IllegalArgumentException();
1391 case PROPERTY_ID_FETCHDIRECTION:
1392 case PROPERTY_ID_FETCHSIZE:
1393 default:
1396 return sal_False;
1398 /* }}} */
1401 /* {{{ OResultSet::setFastPropertyValue_NoBroadcast() -I- */
1402 void OResultSet::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const Any& /* rValue */)
1403 throw (Exception)
1405 OSL_TRACE("OResultSet::setFastPropertyValue_NoBroadcast");
1406 switch (nHandle) {
1407 case PROPERTY_ID_ISBOOKMARKABLE:
1408 case PROPERTY_ID_CURSORNAME:
1409 case PROPERTY_ID_RESULTSETCONCURRENCY:
1410 case PROPERTY_ID_RESULTSETTYPE:
1411 throw Exception();
1412 case PROPERTY_ID_FETCHDIRECTION:
1413 break;
1414 case PROPERTY_ID_FETCHSIZE:
1415 break;
1416 default:
1420 /* }}} */
1423 /* {{{ OResultSet::getFastPropertyValue() -I- */
1424 void OResultSet::getFastPropertyValue(Any& _rValue, sal_Int32 nHandle) const
1426 OSL_TRACE("OResultSet::getFastPropertyValue");
1427 switch (nHandle) {
1428 case PROPERTY_ID_ISBOOKMARKABLE:
1429 _rValue <<= sal_False;
1430 break;
1431 case PROPERTY_ID_CURSORNAME:
1432 break;
1433 case PROPERTY_ID_RESULTSETCONCURRENCY:
1434 _rValue <<= ResultSetConcurrency::READ_ONLY;
1435 break;
1436 case PROPERTY_ID_RESULTSETTYPE:
1437 _rValue <<= ResultSetType::SCROLL_INSENSITIVE;
1438 break;
1439 case PROPERTY_ID_FETCHDIRECTION:
1440 _rValue <<= FetchDirection::FORWARD;
1441 break;
1442 case PROPERTY_ID_FETCHSIZE:
1443 _rValue <<= sal_Int32(50);
1444 break;
1446 default:
1450 /* }}} */
1453 /* {{{ OResultSet::acquire() -I- */
1454 void SAL_CALL OResultSet::acquire()
1455 throw()
1457 OSL_TRACE("OResultSet::acquire");
1458 OResultSet_BASE::acquire();
1460 /* }}} */
1463 /* {{{ OResultSet::release() -I- */
1464 void SAL_CALL OResultSet::release()
1465 throw()
1467 OSL_TRACE("OResultSet::release");
1468 OResultSet_BASE::release();
1470 /* }}} */
1473 /* {{{ OResultSet::getPropertySetInfo() -I- */
1474 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OResultSet::getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException)
1476 OSL_TRACE("OResultSet::getPropertySetInfo");
1477 return (::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper()));
1479 /* }}} */
1482 /* {{{ OResultSet::checkColumnIndex() -I- */
1483 void OResultSet::checkColumnIndex(sal_Int32 index)
1484 throw (SQLException, RuntimeException)
1486 OSL_TRACE("OResultSet::checkColumnIndex");
1487 if ((index < 1 || index > (int) fieldCount)) {
1488 /* static object for efficiency or thread safety is a problem ? */
1489 OUString buf( "index out of range" );
1490 throw SQLException(buf, *this, OUString(), 1, Any());
1493 /* }}} */
1497 * Local variables:
1498 * tab-width: 4
1499 * c-basic-offset: 4
1500 * End:
1501 * vim600: noet sw=4 ts=4 fdm=marker
1502 * vim<600: noet sw=4 ts=4
1505 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */