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