1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 "ResultSet.hxx"
21 #include "ResultSetMetaData.hxx"
24 #include <comphelper/sequence.hxx>
25 #include <cppuhelper/typeprovider.hxx>
26 #include <cppuhelper/supportsservice.hxx>
27 #include <connectivity/dbexception.hxx>
28 #include <propertyids.hxx>
29 #include <rtl/string.hxx>
30 #include <rtl/ustrbuf.hxx>
32 #include <TConnection.hxx>
34 #include <com/sun/star/beans/PropertyAttribute.hpp>
35 #include <com/sun/star/lang/DisposedException.hpp>
36 #include <com/sun/star/sdbc/DataType.hpp>
37 #include <com/sun/star/sdbcx/CompareBookmark.hpp>
39 using namespace ::comphelper
;
40 using namespace ::connectivity
;
41 using namespace ::connectivity::firebird
;
42 using namespace ::cppu
;
43 using namespace ::dbtools
;
44 using namespace ::osl
;
46 using namespace ::com::sun::star
;
47 using namespace ::com::sun::star::uno
;
48 using namespace ::com::sun::star::lang
;
49 using namespace ::com::sun::star::beans
;
50 using namespace ::com::sun::star::sdbc
;
51 using namespace ::com::sun::star::sdbcx
;
52 using namespace ::com::sun::star::container
;
53 using namespace ::com::sun::star::io
;
54 using namespace ::com::sun::star::util
;
56 OResultSet::OResultSet(Connection
* pConnection
,
58 const uno::Reference
< XInterface
>& xStatement
,
59 isc_stmt_handle
& aStatementHandle
,
61 : OResultSet_BASE(rMutex
)
62 , OPropertyContainer(OResultSet_BASE::rBHelper
)
63 , m_bIsBookmarkable(false)
65 , m_nResultSetType(::com::sun::star::sdbc::ResultSetType::FORWARD_ONLY
)
66 , m_nFetchDirection(::com::sun::star::sdbc::FetchDirection::FORWARD
)
67 , m_nResultSetConcurrency(::com::sun::star::sdbc::ResultSetConcurrency::READ_ONLY
)
68 , m_pConnection(pConnection
)
70 , m_xStatement(xStatement
)
73 , m_statementHandle(aStatementHandle
)
76 , m_bIsAfterLastRow(false)
77 , m_fieldCount(pSqlda
? pSqlda
->sqld
: 0)
79 SAL_INFO("connectivity.firebird", "OResultSet().");
80 registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISBOOKMARKABLE
),
81 PROPERTY_ID_ISBOOKMARKABLE
,
82 PropertyAttribute::READONLY
,
84 cppu::UnoType
<decltype(m_bIsBookmarkable
)>::get());
85 registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FETCHSIZE
),
86 PROPERTY_ID_FETCHSIZE
,
87 PropertyAttribute::READONLY
,
89 cppu::UnoType
<decltype(m_nFetchSize
)>::get());
90 registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_RESULTSETTYPE
),
91 PROPERTY_ID_RESULTSETTYPE
,
92 PropertyAttribute::READONLY
,
94 cppu::UnoType
<decltype(m_nResultSetType
)>::get());
95 registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FETCHDIRECTION
),
96 PROPERTY_ID_FETCHDIRECTION
,
97 PropertyAttribute::READONLY
,
99 cppu::UnoType
<decltype(m_nFetchDirection
)>::get());
100 registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_RESULTSETCONCURRENCY
),
101 PROPERTY_ID_RESULTSETCONCURRENCY
,
102 PropertyAttribute::READONLY
,
103 &m_nResultSetConcurrency
,
104 cppu::UnoType
<decltype(m_nResultSetConcurrency
)>::get());
107 return; // TODO: what?
111 OResultSet::~OResultSet()
115 // ---- XResultSet -- Row retrieval methods ------------------------------------
116 sal_Int32 SAL_CALL
OResultSet::getRow() throw(SQLException
, RuntimeException
, std::exception
)
118 MutexGuard
aGuard(m_rMutex
);
119 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
124 sal_Bool SAL_CALL
OResultSet::next() throw(SQLException
, RuntimeException
, std::exception
)
126 MutexGuard
aGuard(m_rMutex
);
127 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
131 ISC_STATUS fetchStat
= isc_dsql_fetch(m_statusVector
,
135 if (fetchStat
== 0) // SUCCESSFUL
139 else if (fetchStat
== 100L) // END OF DATASET
141 m_bIsAfterLastRow
= true;
146 SAL_WARN("connectivity.firebird", "Error when fetching data");
147 // Throws sql exception as appropriate
148 evaluateStatusVector(m_statusVector
, "isc_dsql_fetch", *this);
153 sal_Bool SAL_CALL
OResultSet::previous() throw(SQLException
, RuntimeException
, std::exception
)
155 ::dbtools::throwFunctionNotSupportedSQLException("previous not supported in firebird",
160 sal_Bool SAL_CALL
OResultSet::isLast() throw(SQLException
, RuntimeException
, std::exception
)
162 ::dbtools::throwFunctionNotSupportedSQLException("isLast not supported in firebird",
167 sal_Bool SAL_CALL
OResultSet::isBeforeFirst() throw(SQLException
, RuntimeException
, std::exception
)
169 MutexGuard
aGuard(m_rMutex
);
170 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
172 return m_currentRow
== 0;
175 sal_Bool SAL_CALL
OResultSet::isAfterLast() throw(SQLException
, RuntimeException
, std::exception
)
177 MutexGuard
aGuard(m_rMutex
);
178 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
180 return m_bIsAfterLastRow
;
183 sal_Bool SAL_CALL
OResultSet::isFirst() throw(SQLException
, RuntimeException
, std::exception
)
185 MutexGuard
aGuard(m_rMutex
);
186 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
188 return m_currentRow
== 1 && !m_bIsAfterLastRow
;
191 void SAL_CALL
OResultSet::beforeFirst() throw(SQLException
, RuntimeException
, std::exception
)
193 MutexGuard
aGuard(m_rMutex
);
194 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
196 if (m_currentRow
!= 0)
197 ::dbtools::throwFunctionNotSupportedSQLException("beforeFirst not supported in firebird",
201 void SAL_CALL
OResultSet::afterLast() throw(SQLException
, RuntimeException
, std::exception
)
203 MutexGuard
aGuard(m_rMutex
);
204 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
206 if (!m_bIsAfterLastRow
)
207 ::dbtools::throwFunctionNotSupportedSQLException("afterLast not supported in firebird",
211 sal_Bool SAL_CALL
OResultSet::first() throw(SQLException
, RuntimeException
, std::exception
)
213 MutexGuard
aGuard(m_rMutex
);
214 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
216 if (m_currentRow
== 0)
220 else if (m_currentRow
== 1 && !m_bIsAfterLastRow
)
226 ::dbtools::throwFunctionNotSupportedSQLException("first not supported in firebird",
232 sal_Bool SAL_CALL
OResultSet::last() throw(SQLException
, RuntimeException
, std::exception
)
234 // We need to iterate past the last row to know when we've passed the last
235 // row, hence we can't actually move to last.
236 ::dbtools::throwFunctionNotSupportedSQLException("last not supported in firebird",
241 sal_Bool SAL_CALL
OResultSet::absolute(sal_Int32 aRow
) throw(SQLException
, RuntimeException
, std::exception
)
243 MutexGuard
aGuard(m_rMutex
);
244 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
246 if (aRow
> m_currentRow
)
248 sal_Int32 aIterations
= aRow
- m_currentRow
;
249 return relative(aIterations
);
253 ::dbtools::throwFunctionNotSupportedSQLException("absolute not supported in firebird",
259 sal_Bool SAL_CALL
OResultSet::relative(sal_Int32 row
) throw(SQLException
, RuntimeException
, std::exception
)
261 MutexGuard
aGuard(m_rMutex
);
262 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
275 ::dbtools::throwFunctionNotSupportedSQLException("relative not supported in firebird",
281 void SAL_CALL
OResultSet::checkColumnIndex(sal_Int32 nIndex
)
282 throw (SQLException
, RuntimeException
)
284 MutexGuard
aGuard(m_rMutex
);
285 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
287 if( nIndex
< 1 || nIndex
> m_fieldCount
)
289 ::dbtools::throwSQLException(
290 "No column " + OUString::number(nIndex
),
291 ::dbtools::SQL_COLUMN_NOT_FOUND
,
296 void SAL_CALL
OResultSet::checkRowIndex()
297 throw (SQLException
, RuntimeException
)
299 MutexGuard
aGuard(m_rMutex
);
300 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
302 if((m_currentRow
< 1) || m_bIsAfterLastRow
)
304 ::dbtools::throwSQLException(
306 ::dbtools::SQL_INVALID_CURSOR_POSITION
,
311 Any SAL_CALL
OResultSet::queryInterface( const Type
& rType
) throw(RuntimeException
, std::exception
)
313 Any aRet
= OPropertySetHelper::queryInterface(rType
);
314 return aRet
.hasValue() ? aRet
: OResultSet_BASE::queryInterface(rType
);
317 Sequence
< Type
> SAL_CALL
OResultSet::getTypes() throw( RuntimeException
, std::exception
)
319 return concatSequences(OPropertySetHelper::getTypes(), OResultSet_BASE::getTypes());
321 // ---- XColumnLocate ---------------------------------------------------------
322 sal_Int32 SAL_CALL
OResultSet::findColumn(const OUString
& rColumnName
)
323 throw(SQLException
, RuntimeException
, std::exception
)
325 MutexGuard
aGuard(m_rMutex
);
326 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
328 uno::Reference
< XResultSetMetaData
> xMeta
= getMetaData();
329 sal_Int32 nLen
= xMeta
->getColumnCount();
332 for(i
= 1; i
<=nLen
; ++i
)
334 // We assume case sensitive, otherwise you'd have to test
335 // xMeta->isCaseSensitive and use qualsIgnoreAsciiCase as needed.
336 if (rColumnName
== xMeta
->getColumnName(i
))
340 ::dbtools::throwInvalidColumnException(rColumnName
, *this);
342 return 0; // Never reached
345 uno::Reference
< XInputStream
> SAL_CALL
OResultSet::getBinaryStream( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
, std::exception
)
348 MutexGuard
aGuard(m_rMutex
);
349 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
354 uno::Reference
< XInputStream
> SAL_CALL
OResultSet::getCharacterStream( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
, std::exception
)
357 MutexGuard
aGuard(m_rMutex
);
358 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
363 // ---- Internal Utilities ---------------------------------------------------
364 bool OResultSet::isNull(const sal_Int32 nColumnIndex
)
366 assert(nColumnIndex
<= m_fieldCount
);
367 XSQLVAR
* pVar
= m_pSqlda
->sqlvar
;
369 if (pVar
[nColumnIndex
-1].sqltype
& 1) // Indicates column may contain null
371 if (*pVar
[nColumnIndex
-1].sqlind
== -1)
377 template <typename T
>
378 T
OResultSet::retrieveValue(const sal_Int32 nColumnIndex
, const ISC_SHORT nType
)
380 if ((m_bWasNull
= isNull(nColumnIndex
)))
383 if ((m_pSqlda
->sqlvar
[nColumnIndex
-1].sqltype
& ~1) == nType
)
384 return *reinterpret_cast<T
*>(m_pSqlda
->sqlvar
[nColumnIndex
-1].sqldata
);
386 return retrieveValue
< ORowSetValue
>(nColumnIndex
, 0);
390 ORowSetValue
OResultSet::retrieveValue(const sal_Int32 nColumnIndex
, const ISC_SHORT
/*nType*/)
392 // See http://wiki.openoffice.org/wiki/Documentation/DevGuide/Database/Using_the_getXXX_Methods
393 // (bottom of page) for a chart of possible conversions, we should allow all
394 // of these -- Blob/Clob will probably need some specialist handling especially
395 // w.r.t. to generating Strings for them.
397 // Basically we just have to map to the correct direct request and
398 // ORowSetValue does the rest for us here.
399 switch (m_pSqlda
->sqlvar
[nColumnIndex
-1].sqltype
& ~1)
403 return getString(nColumnIndex
);
405 return getShort(nColumnIndex
);
407 return getInt(nColumnIndex
);
409 return getFloat(nColumnIndex
);
411 return getDouble(nColumnIndex
);
413 return getFloat(nColumnIndex
);
415 return getTimestamp(nColumnIndex
);
417 return getTime(nColumnIndex
);
419 return getDate(nColumnIndex
);
421 return getLong(nColumnIndex
);
426 // TODO: these are all invalid conversions, so maybe we should
427 // throw an exception?
428 return ORowSetValue();
431 return ORowSetValue();
436 Date
OResultSet::retrieveValue(const sal_Int32 nColumnIndex
, const ISC_SHORT
/*nType*/)
438 if ((m_pSqlda
->sqlvar
[nColumnIndex
-1].sqltype
& ~1) == SQL_TYPE_DATE
)
440 ISC_DATE aISCDate
= *(reinterpret_cast<ISC_DATE
*>(m_pSqlda
->sqlvar
[nColumnIndex
-1].sqldata
));
443 isc_decode_sql_date(&aISCDate
, &aCTime
);
445 return Date(aCTime
.tm_mday
, aCTime
.tm_mon
, aCTime
.tm_year
);
449 return retrieveValue
< ORowSetValue
>(nColumnIndex
, 0);
454 Time
OResultSet::retrieveValue(const sal_Int32 nColumnIndex
, const ISC_SHORT
/*nType*/)
456 if ((m_pSqlda
->sqlvar
[nColumnIndex
-1].sqltype
& ~1) == SQL_TYPE_TIME
)
458 ISC_TIME aISCTime
= *(reinterpret_cast<ISC_TIME
*>(m_pSqlda
->sqlvar
[nColumnIndex
-1].sqldata
));
461 isc_decode_sql_time(&aISCTime
, &aCTime
);
463 // first field is nanoseconds -- not supported in firebird or struct tm.
464 // last field denotes UTC (true) or unknown (false)
465 return Time(0, aCTime
.tm_sec
, aCTime
.tm_min
, aCTime
.tm_hour
, false);
469 return retrieveValue
< ORowSetValue
>(nColumnIndex
, 0);
474 DateTime
OResultSet::retrieveValue(const sal_Int32 nColumnIndex
, const ISC_SHORT
/*nType*/)
476 if ((m_pSqlda
->sqlvar
[nColumnIndex
-1].sqltype
& ~1) == SQL_TIMESTAMP
)
478 ISC_TIMESTAMP aISCTimestamp
= *(reinterpret_cast<ISC_TIMESTAMP
*>(m_pSqlda
->sqlvar
[nColumnIndex
-1].sqldata
));
481 isc_decode_timestamp(&aISCTimestamp
, &aCTime
);
483 // first field is nanoseconds -- not supported in firebird or struct tm.
484 // last field denotes UTC (true) or unknown (false)
485 return DateTime(0, aCTime
.tm_sec
, aCTime
.tm_min
, aCTime
.tm_hour
, aCTime
.tm_mday
,
486 aCTime
.tm_mon
, aCTime
.tm_year
, false);
490 return retrieveValue
< ORowSetValue
>(nColumnIndex
, 0);
495 OUString
OResultSet::retrieveValue(const sal_Int32 nColumnIndex
, const ISC_SHORT
/*nType*/)
497 // &~1 to remove the "can contain NULL" indicator
498 int aSqlType
= m_pSqlda
->sqlvar
[nColumnIndex
-1].sqltype
& ~1;
499 if (aSqlType
== SQL_TEXT
)
501 return OUString(m_pSqlda
->sqlvar
[nColumnIndex
-1].sqldata
,
502 m_pSqlda
->sqlvar
[nColumnIndex
-1].sqllen
,
503 RTL_TEXTENCODING_UTF8
);
505 else if (aSqlType
== SQL_VARYING
)
507 // First 2 bytes are a short containing the length of the string
508 // No idea if sqllen is still valid here?
509 sal_uInt16 aLength
= *(reinterpret_cast<sal_uInt16
*>(m_pSqlda
->sqlvar
[nColumnIndex
-1].sqldata
));
510 return OUString(m_pSqlda
->sqlvar
[nColumnIndex
-1].sqldata
+ 2,
512 RTL_TEXTENCODING_UTF8
);
516 return retrieveValue
< ORowSetValue
>(nColumnIndex
, 0);
521 ISC_QUAD
* OResultSet::retrieveValue(const sal_Int32 nColumnIndex
, const ISC_SHORT nType
)
523 // TODO: this is probably wrong
524 if ((m_pSqlda
->sqlvar
[nColumnIndex
-1].sqltype
& ~1) == nType
)
525 return reinterpret_cast<ISC_QUAD
*>(m_pSqlda
->sqlvar
[nColumnIndex
-1].sqldata
);
527 throw SQLException(); // TODO: better exception (can't convert Blob)
530 template <typename T
>
531 T
OResultSet::safelyRetrieveValue(const sal_Int32 nColumnIndex
, const ISC_SHORT nType
)
533 MutexGuard
aGuard(m_rMutex
);
534 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
536 checkColumnIndex(nColumnIndex
);
539 if ((m_bWasNull
= isNull(nColumnIndex
)))
542 return retrieveValue
< T
>(nColumnIndex
, nType
);
545 // ---- XRow -----------------------------------------------------------------
546 sal_Bool SAL_CALL
OResultSet::wasNull() throw(SQLException
, RuntimeException
, std::exception
)
548 MutexGuard
aGuard(m_rMutex
);
549 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
554 // ---- XRow: Simple Numerical types ------------------------------------------
555 sal_Bool SAL_CALL
OResultSet::getBoolean(sal_Int32 nColumnIndex
)
556 throw(SQLException
, RuntimeException
, std::exception
)
558 // Not a native firebird type hence we always have to convert.
559 return safelyRetrieveValue
< ORowSetValue
>(nColumnIndex
);
562 sal_Int8 SAL_CALL
OResultSet::getByte(sal_Int32 nColumnIndex
)
563 throw(SQLException
, RuntimeException
, std::exception
)
565 // Not a native firebird type hence we always have to convert.
566 return safelyRetrieveValue
< ORowSetValue
>(nColumnIndex
);
569 Sequence
< sal_Int8
> SAL_CALL
OResultSet::getBytes(sal_Int32 columnIndex
)
570 throw(SQLException
, RuntimeException
, std::exception
)
573 return Sequence
< sal_Int8
>(); // TODO: implement
574 //return safelyRetrieveValue(columnIndex);
577 sal_Int16 SAL_CALL
OResultSet::getShort(sal_Int32 columnIndex
)
578 throw(SQLException
, RuntimeException
, std::exception
)
580 return safelyRetrieveValue
< sal_Int16
>(columnIndex
, SQL_SHORT
);
583 sal_Int32 SAL_CALL
OResultSet::getInt(sal_Int32 columnIndex
)
584 throw(SQLException
, RuntimeException
, std::exception
)
586 return safelyRetrieveValue
< sal_Int32
>(columnIndex
, SQL_LONG
);
589 sal_Int64 SAL_CALL
OResultSet::getLong(sal_Int32 columnIndex
)
590 throw(SQLException
, RuntimeException
, std::exception
)
592 return safelyRetrieveValue
< sal_Int64
>(columnIndex
, SQL_INT64
);
595 float SAL_CALL
OResultSet::getFloat(sal_Int32 columnIndex
)
596 throw(SQLException
, RuntimeException
, std::exception
)
598 return safelyRetrieveValue
< float >(columnIndex
, SQL_FLOAT
);
601 double SAL_CALL
OResultSet::getDouble(sal_Int32 columnIndex
)
602 throw(SQLException
, RuntimeException
, std::exception
)
604 return safelyRetrieveValue
< double >(columnIndex
, SQL_DOUBLE
);
607 // ---- XRow: More complex types ----------------------------------------------
608 OUString SAL_CALL
OResultSet::getString(sal_Int32 nIndex
)
609 throw(SQLException
, RuntimeException
, std::exception
)
611 return safelyRetrieveValue
< OUString
>(nIndex
);
614 Date SAL_CALL
OResultSet::getDate(sal_Int32 nIndex
)
615 throw(SQLException
, RuntimeException
, std::exception
)
617 return safelyRetrieveValue
< Date
>(nIndex
, SQL_TYPE_DATE
);
620 Time SAL_CALL
OResultSet::getTime(sal_Int32 nIndex
)
621 throw(SQLException
, RuntimeException
, std::exception
)
623 return safelyRetrieveValue
< css::util::Time
>(nIndex
, SQL_TYPE_TIME
);
626 DateTime SAL_CALL
OResultSet::getTimestamp(sal_Int32 nIndex
)
627 throw(SQLException
, RuntimeException
, std::exception
)
629 return safelyRetrieveValue
< DateTime
>(nIndex
, SQL_TIMESTAMP
);
633 uno::Reference
< XResultSetMetaData
> SAL_CALL
OResultSet::getMetaData( ) throw(SQLException
, RuntimeException
, std::exception
)
635 MutexGuard
aGuard(m_rMutex
);
636 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
638 if(!m_xMetaData
.is())
639 m_xMetaData
= new OResultSetMetaData(m_pConnection
, m_pSqlda
);
643 uno::Reference
< XArray
> SAL_CALL
OResultSet::getArray( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
, std::exception
)
646 MutexGuard
aGuard(m_rMutex
);
647 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
654 uno::Reference
< XClob
> SAL_CALL
OResultSet::getClob( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
, std::exception
)
657 MutexGuard
aGuard(m_rMutex
);
658 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
663 uno::Reference
< XBlob
> SAL_CALL
OResultSet::getBlob(sal_Int32 columnIndex
)
664 throw(SQLException
, RuntimeException
, std::exception
)
666 MutexGuard
aGuard(m_rMutex
);
667 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
669 // TODO: CLOB etc. should be valid here too, but we probably want some more
670 // cleverness around this.
671 ISC_QUAD
* pBlobID
= safelyRetrieveValue
< ISC_QUAD
* >(columnIndex
, SQL_BLOB
);
674 return m_pConnection
->createBlob(pBlobID
);
678 uno::Reference
< XRef
> SAL_CALL
OResultSet::getRef( sal_Int32 columnIndex
) throw(SQLException
, RuntimeException
, std::exception
)
681 MutexGuard
aGuard(m_rMutex
);
682 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
688 Any SAL_CALL
OResultSet::getObject( sal_Int32 columnIndex
, const uno::Reference
< ::com::sun::star::container::XNameAccess
>& typeMap
) throw(SQLException
, RuntimeException
, std::exception
)
692 MutexGuard
aGuard(m_rMutex
);
693 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
702 void SAL_CALL
OResultSet::close() throw(SQLException
, RuntimeException
, std::exception
)
704 SAL_INFO("connectivity.firebird", "close().");
707 MutexGuard
aGuard(m_rMutex
);
708 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
714 uno::Reference
< XInterface
> SAL_CALL
OResultSet::getStatement()
715 throw(SQLException
, RuntimeException
, std::exception
)
717 MutexGuard
aGuard(m_rMutex
);
718 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
722 //----- XResultSet: unsupported change detection methods ---------------------
723 sal_Bool SAL_CALL
OResultSet::rowDeleted() throw(SQLException
, RuntimeException
, std::exception
)
725 ::dbtools::throwFunctionNotSupportedSQLException("rowDeleted not supported in firebird",
729 sal_Bool SAL_CALL
OResultSet::rowInserted() throw(SQLException
, RuntimeException
, std::exception
)
731 ::dbtools::throwFunctionNotSupportedSQLException("rowInserted not supported in firebird",
736 sal_Bool SAL_CALL
OResultSet::rowUpdated() throw(SQLException
, RuntimeException
, std::exception
)
738 ::dbtools::throwFunctionNotSupportedSQLException("rowUpdated not supported in firebird",
743 void SAL_CALL
OResultSet::refreshRow() throw(SQLException
, RuntimeException
, std::exception
)
745 ::dbtools::throwFunctionNotSupportedSQLException("refreshRow not supported in firebird",
750 void SAL_CALL
OResultSet::cancel( ) throw(RuntimeException
, std::exception
)
752 MutexGuard
aGuard(m_rMutex
);
753 checkDisposed(OResultSet_BASE::rBHelper
.bDisposed
);
757 //----- XWarningsSupplier UNSUPPORTED -----------------------------------------
759 void SAL_CALL
OResultSet::clearWarnings() throw(SQLException
, RuntimeException
, std::exception
)
761 ::dbtools::throwFunctionNotSupportedSQLException("clearWarnings not supported in firebird",
765 Any SAL_CALL
OResultSet::getWarnings() throw(SQLException
, RuntimeException
, std::exception
)
767 ::dbtools::throwFunctionNotSupportedSQLException("getWarnings not supported in firebird",
773 //----- OIdPropertyArrayUsageHelper ------------------------------------------
774 IPropertyArrayHelper
* OResultSet::createArrayHelper() const
776 Sequence
< Property
> aProperties
;
777 describeProperties(aProperties
);
778 return new ::cppu::OPropertyArrayHelper(aProperties
);
781 IPropertyArrayHelper
& OResultSet::getInfoHelper()
783 return *getArrayHelper();
786 void SAL_CALL
OResultSet::acquire() throw()
788 OResultSet_BASE::acquire();
791 void SAL_CALL
OResultSet::release() throw()
793 OResultSet_BASE::release();
796 uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
OResultSet::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
)
798 return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
801 // ---- XServiceInfo -----------------------------------------------------------
802 OUString SAL_CALL
OResultSet::getImplementationName() throw ( RuntimeException
, std::exception
)
804 return OUString("com.sun.star.sdbcx.firebird.ResultSet");
807 Sequence
< OUString
> SAL_CALL
OResultSet::getSupportedServiceNames()
808 throw( RuntimeException
, std::exception
)
810 Sequence
< OUString
> aSupported(2);
811 aSupported
[0] = "com.sun.star.sdbc.ResultSet";
812 aSupported
[1] = "com.sun.star.sdbcx.ResultSet";
816 sal_Bool SAL_CALL
OResultSet::supportsService(const OUString
& _rServiceName
)
817 throw( RuntimeException
, std::exception
)
819 return cppu::supportsService(this, _rServiceName
);
822 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */