24#include <com/sun/star/beans/PropertyAttribute.hpp>
25#include <com/sun/star/sdbc/ResultSetType.hpp>
26#include <com/sun/star/sdbc/SQLException.hpp>
43using namespace ::
cppu;
49OResultSet::OResultSet(
const css::uno::Reference< css::sdbc::XResultSet >& _xResultSet,
50 const css::uno::Reference< css::uno::XInterface >& _xStatement,
54 ,m_xDelegatorResultSet(_xResultSet)
55 ,m_aWarnings(
Reference< XWarningsSupplier >( _xResultSet, UNO_QUERY ) )
56 ,m_nResultSetConcurrency(0)
57 ,m_bIsBookmarkable(false)
69 sal_Int32 nResultSetType(0);
74 if (ResultSetType::FORWARD_ONLY != nResultSetType)
76 Reference <XPropertySetInfo > xInfo(xSet->getPropertySetInfo());
81 "OResultSet::OResultSet: aggregate is inconsistent in its bookmarkable attribute!" );
101 OResultSetBase::getTypes());
108 return css::uno::Sequence<sal_Int8>();
114 Any aIface = OResultSetBase::queryInterface( rType );
115 if (!aIface.hasValue())
116 aIface = ::cppu::queryInterface(
125 OResultSetBase::acquire();
130 OResultSetBase::release();
159 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
167 return "com.sun.star.sdb.OResultSet";
189 return new ::cppu::OPropertyArrayHelper
211 rConvertedValue = rValue;
229 SAL_WARN(
"dbaccess",
"unknown Property");
247 fillPropertyMembersByHandle(&aPropName, &nAttributes, nHandle);
248 OSL_ENSURE(!
aPropName.isEmpty(),
"property not found?");
251 rValue = Reference< XPropertySet >(
m_xDelegatorResultSet, UNO_QUERY_THROW)->getPropertyValue(aPropName);
260 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
267 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
275 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
277 return Reference< XResultSetMetaDataSupplier >(
m_xDelegatorResultSet, UNO_QUERY_THROW)->getMetaData();
284 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
291 Reference< XDatabaseMetaData > lcl_getDBMetaDataFromStatement_nothrow(
const Reference< XInterface >& _rxStatement )
293 Reference< XDatabaseMetaData > xDBMetaData;
296 Reference< XStatement > xStatement( _rxStatement, UNO_QUERY );
297 Reference< XPreparedStatement > xPreparedStatement( _rxStatement, UNO_QUERY );
298 Reference< XConnection > xConn;
299 if ( xStatement.is() )
300 xConn = xStatement->getConnection();
301 else if ( xPreparedStatement.is() )
302 xConn = xPreparedStatement->getConnection();
304 xDBMetaData = xConn->getMetaData();
306 catch(
const Exception& )
318 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
324 Reference< XResultSetMetaData > xMetaData = Reference< XResultSetMetaDataSupplier >(
m_xDelegatorResultSet, UNO_QUERY_THROW)->getMetaData();
326 sal_Int32 nColCount = 0;
330 Reference< XDatabaseMetaData > xDBMetaData( lcl_getDBMetaDataFromStatement_nothrow(
getStatement() ) );
331 nColCount = xMetaData->getColumnCount();
333 for ( sal_Int32
i = 0;
i < nColCount; ++
i)
336 OUString
sName = xMetaData->getColumnName(
i + 1);
348 catch (
const SQLException& )
354 #if OSL_DEBUG_LEVEL > 0
359 const Reference< XNameAccess > xColNames(
static_cast< XNameAccess*
>(
m_pColumns.get() ), UNO_SET_THROW );
360 const Sequence< OUString > aNames( xColNames->getElementNames() );
361 SAL_WARN_IF( aNames.getLength() != nColCount,
"dbaccess",
362 "OResultSet::getColumns: invalid column count!" );
363 for (
auto const &
name : aNames )
365 Reference< XPropertySet > xColProps( xColNames->getByName(
name ), UNO_QUERY_THROW );
385 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
393 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
401 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
409 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
417 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
425 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
433 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
441 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
449 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
457 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
465 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
473 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
481 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
489 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
497 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
505 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
513 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
521 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
529 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
537 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
546 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
556 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
566 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
576 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
586 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
596 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
606 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
616 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
626 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
636 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
646 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
656 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
666 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
676 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
686 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
696 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
706 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
717 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
725 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
733 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
741 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
749 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
757 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
765 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
773 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
781 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
789 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
797 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
805 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
813 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
821 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
829 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
837 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
845 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
853 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
862 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
872 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
882 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
886 return Reference< XRowLocate >(
m_xDelegatorResultSet, UNO_QUERY_THROW)->moveRelativeToBookmark(bookmark, rows);
892 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
896 return Reference< XRowLocate >(
m_xDelegatorResultSet, UNO_QUERY_THROW)->compareBookmarks(_first, _second);
902 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
912 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
923 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
933 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
943 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
953 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
963 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
973 ::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
991 throwSQLException(
"The result set does not have bookmark support.", StandardSQLState::GENERAL_ERROR, *
const_cast< OResultSet*
>(
this ) );
::cppu::IPropertyArrayHelper * getArrayHelper()
void disposing(std::unique_lock< std::mutex > &rGuard)
mutable::osl::Mutex m_aMutex
static css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL createPropertySetInfo(IPropertyArrayHelper &rProperties)
css::uno::Type const & get()
virtual void SAL_CALL updateString(sal_Int32 columnIndex, const OUString &x) override
virtual void SAL_CALL refreshRow() override
virtual void SAL_CALL updateTimestamp(sal_Int32 columnIndex, const css::util::DateTime &x) override
virtual void SAL_CALL updateNumericObject(sal_Int32 columnIndex, const css::uno::Any &x, sal_Int32 scale) override
virtual sal_Int64 SAL_CALL getLong(sal_Int32 columnIndex) override
virtual void SAL_CALL afterLast() override
virtual void SAL_CALL updateNull(sal_Int32 columnIndex) override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual sal_Bool SAL_CALL isBeforeFirst() override
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob(sal_Int32 columnIndex) override
sal_Int32 m_nResultSetConcurrency
virtual css::uno::Any SAL_CALL getObject(sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess > &typeMap) override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes(sal_Int32 columnIndex) override
virtual void SAL_CALL clearWarnings() override
virtual void SAL_CALL moveToCurrentRow() override
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData() override
virtual void SAL_CALL moveToInsertRow() override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getStatement() override
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual css::util::Time SAL_CALL getTime(sal_Int32 columnIndex) override
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray(sal_Int32 columnIndex) override
css::uno::Reference< css::uno::XInterface > m_aStatement
virtual void SAL_CALL disposing() override
virtual sal_Bool SAL_CALL isLast() override
virtual sal_Int32 SAL_CALL findColumn(const OUString &columnName) override
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream(sal_Int32 columnIndex) override
virtual sal_Bool SAL_CALL relative(sal_Int32 rows) override
virtual css::util::Date SAL_CALL getDate(sal_Int32 columnIndex) override
css::uno::Reference< css::sdbc::XResultSetUpdate > m_xDelegatorResultSetUpdate
virtual void SAL_CALL deleteRow() override
virtual void SAL_CALL updateShort(sal_Int32 columnIndex, sal_Int16 x) override
virtual void SAL_CALL updateDouble(sal_Int32 columnIndex, double x) override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
std::unique_ptr< OColumns > m_pColumns
virtual sal_Bool SAL_CALL first() override
virtual sal_Bool SAL_CALL absolute(sal_Int32 row) override
virtual css::util::DateTime SAL_CALL getTimestamp(sal_Int32 columnIndex) override
virtual void SAL_CALL beforeFirst() override
virtual sal_Bool SAL_CALL isAfterLast() override
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getColumns() override
::dbtools::WarningsContainer m_aWarnings
virtual sal_Bool SAL_CALL wasNull() override
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef(sal_Int32 columnIndex) override
virtual void SAL_CALL updateBoolean(sal_Int32 columnIndex, sal_Bool x) override
virtual OUString SAL_CALL getImplementationName() override
virtual sal_Bool SAL_CALL next() override
virtual void SAL_CALL updateDate(sal_Int32 columnIndex, const css::util::Date &x) override
virtual void SAL_CALL acquire() noexcept override
void checkBookmarkable() const
virtual ~OResultSet() override
virtual void SAL_CALL updateCharacterStream(sal_Int32 columnIndex, const css::uno::Reference< css::io::XInputStream > &x, sal_Int32 length) override
virtual sal_Bool SAL_CALL hasOrderedBookmarks() override
virtual void SAL_CALL updateByte(sal_Int32 columnIndex, sal_Int8 x) override
virtual sal_Bool SAL_CALL rowInserted() override
virtual sal_Bool SAL_CALL rowDeleted() override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream(sal_Int32 columnIndex) override
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
virtual sal_Int8 SAL_CALL getByte(sal_Int32 columnIndex) override
virtual double SAL_CALL getDouble(sal_Int32 columnIndex) override
virtual OUString SAL_CALL getString(sal_Int32 columnIndex) override
virtual void SAL_CALL updateInt(sal_Int32 columnIndex, sal_Int32 x) override
virtual void SAL_CALL updateTime(sal_Int32 columnIndex, const css::util::Time &x) override
virtual void SAL_CALL updateBinaryStream(sal_Int32 columnIndex, const css::uno::Reference< css::io::XInputStream > &x, sal_Int32 length) override
virtual sal_Bool SAL_CALL getBoolean(sal_Int32 columnIndex) override
virtual css::uno::Any SAL_CALL getBookmark() override
virtual css::uno::Any SAL_CALL getWarnings() override
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
css::uno::Reference< css::sdbc::XResultSet > m_xDelegatorResultSet
virtual sal_Bool SAL_CALL moveRelativeToBookmark(const css::uno::Any &bookmark, sal_Int32 rows) override
virtual sal_Int32 SAL_CALL hashBookmark(const css::uno::Any &bookmark) override
virtual void SAL_CALL updateObject(sal_Int32 columnIndex, const css::uno::Any &x) override
virtual void SAL_CALL close() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL updateFloat(sal_Int32 columnIndex, float x) override
virtual sal_Bool SAL_CALL isFirst() override
virtual void SAL_CALL cancelRowUpdates() override
virtual sal_Int32 SAL_CALL compareBookmarks(const css::uno::Any &first, const css::uno::Any &second) override
virtual sal_Bool SAL_CALL rowUpdated() override
virtual float SAL_CALL getFloat(sal_Int32 columnIndex) override
virtual sal_Int32 SAL_CALL getInt(sal_Int32 columnIndex) override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual void SAL_CALL insertRow() override
css::uno::Reference< css::sdbc::XRowUpdate > m_xDelegatorRowUpdate
virtual sal_Bool SAL_CALL moveToBookmark(const css::uno::Any &bookmark) override
virtual void SAL_CALL updateBytes(sal_Int32 columnIndex, const css::uno::Sequence< sal_Int8 > &x) override
virtual sal_Int32 SAL_CALL getRow() override
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob(sal_Int32 columnIndex) override
virtual sal_Int16 SAL_CALL getShort(sal_Int32 columnIndex) override
virtual void SAL_CALL updateRow() override
void checkReadOnly() const
virtual sal_Bool SAL_CALL previous() override
virtual sal_Bool SAL_CALL last() override
virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue) override
css::uno::Reference< css::sdbc::XRow > m_xDelegatorRow
virtual void SAL_CALL updateLong(sal_Int32 columnIndex, sal_Int64 x) override
virtual void SAL_CALL release() noexcept override
#define DBG_UNHANDLED_EXCEPTION(...)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
class SAL_NO_VTABLE XPropertySet
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
::cppu::WeakComponentImplHelper< css::sdbc::XWarningsSupplier, css::sdbc::XResultSet, css::sdbc::XResultSetMetaDataSupplier, css::sdbc::XRow, css::sdbc::XCloseable, css::sdbc::XColumnLocate, css::sdbcx::XRowLocate, css::sdbcx::XColumnsSupplier, css::sdbc::XResultSetUpdate, css::sdbc::XRowUpdate, css::lang::XServiceInfo > OResultSetBase
#define PROPERTY_ID_ISBOOKMARKABLE
#define PROPERTY_ID_RESULTSETTYPE
#define PROPERTY_ID_CURSORNAME
#define PROPERTY_ID_RESULTSETCONCURRENCY
#define PROPERTY_ID_FETCHSIZE
#define PROPERTY_ID_FETCHDIRECTION
constexpr OUStringLiteral PROPERTY_FETCHDIRECTION(u"FetchDirection")
constexpr OUStringLiteral SERVICE_SDBC_RESULTSET
constexpr OUStringLiteral PROPERTY_RESULTSETCONCURRENCY(u"ResultSetConcurrency")
constexpr OUStringLiteral PROPERTY_RESULTSETTYPE(u"ResultSetType")
constexpr OUStringLiteral PROPERTY_ISBOOKMARKABLE(u"IsBookmarkable")
constexpr OUStringLiteral SERVICE_SDB_RESULTSET
constexpr OUStringLiteral PROPERTY_NAME(u"Name")
constexpr OUStringLiteral PROPERTY_FETCHSIZE(u"FetchSize")
constexpr OUStringLiteral PROPERTY_CURSORNAME(u"CursorName")