Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / mysqlc / source / mysqlc_resultset.cxx
blobe0659baf2d0da9e2fefc6393f964e4842c8728f6
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;
45 using ::rtl::OUString;
47 #include <cppconn/resultset.h>
48 #include <cppconn/resultset_metadata.h>
50 #include <stdio.h>
53 // IMPLEMENT_SERVICE_INFO(OResultSet,"com.sun.star.sdbcx.OResultSet","com.sun.star.sdbc.ResultSet");
54 /* {{{ OResultSet::getImplementationName() -I- */
55 OUString SAL_CALL OResultSet::getImplementationName()
56 throw (RuntimeException)
58 OSL_TRACE("OResultSet::getImplementationName");
59 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdbcx.mysqlc.ResultSet" ) );
61 /* }}} */
64 /* {{{ OResultSet::getSupportedServiceNames() -I- */
65 Sequence< OUString > SAL_CALL OResultSet::getSupportedServiceNames()
66 throw(RuntimeException)
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);
74 /* }}} */
77 /* {{{ OResultSet::supportsService() -I- */
78 sal_Bool SAL_CALL OResultSet::supportsService(const OUString& _rServiceName)
79 throw(RuntimeException)
81 OSL_TRACE("OResultSet::supportsService");
82 Sequence< OUString > aSupported(getSupportedServiceNames());
83 const OUString* pSupported = aSupported.getConstArray();
84 const OUString* pEnd = pSupported + aSupported.getLength();
85 for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) {}
87 return (pSupported != pEnd);
89 /* }}} */
92 /* {{{ OResultSet::OResultSet() -I- */
93 OResultSet::OResultSet(OCommonStatement * pStmt, sql::ResultSet * result, rtl_TextEncoding _encoding )
94 : OResultSet_BASE(m_aMutex)
95 ,OPropertySetHelper(OResultSet_BASE::rBHelper)
96 ,m_aStatement((OWeakObject*)pStmt)
97 ,m_xMetaData(NULL)
98 ,m_result(result)
99 ,fieldCount( 0 )
100 ,m_encoding( _encoding )
102 OSL_TRACE("OResultSet::OResultSet");
103 try {
104 sql::ResultSetMetaData * rs_meta = m_result->getMetaData();
105 fieldCount = rs_meta->getColumnCount();
106 } catch (const sql::SQLException &e) {
107 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
110 /* }}} */
113 /* {{{ OResultSet::~OResultSet() -I- */
114 OResultSet::~OResultSet()
116 OSL_TRACE("OResultSet::~OResultSet");
118 /* }}} */
121 /* {{{ OResultSet::disposing() -I- */
122 void OResultSet::disposing()
124 OSL_TRACE("OResultSet::disposing");
125 OPropertySetHelper::disposing();
127 MutexGuard aGuard(m_aMutex);
129 m_aStatement = NULL;
130 m_xMetaData = NULL;
132 /* }}} */
135 /* {{{ OResultSet::queryInterface() -I- */
136 Any SAL_CALL OResultSet::queryInterface(const Type & rType)
137 throw(RuntimeException)
139 OSL_TRACE("OResultSet::queryInterface");
140 Any aRet = OPropertySetHelper::queryInterface(rType);
141 if (!aRet.hasValue()) {
142 aRet = OResultSet_BASE::queryInterface(rType);
144 return aRet;
146 /* }}} */
149 /* {{{ OResultSet::getTypes() -I- */
150 Sequence< Type > SAL_CALL OResultSet::getTypes()
151 throw(RuntimeException)
153 OSL_TRACE("OResultSet::getTypes");
154 OTypeCollection aTypes( ::getCppuType((const Reference< XMultiPropertySet > *) NULL),
155 ::getCppuType((const Reference< XFastPropertySet > *) NULL),
156 ::getCppuType((const Reference< XPropertySet > *) NULL));
158 return concatSequences(aTypes.getTypes(), OResultSet_BASE::getTypes());
160 /* }}} */
163 /* {{{ OResultSet::findColumn() -I- */
164 sal_Int32 SAL_CALL OResultSet::findColumn(const OUString& columnName)
165 throw(SQLException, RuntimeException)
167 OSL_TRACE("OResultSet::findColumn");
168 MutexGuard aGuard(m_aMutex);
169 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
171 try {
172 // find the first column with the name columnName
173 sql::ResultSetMetaData * meta = m_result->getMetaData();
174 for (sal_uInt32 i = 1; i <= fieldCount; i++) {
175 if (columnName.equalsIgnoreAsciiCaseAscii(meta->getColumnName(i).c_str())) {
176 /* SDBC knows them indexed from 1 */
177 return i;
180 } catch (const sql::SQLException &e) {
181 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
183 return 0;
185 /* }}} */
188 /* {{{ OResultSet::getBinaryStream() -U- */
189 Reference< XInputStream > SAL_CALL OResultSet::getBinaryStream(sal_Int32 column)
190 throw(SQLException, RuntimeException)
192 OSL_TRACE("OResultSet::getBinaryStream");
193 MutexGuard aGuard(m_aMutex);
194 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
195 checkColumnIndex(column);
197 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getBinaryStream", *this);
198 return NULL;
200 /* }}} */
203 /* {{{ OResultSet::getCharacterStream() -U- */
204 Reference< XInputStream > SAL_CALL OResultSet::getCharacterStream(sal_Int32 column)
205 throw(SQLException, RuntimeException)
207 OSL_TRACE("OResultSet::getCharacterStream");
208 MutexGuard aGuard(m_aMutex);
209 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
210 checkColumnIndex(column);
212 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getCharacterStream", *this);
213 return NULL;
215 /* }}} */
218 /* {{{ OResultSet::getBoolean() -I- */
219 sal_Bool SAL_CALL OResultSet::getBoolean(sal_Int32 column)
220 throw(SQLException, RuntimeException)
222 OSL_TRACE("OResultSet::getBoolean");
223 MutexGuard aGuard(m_aMutex);
224 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
226 checkColumnIndex(column);
227 try {
228 return m_result->getBoolean(column)? sal_True:sal_False;
229 } catch (const sql::SQLException &e) {
230 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
232 return sal_False;
234 /* }}} */
237 /* {{{ OResultSet::getByte() -I- */
238 sal_Int8 SAL_CALL OResultSet::getByte(sal_Int32 column)
239 throw(SQLException, RuntimeException)
241 OSL_TRACE("OResultSet::getByte");
242 MutexGuard aGuard(m_aMutex);
243 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
245 checkColumnIndex(column);
246 try {
247 return m_result->getInt(column);
248 } catch (const sql::SQLException &e) {
249 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
251 return 0; // fool compiler
253 /* }}} */
256 /* {{{ OResultSet::getBytes() -I- */
257 Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes(sal_Int32 column)
258 throw(SQLException, RuntimeException)
260 OSL_TRACE("OResultSet::getBytes");
262 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
263 MutexGuard aGuard(m_aMutex);
266 sql::SQLString val = m_result->getString(column);
267 if (!val.length()) {
268 return Sequence< sal_Int8>();
269 } else {
270 return Sequence< sal_Int8 > ((sal_Int8*)val.c_str(), val.length());
273 /* }}} */
276 /* {{{ OResultSet::getDate() -I- */
277 Date SAL_CALL OResultSet::getDate(sal_Int32 column)
278 throw(SQLException, RuntimeException)
280 OSL_TRACE("OResultSet::getDate");
281 MutexGuard aGuard(m_aMutex);
282 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
283 checkColumnIndex(column);
285 Date d;
286 try {
287 OUString dateString = getString(column);
288 OUString token;
289 sal_Int32 nIndex = 0, i=0;
291 do {
292 token = dateString.getToken (0, '-', nIndex);
293 switch (i) {
294 case 0:
295 d.Year = static_cast<sal_uInt16>(token.toInt32(10));
296 break;
297 case 1:
298 d.Month = static_cast<sal_uInt16>(token.toInt32(10));
299 break;
300 case 2:
301 d.Day = static_cast<sal_uInt16>(token.toInt32(10));
302 break;
303 default:;
305 i++;
306 } while (nIndex >= 0);
307 } catch (const sql::SQLException &e) {
308 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
310 return d;
312 /* }}} */
315 /* {{{ OResultSet::getDouble() -I- */
316 double SAL_CALL OResultSet::getDouble(sal_Int32 column)
317 throw(SQLException, RuntimeException)
319 OSL_TRACE("OResultSet::getDouble");
320 MutexGuard aGuard(m_aMutex);
321 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
323 checkColumnIndex(column);
324 try {
325 return m_result->getDouble(column);
326 } catch (const sql::SQLException &e) {
327 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
329 return 0.0; // fool compiler
331 /* }}} */
334 /* {{{ OResultSet::getFloat() -I- */
335 float SAL_CALL OResultSet::getFloat(sal_Int32 column)
336 throw(SQLException, RuntimeException)
338 OSL_TRACE("OResultSet::getFloat");
339 MutexGuard aGuard(m_aMutex);
340 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
342 checkColumnIndex(column);
343 try {
344 return m_result->getDouble(column);
345 } catch (const sql::SQLException &e) {
346 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
348 return 0.0; // fool compiler
350 /* }}} */
353 /* {{{ OResultSet::getInt() -I- */
354 sal_Int32 SAL_CALL OResultSet::getInt(sal_Int32 column)
355 throw(SQLException, RuntimeException)
357 OSL_TRACE("OResultSet::getInt");
358 MutexGuard aGuard(m_aMutex);
359 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
361 checkColumnIndex(column);
362 try {
363 return m_result->getInt(column);
364 } catch (const sql::SQLException &e) {
365 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
367 return 0; // fool compiler
369 /* }}} */
372 /* {{{ OResultSet::getRow() -I- */
373 sal_Int32 SAL_CALL OResultSet::getRow()
374 throw(SQLException, RuntimeException)
376 OSL_TRACE("OResultSet::getRow");
377 MutexGuard aGuard(m_aMutex);
378 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
380 try {
381 return m_result->getRow();
382 } catch (const sql::SQLException &e) {
383 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
385 return 0; // fool compiler
387 /* }}} */
390 /* {{{ OResultSet::getLong() -I- */
391 sal_Int64 SAL_CALL OResultSet::getLong(sal_Int32 column)
392 throw(SQLException, RuntimeException)
394 OSL_TRACE("OResultSet::getLong");
395 MutexGuard aGuard(m_aMutex);
396 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
398 checkColumnIndex(column);
399 try {
400 return m_result->getInt64(column);
401 } catch (const sql::SQLException &e) {
402 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
404 return 0; // fool compiler
406 /* }}} */
409 /* {{{ OResultSet::getMetaData() -I- */
410 Reference< XResultSetMetaData > SAL_CALL OResultSet::getMetaData()
411 throw(SQLException, RuntimeException)
413 OSL_TRACE("OResultSet::getMetaData");
414 MutexGuard aGuard(m_aMutex);
415 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
416 try {
417 if (!m_xMetaData.is()) {
418 m_xMetaData = new OResultSetMetaData(m_result->getMetaData(), m_encoding);
420 } catch (const sql::MethodNotImplementedException &) {
421 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getMetaData", *this);
422 } catch (const sql::SQLException &e) {
423 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
425 return m_xMetaData;
427 /* }}} */
430 /* {{{ OResultSet::getArray() -U- */
431 Reference< XArray > SAL_CALL OResultSet::getArray(sal_Int32 column)
432 throw(SQLException, RuntimeException)
434 OSL_TRACE("OResultSet::getArray");
435 MutexGuard aGuard(m_aMutex);
436 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
437 checkColumnIndex(column);
439 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getArray", *this);
440 return NULL;
442 /* }}} */
445 /* {{{ OResultSet::getClob() -U- */
446 Reference< XClob > SAL_CALL OResultSet::getClob(sal_Int32 column)
447 throw(SQLException, RuntimeException)
449 OSL_TRACE("OResultSet::getClob");
450 MutexGuard aGuard(m_aMutex);
451 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
452 checkColumnIndex(column);
454 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getClob", *this);
455 return NULL;
457 /* }}} */
460 /* {{{ OResultSet::getBlob() -U- */
461 Reference< XBlob > SAL_CALL OResultSet::getBlob(sal_Int32 column)
462 throw(SQLException, RuntimeException)
464 OSL_TRACE("OResultSet::getBlob");
465 MutexGuard aGuard(m_aMutex);
466 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
467 checkColumnIndex(column);
469 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getBlob", *this);
470 return NULL;
472 /* }}} */
475 /* {{{ OResultSet::getRef() -U- */
476 Reference< XRef > SAL_CALL OResultSet::getRef(sal_Int32 column)
477 throw(SQLException, RuntimeException)
479 OSL_TRACE("OResultSet::getRef");
480 MutexGuard aGuard(m_aMutex);
481 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
482 checkColumnIndex(column);
484 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getRef", *this);
485 return NULL;
487 /* }}} */
490 /* {{{ OResultSet::getObject() -U- */
491 Any SAL_CALL OResultSet::getObject(sal_Int32 column, const Reference< XNameAccess >& /* typeMap */)
492 throw(SQLException, RuntimeException)
494 OSL_TRACE("OResultSet::getObject");
495 MutexGuard aGuard(m_aMutex);
496 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
497 checkColumnIndex(column);
499 Any aRet= Any();
501 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getObject", *this);
502 return aRet;
504 /* }}} */
507 /* {{{ OResultSet::getShort() -I- */
508 sal_Int16 SAL_CALL OResultSet::getShort(sal_Int32 column)
509 throw(SQLException, RuntimeException)
511 OSL_TRACE("OResultSet::getShort");
512 MutexGuard aGuard(m_aMutex);
513 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
515 try {
516 return (sal_Int16) m_result->getInt(column);
517 } catch (const sql::SQLException &e) {
518 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
520 return 0; // fool compiler
522 /* }}} */
525 /* {{{ OResultSet::getString() -I- */
526 OUString SAL_CALL OResultSet::getString(sal_Int32 column)
527 throw(SQLException, RuntimeException)
529 OSL_TRACE("OResultSet::getString");
530 MutexGuard aGuard(m_aMutex);
531 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
533 checkColumnIndex(column);
535 try {
536 sql::SQLString val = m_result->getString(column);
537 if (!m_result->wasNull()) {
538 return OUString( val.c_str(), val.length(), m_encoding );
539 } else {
540 return OUString();
542 } catch (const sql::SQLException &e) {
543 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
545 return OUString(); // fool compiler
547 /* }}} */
550 /* {{{ OResultSet::getTime() -I- */
551 Time SAL_CALL OResultSet::getTime(sal_Int32 column)
552 throw(SQLException, RuntimeException)
554 OSL_TRACE("OResultSet::getTime");
555 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
556 MutexGuard aGuard(m_aMutex);
558 checkColumnIndex(column);
559 Time t;
560 OUString timeString = getString(column);
561 OUString token;
562 sal_Int32 nIndex, i=0;
564 nIndex = timeString.indexOf(' ') + 1;
566 do {
567 token = timeString.getToken (0, ':', nIndex);
568 switch (i) {
569 case 0:
570 t.Hours = static_cast<sal_uInt16>(token.toInt32(10));
571 break;
572 case 1:
573 t.Minutes = static_cast<sal_uInt16>(token.toInt32(10));
574 break;
575 case 2:
576 t.Seconds = static_cast<sal_uInt16>(token.toInt32(10));
577 break;
579 i++;
580 } while (nIndex >= 0);
582 return t;
584 /* }}} */
587 /* {{{ OResultSet::getTimestamp() -I- */
588 DateTime SAL_CALL OResultSet::getTimestamp(sal_Int32 column)
589 throw(SQLException, RuntimeException)
591 OSL_TRACE("OResultSet::getTimestamp");
592 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
593 MutexGuard aGuard(m_aMutex);
595 checkColumnIndex(column);
596 DateTime dt;
597 Date d = getDate(column);
598 Time t = getTime(column);
600 dt.Year = d.Year;
601 dt.Month = d.Month;
602 dt.Day = d.Day;
603 dt.Hours = t.Hours;
604 dt.Minutes = t.Minutes;
605 dt.Seconds = t.Seconds;
606 return dt;
608 /* }}} */
611 /* {{{ OResultSet::isBeforeFirst() -I- */
612 sal_Bool SAL_CALL OResultSet::isBeforeFirst()
613 throw(SQLException, RuntimeException)
615 OSL_TRACE("OResultSet::isBeforeFirst");
616 MutexGuard aGuard(m_aMutex);
617 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
619 try {
620 return m_result->isBeforeFirst()? sal_True:sal_False;
621 } catch (const sql::SQLException &e) {
622 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
624 return sal_False; //fool
626 /* }}} */
629 /* {{{ OResultSet::isAfterLast() -I- */
630 sal_Bool SAL_CALL OResultSet::isAfterLast()
631 throw(SQLException, RuntimeException)
633 OSL_TRACE("OResultSet::isAfterLast");
634 MutexGuard aGuard(m_aMutex);
635 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
637 try {
638 return m_result->isAfterLast()? sal_True:sal_False;
639 } catch (const sql::SQLException &e) {
640 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
642 return sal_False; //fool
644 /* }}} */
647 /* {{{ OResultSet::isFirst() -I- */
648 sal_Bool SAL_CALL OResultSet::isFirst()
649 throw(SQLException, RuntimeException)
651 OSL_TRACE("OResultSet::isFirst");
652 MutexGuard aGuard(m_aMutex);
653 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
655 try {
656 return m_result->isFirst();
657 } catch (const sql::SQLException &e) {
658 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
660 return sal_False; //fool
662 /* }}} */
665 /* {{{ OResultSet::isLast() -I- */
666 sal_Bool SAL_CALL OResultSet::isLast()
667 throw(SQLException, RuntimeException)
669 OSL_TRACE("OResultSet::isLast");
670 MutexGuard aGuard(m_aMutex);
671 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
673 try {
674 return m_result->isLast()? sal_True:sal_False;
675 } catch (const sql::SQLException &e) {
676 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
678 return sal_False; //fool
680 /* }}} */
683 /* {{{ OResultSet::beforeFirst() -I- */
684 void SAL_CALL OResultSet::beforeFirst()
685 throw(SQLException, RuntimeException)
687 OSL_TRACE("OResultSet::beforeFirst");
688 MutexGuard aGuard(m_aMutex);
689 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
691 try {
692 m_result->beforeFirst();
693 } catch (const sql::SQLException &e) {
694 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
697 /* }}} */
700 /* {{{ OResultSet::afterLast() -I- */
701 void SAL_CALL OResultSet::afterLast()
702 throw(SQLException, RuntimeException)
704 OSL_TRACE("OResultSet::afterLast");
705 MutexGuard aGuard(m_aMutex);
706 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
708 try {
709 m_result->afterLast();
710 } catch (const sql::SQLException &e) {
711 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
714 /* }}} */
717 /* {{{ OResultSet::close() -I- */
718 void SAL_CALL OResultSet::close() throw(SQLException, RuntimeException)
720 OSL_TRACE("OResultSet::close");
721 MutexGuard aGuard(m_aMutex);
722 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
724 try {
725 m_result->close();
726 } catch (const sql::SQLException &e) {
727 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
730 dispose();
732 /* }}} */
735 /* {{{ OResultSet::first() -I- */
736 sal_Bool SAL_CALL OResultSet::first() throw(SQLException, RuntimeException)
738 OSL_TRACE("OResultSet::first");
739 MutexGuard aGuard(m_aMutex);
740 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
742 try {
743 return m_result->first()? sal_True:sal_False;
744 } catch (const sql::SQLException &e) {
745 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
747 return sal_False; //fool
749 /* }}} */
752 /* {{{ OResultSet::last() -I- */
753 sal_Bool SAL_CALL OResultSet::last()
754 throw(SQLException, RuntimeException)
756 OSL_TRACE("OResultSet::last");
757 MutexGuard aGuard(m_aMutex);
758 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
760 try {
761 return m_result->last()? sal_True:sal_False;
762 } catch (const sql::SQLException &e) {
763 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
765 return sal_False; //fool
767 /* }}} */
770 /* {{{ OResultSet::absolute() -I- */
771 sal_Bool SAL_CALL OResultSet::absolute(sal_Int32 row)
772 throw(SQLException, RuntimeException)
774 OSL_TRACE("OResultSet::absolute");
775 MutexGuard aGuard(m_aMutex);
776 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
778 try {
779 return m_result->absolute(row)? sal_True:sal_False;
780 } catch (const sql::SQLException &e) {
781 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
783 return sal_False; //fool
785 /* }}} */
788 /* {{{ OResultSet::relative() -I- */
789 sal_Bool SAL_CALL OResultSet::relative(sal_Int32 row)
790 throw(SQLException, RuntimeException)
792 OSL_TRACE("OResultSet::relative");
793 MutexGuard aGuard(m_aMutex);
794 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
796 try {
797 return m_result->relative(row)? sal_True:sal_False;
798 } catch (const sql::SQLException &e) {
799 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
801 return sal_False; //fool
803 /* }}} */
806 /* {{{ OResultSet::previous() -I- */
807 sal_Bool SAL_CALL OResultSet::previous()
808 throw(SQLException, RuntimeException)
810 OSL_TRACE("OResultSet::previous");
811 MutexGuard aGuard(m_aMutex);
812 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
814 try {
815 return m_result->previous()? sal_True:sal_False;
816 } catch (const sql::SQLException &e) {
817 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
819 return sal_False; //fool
821 /* }}} */
824 /* {{{ OResultSet::getStatement() -I- */
825 Reference< XInterface > SAL_CALL OResultSet::getStatement()
826 throw(SQLException, RuntimeException)
828 OSL_TRACE("OResultSet::getStatement");
829 MutexGuard aGuard(m_aMutex);
830 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
832 return m_aStatement.get();
834 /* }}} */
837 /* {{{ OResultSet::rowDeleted() -I- */
838 sal_Bool SAL_CALL OResultSet::rowDeleted()
839 throw(SQLException, RuntimeException)
841 OSL_TRACE("OResultSet::rowDeleted");
842 MutexGuard aGuard(m_aMutex);
843 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
845 return sal_False;
847 /* }}} */
850 /* {{{ OResultSet::rowInserted() -I- */
851 sal_Bool SAL_CALL OResultSet::rowInserted()
852 throw(SQLException, RuntimeException)
854 OSL_TRACE("OResultSet::rowInserted");
855 MutexGuard aGuard(m_aMutex);
856 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
858 return sal_False;
860 /* }}} */
863 /* {{{ OResultSet::rowUpdated() -I- */
864 sal_Bool SAL_CALL OResultSet::rowUpdated()
865 throw(SQLException, RuntimeException)
867 OSL_TRACE("OResultSet::rowUpdated");
868 MutexGuard aGuard(m_aMutex);
869 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
871 return sal_False;
873 /* }}} */
876 /* {{{ OResultSet::next() -I- */
877 sal_Bool SAL_CALL OResultSet::next()
878 throw(SQLException, RuntimeException)
880 OSL_TRACE("OResultSet::next");
881 MutexGuard aGuard(m_aMutex);
882 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
884 try {
885 return m_result->next()? sal_True:sal_False;
886 } catch (const sql::SQLException &e) {
887 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
889 return sal_False; //fool
891 /* }}} */
894 /* {{{ OResultSet::wasNull() -I- */
895 sal_Bool SAL_CALL OResultSet::wasNull()
896 throw(SQLException, RuntimeException)
898 OSL_TRACE("OResultSet::wasNull");
899 MutexGuard aGuard(m_aMutex);
900 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
902 try {
903 return m_result->wasNull()? sal_True:sal_False;
904 } catch (const sql::SQLException &e) {
905 mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
907 return sal_False; //fool
909 /* }}} */
912 /* {{{ OResultSet::cancel() -I- */
913 void SAL_CALL OResultSet::cancel()
914 throw(RuntimeException)
916 OSL_TRACE("OResultSet::cancel");
917 MutexGuard aGuard(m_aMutex);
918 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
920 /* }}} */
923 /* {{{ OResultSet::clearWarnings() -I- */
924 void SAL_CALL OResultSet::clearWarnings()
925 throw(SQLException, RuntimeException)
927 OSL_TRACE("OResultSet::clearWarnings");
929 /* }}} */
932 /* {{{ OResultSet::getWarnings() -I- */
933 Any SAL_CALL OResultSet::getWarnings()
934 throw(SQLException, RuntimeException)
936 OSL_TRACE("OResultSet::getWarnings");
937 Any aRet= Any();
938 return aRet;
940 /* }}} */
943 /* {{{ OResultSet::insertRow() -I- */
944 void SAL_CALL OResultSet::insertRow()
945 throw(SQLException, RuntimeException)
947 OSL_TRACE("OResultSet::insertRow");
948 MutexGuard aGuard(m_aMutex);
949 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
950 // you only have to implement this if you want to insert new rows
951 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::insertRow", *this);
953 /* }}} */
956 /* {{{ OResultSet::updateRow() -I- */
957 void SAL_CALL OResultSet::updateRow()
958 throw(SQLException, RuntimeException)
960 OSL_TRACE("OResultSet::updateRow");
961 MutexGuard aGuard(m_aMutex);
962 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
964 // only when you allow updates
965 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateRow", *this);
967 /* }}} */
970 /* {{{ OResultSet::deleteRow() -I- */
971 void SAL_CALL OResultSet::deleteRow()
972 throw(SQLException, RuntimeException)
974 OSL_TRACE("OResultSet::deleteRow");
975 MutexGuard aGuard(m_aMutex);
976 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
977 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::deleteRow", *this);
979 /* }}} */
982 /* {{{ OResultSet::cancelRowUpdates() -I- */
983 void SAL_CALL OResultSet::cancelRowUpdates()
984 throw(SQLException, RuntimeException)
986 OSL_TRACE("OResultSet::cancelRowUpdates");
987 MutexGuard aGuard(m_aMutex);
988 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
989 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::cancelRowUpdates", *this);
991 /* }}} */
994 /* {{{ OResultSet::moveToInsertRow() -I- */
995 void SAL_CALL OResultSet::moveToInsertRow()
996 throw(SQLException, RuntimeException)
998 OSL_TRACE("OResultSet::moveToInsertRow");
999 MutexGuard aGuard(m_aMutex);
1000 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1002 // only when you allow insert's
1003 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::moveToInsertRow", *this);
1005 /* }}} */
1008 /* {{{ OResultSet::moveToCurrentRow() -I- */
1009 void SAL_CALL OResultSet::moveToCurrentRow()
1010 throw(SQLException, RuntimeException)
1012 OSL_TRACE("OResultSet::moveToCurrentRow");
1013 MutexGuard aGuard(m_aMutex);
1014 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1016 /* }}} */
1019 /* {{{ OResultSet::updateNull() -U- */
1020 void SAL_CALL OResultSet::updateNull(sal_Int32 column)
1021 throw(SQLException, RuntimeException)
1023 OSL_TRACE("OResultSet::updateNull");
1024 MutexGuard aGuard(m_aMutex);
1025 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1026 checkColumnIndex(column);
1027 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateNull", *this);
1029 /* }}} */
1032 /* {{{ OResultSet::updateBoolean() -U- */
1033 void SAL_CALL OResultSet::updateBoolean(sal_Int32 column, sal_Bool /* x */)
1034 throw(SQLException, RuntimeException)
1036 OSL_TRACE("OResultSet::updateBoolean");
1037 MutexGuard aGuard(m_aMutex);
1038 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1039 checkColumnIndex(column);
1040 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateBoolean", *this);
1042 /* }}} */
1045 /* {{{ OResultSet::updateByte() -U- */
1046 void SAL_CALL OResultSet::updateByte(sal_Int32 column, sal_Int8 /* x */)
1047 throw(SQLException, RuntimeException)
1049 OSL_TRACE("OResultSet::updateByte");
1050 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1051 MutexGuard aGuard(m_aMutex);
1052 checkColumnIndex(column);
1053 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateByte", *this);
1055 /* }}} */
1058 /* {{{ OResultSet::updateShort() -U- */
1059 void SAL_CALL OResultSet::updateShort(sal_Int32 column, sal_Int16 /* x */)
1060 throw(SQLException, RuntimeException)
1062 OSL_TRACE("OResultSet::updateShort");
1063 MutexGuard aGuard(m_aMutex);
1064 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1065 checkColumnIndex(column);
1066 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateShort", *this);
1068 /* }}} */
1071 /* {{{ OResultSet::updateInt() -U- */
1072 void SAL_CALL OResultSet::updateInt(sal_Int32 column, sal_Int32 /* x */)
1073 throw(SQLException, RuntimeException)
1075 OSL_TRACE("OResultSet::updateInt");
1076 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1077 MutexGuard aGuard(m_aMutex);
1078 checkColumnIndex(column);
1079 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateInt", *this);
1081 /* }}} */
1084 /* {{{ OResultSet::updateLong() -U- */
1085 void SAL_CALL OResultSet::updateLong(sal_Int32 column, sal_Int64 /* x */)
1086 throw(SQLException, RuntimeException)
1088 OSL_TRACE("OResultSet::updateLong");
1089 MutexGuard aGuard(m_aMutex);
1090 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1091 checkColumnIndex(column);
1092 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateLong", *this);
1094 /* }}} */
1097 /* {{{ OResultSet::updateFloat() -U- */
1098 void SAL_CALL OResultSet::updateFloat(sal_Int32 column, float /* x */)
1099 throw(SQLException, RuntimeException)
1101 OSL_TRACE("OResultSet::updateFloat");
1102 MutexGuard aGuard(m_aMutex);
1103 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1104 checkColumnIndex(column);
1105 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateFloat", *this);
1107 /* }}} */
1110 /* {{{ OResultSet::updateDouble() -U- */
1111 void SAL_CALL OResultSet::updateDouble(sal_Int32 column, double /* x */)
1112 throw(SQLException, RuntimeException)
1114 OSL_TRACE("OResultSet::updateDouble");
1115 MutexGuard aGuard(m_aMutex);
1116 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1117 checkColumnIndex(column);
1118 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateDouble", *this);
1120 /* }}} */
1123 /* {{{ OResultSet::updateString() -U- */
1124 void SAL_CALL OResultSet::updateString(sal_Int32 column, const OUString& /* x */)
1125 throw(SQLException, RuntimeException)
1127 OSL_TRACE("OResultSet::updateString");
1128 MutexGuard aGuard(m_aMutex);
1129 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1130 checkColumnIndex(column);
1131 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateString", *this);
1133 /* }}} */
1136 /* {{{ OResultSet::updateBytes() -U- */
1137 void SAL_CALL OResultSet::updateBytes(sal_Int32 column, const Sequence< sal_Int8 >& /* x */)
1138 throw(SQLException, RuntimeException)
1140 OSL_TRACE("OResultSet::updateBytes");
1141 MutexGuard aGuard(m_aMutex);
1142 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1143 checkColumnIndex(column);
1144 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateBytes", *this);
1146 /* }}} */
1149 /* {{{ OResultSet::updateDate() -U- */
1150 void SAL_CALL OResultSet::updateDate(sal_Int32 column, const Date& /* x */)
1151 throw(SQLException, RuntimeException)
1153 OSL_TRACE("OResultSet::updateDate");
1154 MutexGuard aGuard(m_aMutex);
1155 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1156 checkColumnIndex(column);
1157 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateDate", *this);
1159 /* }}} */
1162 /* {{{ OResultSet::updateTime() -U- */
1163 void SAL_CALL OResultSet::updateTime(sal_Int32 column, const Time& /* x */)
1164 throw(SQLException, RuntimeException)
1166 OSL_TRACE("OResultSet::updateTime");
1167 MutexGuard aGuard(m_aMutex);
1168 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1169 checkColumnIndex(column);
1170 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateTime", *this);
1172 /* }}} */
1175 /* {{{ OResultSet::updateTimestamp() -U- */
1176 void SAL_CALL OResultSet::updateTimestamp(sal_Int32 column, const DateTime& /* x */)
1177 throw(SQLException, RuntimeException)
1179 OSL_TRACE("OResultSet::updateTimestamp");
1180 MutexGuard aGuard(m_aMutex);
1181 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1182 checkColumnIndex(column);
1183 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateTimestamp", *this);
1185 /* }}} */
1188 /* {{{ OResultSet::updateBinaryStream() -U- */
1189 void SAL_CALL OResultSet::updateBinaryStream(sal_Int32 column, const Reference< XInputStream >& /* x */,
1190 sal_Int32 /* length */)
1191 throw(SQLException, RuntimeException)
1193 OSL_TRACE("OResultSet::updateBinaryStream");
1194 MutexGuard aGuard(m_aMutex);
1195 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1196 checkColumnIndex(column);
1197 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateBinaryStream", *this);
1199 /* }}} */
1202 /* {{{ OResultSet::updateCharacterStream() -U- */
1203 void SAL_CALL OResultSet::updateCharacterStream(sal_Int32 column, const Reference< XInputStream >& /* x */,
1204 sal_Int32 /* length */)
1205 throw(SQLException, RuntimeException)
1207 OSL_TRACE("OResultSet::updateCharacterStream");
1208 MutexGuard aGuard(m_aMutex);
1209 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1210 checkColumnIndex(column);
1211 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateCharacterStream", *this);
1213 /* }}} */
1216 /* {{{ OResultSet::refreshRow() -U- */
1217 void SAL_CALL OResultSet::refreshRow()
1218 throw(SQLException, RuntimeException)
1220 OSL_TRACE("OResultSet::refreshRow");
1221 MutexGuard aGuard(m_aMutex);
1222 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1223 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::refreshRow", *this);
1225 /* }}} */
1228 /* {{{ OResultSet::updateObject() -U- */
1229 void SAL_CALL OResultSet::updateObject(sal_Int32 column, const Any& /* x */)
1230 throw(SQLException, RuntimeException)
1232 OSL_TRACE("OResultSet::updateObject");
1233 MutexGuard aGuard(m_aMutex);
1234 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1235 checkColumnIndex(column);
1236 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateObject", *this);
1238 /* }}} */
1241 /* {{{ OResultSet::updateNumericObject() -U- */
1242 void SAL_CALL OResultSet::updateNumericObject(sal_Int32 column, const Any& /* x */, sal_Int32 /* scale */)
1243 throw(SQLException, RuntimeException)
1245 OSL_TRACE("OResultSet::updateNumericObject");
1246 MutexGuard aGuard(m_aMutex);
1247 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1248 checkColumnIndex(column);
1249 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::updateNumericObject", *this);
1251 /* }}} */
1254 // XRowLocate
1255 /* {{{ OResultSet::getBookmark() -U- */
1256 Any SAL_CALL OResultSet::getBookmark()
1257 throw(SQLException, RuntimeException)
1259 OSL_TRACE("OResultSet::getBookmark");
1260 MutexGuard aGuard(m_aMutex);
1261 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1262 Any aRet = Any();
1264 // if you don't want to support bookmark you must remove the XRowLocate interface
1265 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::getBookmark", *this);
1267 return aRet;
1269 /* }}} */
1272 /* {{{ OResultSet::moveToBookmark() -U- */
1273 sal_Bool SAL_CALL OResultSet::moveToBookmark(const Any& /* bookmark */)
1274 throw(SQLException, RuntimeException)
1276 OSL_TRACE("OResultSet::moveToBookmark");
1277 MutexGuard aGuard(m_aMutex);
1278 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1280 return sal_False;
1282 /* }}} */
1285 /* {{{ OResultSet::moveRelativeToBookmark() -U- */
1286 sal_Bool SAL_CALL OResultSet::moveRelativeToBookmark(const Any& /* bookmark */, sal_Int32 /* rows */)
1287 throw(SQLException, RuntimeException)
1289 OSL_TRACE("OResultSet::moveRelativeToBookmark");
1290 MutexGuard aGuard(m_aMutex);
1291 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1293 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::moveRelativeToBookmark", *this);
1294 return sal_False;
1296 /* }}} */
1299 /* {{{ OResultSet::compareBookmarks() -I- */
1300 sal_Int32 SAL_CALL OResultSet::compareBookmarks(const Any& /* n1 */, const Any& /* n2 */)
1301 throw(SQLException, RuntimeException)
1303 OSL_TRACE("OResultSet::compareBookmarks");
1304 MutexGuard aGuard(m_aMutex);
1305 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1307 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::compareBookmarks", *this);
1309 return CompareBookmark::NOT_EQUAL;
1311 /* }}} */
1314 /* {{{ OResultSet::hasOrderedBookmarks() -I- */
1315 sal_Bool SAL_CALL OResultSet::hasOrderedBookmarks()
1316 throw(SQLException, RuntimeException)
1318 OSL_TRACE("OResultSet::hasOrderedBookmarks");
1319 return sal_False;
1321 /* }}} */
1324 /* {{{ OResultSet::hashBookmark() -U- */
1325 sal_Int32 SAL_CALL OResultSet::hashBookmark(const Any& /* bookmark */)
1326 throw(SQLException, RuntimeException)
1328 OSL_TRACE("OResultSet::hashBookmark");
1329 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::hashBookmark", *this);
1330 return 0;
1332 /* }}} */
1335 // XDeleteRows
1336 /* {{{ OResultSet::deleteRows() -U- */
1337 Sequence< sal_Int32 > SAL_CALL OResultSet::deleteRows(const Sequence< Any >& /* rows */)
1338 throw(SQLException, RuntimeException)
1340 OSL_TRACE("OResultSet::deleteRows");
1341 MutexGuard aGuard(m_aMutex);
1342 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
1343 Sequence< sal_Int32 > aRet = Sequence< sal_Int32 >();
1345 mysqlc_sdbc_driver::throwFeatureNotImplementedException("OResultSet::deleteRows", *this);
1346 return aRet;
1348 /* }}} */
1351 /* {{{ OResultSet::createArrayHelper() -I- */
1352 IPropertyArrayHelper * OResultSet::createArrayHelper() const
1354 OSL_TRACE("OResultSet::createArrayHelper");
1355 Sequence< Property > aProps(5);
1356 Property* pProperties = aProps.getArray();
1357 sal_Int32 nPos = 0;
1358 DECL_PROP0(FETCHDIRECTION, sal_Int32);
1359 DECL_PROP0(FETCHSIZE, sal_Int32);
1360 DECL_BOOL_PROP1IMPL(ISBOOKMARKABLE) PropertyAttribute::READONLY);
1361 DECL_PROP1IMPL(RESULTSETCONCURRENCY,sal_Int32) PropertyAttribute::READONLY);
1362 DECL_PROP1IMPL(RESULTSETTYPE, sal_Int32) PropertyAttribute::READONLY);
1364 return new OPropertyArrayHelper(aProps);
1366 /* }}} */
1369 /* {{{ OResultSet::getInfoHelper() -I- */
1370 IPropertyArrayHelper & OResultSet::getInfoHelper()
1372 OSL_TRACE("OResultSet::getInfoHelper");
1373 return (*const_cast<OResultSet*>(this)->getArrayHelper());
1375 /* }}} */
1378 /* {{{ OResultSet::convertFastPropertyValue() -I- */
1379 sal_Bool OResultSet::convertFastPropertyValue(Any & /* rConvertedValue */,
1380 Any & /* rOldValue */,
1381 sal_Int32 nHandle,
1382 const Any& /* rValue */)
1383 throw (::com::sun::star::lang::IllegalArgumentException)
1385 OSL_TRACE("OResultSet::convertFastPropertyValue");
1386 switch (nHandle) {
1387 case PROPERTY_ID_ISBOOKMARKABLE:
1388 case PROPERTY_ID_CURSORNAME:
1389 case PROPERTY_ID_RESULTSETCONCURRENCY:
1390 case PROPERTY_ID_RESULTSETTYPE:
1391 throw ::com::sun::star::lang::IllegalArgumentException();
1392 case PROPERTY_ID_FETCHDIRECTION:
1393 case PROPERTY_ID_FETCHSIZE:
1394 default:
1397 return sal_False;
1399 /* }}} */
1402 /* {{{ OResultSet::setFastPropertyValue_NoBroadcast() -I- */
1403 void OResultSet::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const Any& /* rValue */)
1404 throw (Exception)
1406 OSL_TRACE("OResultSet::setFastPropertyValue_NoBroadcast");
1407 switch (nHandle) {
1408 case PROPERTY_ID_ISBOOKMARKABLE:
1409 case PROPERTY_ID_CURSORNAME:
1410 case PROPERTY_ID_RESULTSETCONCURRENCY:
1411 case PROPERTY_ID_RESULTSETTYPE:
1412 throw Exception();
1413 case PROPERTY_ID_FETCHDIRECTION:
1414 break;
1415 case PROPERTY_ID_FETCHSIZE:
1416 break;
1417 default:
1421 /* }}} */
1424 /* {{{ OResultSet::getFastPropertyValue() -I- */
1425 void OResultSet::getFastPropertyValue(Any& _rValue, sal_Int32 nHandle) const
1427 OSL_TRACE("OResultSet::getFastPropertyValue");
1428 switch (nHandle) {
1429 case PROPERTY_ID_ISBOOKMARKABLE:
1430 _rValue <<= sal_False;
1431 break;
1432 case PROPERTY_ID_CURSORNAME:
1433 break;
1434 case PROPERTY_ID_RESULTSETCONCURRENCY:
1435 _rValue <<= ResultSetConcurrency::READ_ONLY;
1436 break;
1437 case PROPERTY_ID_RESULTSETTYPE:
1438 _rValue <<= ResultSetType::SCROLL_INSENSITIVE;
1439 break;
1440 case PROPERTY_ID_FETCHDIRECTION:
1441 _rValue <<= FetchDirection::FORWARD;
1442 break;
1443 case PROPERTY_ID_FETCHSIZE:
1444 _rValue <<= sal_Int32(50);
1445 break;
1447 default:
1451 /* }}} */
1454 /* {{{ OResultSet::acquire() -I- */
1455 void SAL_CALL OResultSet::acquire()
1456 throw()
1458 OSL_TRACE("OResultSet::acquire");
1459 OResultSet_BASE::acquire();
1461 /* }}} */
1464 /* {{{ OResultSet::release() -I- */
1465 void SAL_CALL OResultSet::release()
1466 throw()
1468 OSL_TRACE("OResultSet::release");
1469 OResultSet_BASE::release();
1471 /* }}} */
1474 /* {{{ OResultSet::getPropertySetInfo() -I- */
1475 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OResultSet::getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException)
1477 OSL_TRACE("OResultSet::getPropertySetInfo");
1478 return (::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper()));
1480 /* }}} */
1483 /* {{{ OResultSet::checkColumnIndex() -I- */
1484 void OResultSet::checkColumnIndex(sal_Int32 index)
1485 throw (SQLException, RuntimeException)
1487 OSL_TRACE("OResultSet::checkColumnIndex");
1488 if ((index < 1 || index > (int) fieldCount)) {
1489 /* static object for efficiency or thread safety is a problem ? */
1490 OUString buf( RTL_CONSTASCII_USTRINGPARAM( "index out of range" ) );
1491 throw SQLException(buf, *this, OUString(), 1, Any());
1494 /* }}} */
1498 * Local variables:
1499 * tab-width: 4
1500 * c-basic-offset: 4
1501 * End:
1502 * vim600: noet sw=4 ts=4 fdm=marker
1503 * vim<600: noet sw=4 ts=4
1506 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */