diff --git a/dbaccess/source/core/dataaccess/connection.cxx b/dbaccess/source/core/dataaccess/connection.cxx index d1543a36c036..808d4128138c 100644 --- a/dbaccess/source/core/dataaccess/connection.cxx +++ b/dbaccess/source/core/dataaccess/connection.cxx @@ -111,7 +111,7 @@ Reference< XStatement > OConnection::createStatement() MutexGuard aGuard(m_aMutex); checkDisposed(); - Reference< XStatement > xStatement; + rtl::Reference< OStatement > xStatement; Reference< XStatement > xMasterStatement = m_xMasterConnection->createStatement(); if ( xMasterStatement.is() ) { @@ -127,7 +127,7 @@ Reference< XPreparedStatement > OConnection::prepareStatement(const OUString& s checkDisposed(); // TODO convert the SQL to SQL the driver understands - Reference< XPreparedStatement > xStatement; + rtl::Reference< OPreparedStatement > xStatement; Reference< XPreparedStatement > xMasterStatement = m_xMasterConnection->prepareStatement(sql); if ( xMasterStatement.is() ) { @@ -142,7 +142,7 @@ Reference< XPreparedStatement > OConnection::prepareCall(const OUString& sql) MutexGuard aGuard(m_aMutex); checkDisposed(); - Reference< XPreparedStatement > xStatement; + rtl::Reference< OCallableStatement > xStatement; Reference< XPreparedStatement > xMasterStatement = m_xMasterConnection->prepareCall(sql); if ( xMasterStatement.is() ) { @@ -428,7 +428,7 @@ void OConnection::disposing() for (auto const& statement : m_aStatements) { - Reference xComp(statement.get(),UNO_QUERY); + rtl::Reference xComp(statement.get()); ::comphelper::disposeComponent(xComp); } m_aStatements.clear(); diff --git a/dbaccess/source/core/inc/connection.hxx b/dbaccess/source/core/inc/connection.hxx index 28596999880d..31f2c924bde1 100644 --- a/dbaccess/source/core/inc/connection.hxx +++ b/dbaccess/source/core/inc/connection.hxx @@ -49,6 +49,8 @@ #include #include +class OStatementBase; + namespace dbaccess { @@ -76,7 +78,9 @@ class OConnection final :public OConnection_Base unotools::WeakReference m_xParent; css::uno::Reference< css::sdbcx::XTablesSupplier > m_xMasterTables; // just to avoid the recreation of the catalog - connectivity::OWeakRefArray m_aStatements; + // contains OStatement and OPreparedStatement + std::vector> + m_aStatements; rtl::Reference< OQueryContainer > m_xQueries; connectivity::OWeakRefArray m_aComposers;