diff options
author | Noel Grandin <noel@peralex.com> | 2012-11-27 11:45:21 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-11-28 13:06:18 +0100 |
commit | 38cc919efb965e7982d23d5b1c91a639cc2c6fdd (patch) | |
tree | 3586b24e5d14c7612dae8da02cdd04ad7b2ec112 /dbaccess | |
parent | 7470cc532fe408dc9d8735cde0e2eb5bb62fd69c (diff) |
fdo#46808, use service constructor for sdbc::ConnectionPool
Change-Id: Id12226af5e537b1eeacbb062ad937a3551e245c0
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/core/api/RowSet.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/core/dataaccess/datasource.cxx | 8 | ||||
-rw-r--r-- | dbaccess/source/core/misc/DatabaseDataProvider.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/uno/composerdialogs.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/uno/copytablewizard.cxx | 6 |
5 files changed, 14 insertions, 6 deletions
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index 04c531e4bbb7..50b9aa322640 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -1459,7 +1459,7 @@ void SAL_CALL ORowSet::executeWithCompletion( const Reference< XInteractionHandl calcConnection( _rxHandler ); m_bRebuildConnOnExecute = sal_False; - Reference< XSingleSelectQueryComposer > xComposer = getCurrentSettingsComposer( this, m_aContext.getLegacyServiceFactory() ); + Reference< XSingleSelectQueryComposer > xComposer = getCurrentSettingsComposer( this, m_aContext.getUNOContext() ); Reference<XParametersSupplier> xParameters(xComposer, UNO_QUERY); Reference<XIndexAccess> xParamsAsIndicies = xParameters.is() ? xParameters->getParameters() : Reference<XIndexAccess>(); diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx index 89c14fbc8103..b692bb5f4114 100644 --- a/dbaccess/source/core/dataaccess/datasource.cxx +++ b/dbaccess/source/core/dataaccess/datasource.cxx @@ -41,6 +41,7 @@ #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/reflection/ProxyFactory.hpp> #include <com/sun/star/sdb/DatabaseContext.hpp> +#include <com/sun/star/sdbc/ConnectionPool.hpp> #include <com/sun/star/sdbc/XDriverAccess.hpp> #include <com/sun/star/sdbc/XDriverManager.hpp> #include <com/sun/star/sdbcx/XTablesSupplier.hpp> @@ -642,9 +643,12 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const ::rtl::O Reference< XConnection > xReturn; Reference< XDriverManager > xManager; - if ( !m_pImpl->m_aContext.createComponent( "com.sun.star.sdbc.ConnectionPool", xManager ) ) + try { + xManager.set( ConnectionPool::create( m_pImpl->m_aContext.getUNOContext() ) ); + } catch( const Exception& ) { } + if ( !xManager.is() ) // no connection pool installed, fall back to driver manager - m_pImpl->m_aContext.createComponent( "com.sun.star.sdbc.DriverManager", xManager ); + xManager.set( m_pImpl->m_aContext.createComponent( "com.sun.star.sdbc.DriverManager" ), UNO_QUERY_THROW ); ::rtl::OUString sUser(_rUid); ::rtl::OUString sPwd(_rPwd); diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx index 80bb59906a0e..78373c523b4a 100644 --- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx +++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx @@ -58,7 +58,7 @@ DatabaseDataProvider::DatabaseDataProvider(uno::Reference< uno::XComponentContex ::cppu::PropertySetMixin< chart2::data::XDatabaseDataProvider >( context, static_cast< Implements >( IMPLEMENTS_PROPERTY_SET), uno::Sequence< ::rtl::OUString >()), - m_aParameterManager( m_aMutex, uno::Reference< lang::XMultiServiceFactory >(context->getServiceManager(),uno::UNO_QUERY) ), + m_aParameterManager( m_aMutex, context ), m_aFilterManager( uno::Reference< lang::XMultiServiceFactory >(context->getServiceManager(),uno::UNO_QUERY) ), m_xContext(context), m_CommandType(sdb::CommandType::COMMAND), // #i94114 diff --git a/dbaccess/source/ui/uno/composerdialogs.cxx b/dbaccess/source/ui/uno/composerdialogs.cxx index 0a2cb1e87274..213bccb13e70 100644 --- a/dbaccess/source/ui/uno/composerdialogs.cxx +++ b/dbaccess/source/ui/uno/composerdialogs.cxx @@ -101,7 +101,7 @@ namespace dbaui // fallback: if there is a connection and thus a row set, but no composer, create one if ( xConnection.is() && !m_xComposer.is() ) - m_xComposer = ::dbtools::getCurrentSettingsComposer( Reference< XPropertySet >( m_xRowSet, UNO_QUERY ), m_aContext.getLegacyServiceFactory() ); + m_xComposer = ::dbtools::getCurrentSettingsComposer( Reference< XPropertySet >( m_xRowSet, UNO_QUERY ), m_aContext.getUNOContext() ); // the columns of the row set Reference< XColumnsSupplier > xSuppColumns( m_xRowSet, UNO_QUERY ); diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index f9861d8820ba..bc5804f57b7f 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -53,6 +53,7 @@ #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp> #include <com/sun/star/sdb/SQLContext.hpp> #include <com/sun/star/sdbc/XDriverManager.hpp> +#include <com/sun/star/sdbc/ConnectionPool.hpp> #include <comphelper/componentcontext.hxx> #include <comphelper/interaction.hxx> @@ -127,6 +128,7 @@ namespace dbaui using ::com::sun::star::sdbc::XResultSetMetaData; using ::com::sun::star::sdbc::SQLException; using ::com::sun::star::sdb::SQLContext; + using ::com::sun::star::sdbc::ConnectionPool; using ::com::sun::star::sdbc::XDriverManager; using ::com::sun::star::beans::PropertyValue; /** === end UNO using === **/ @@ -952,7 +954,9 @@ SharedConnection CopyTableWizard::impl_extractConnection_throw( const Reference< OSL_VERIFY( _rxDataSourceDescriptor->getPropertyValue( PROPERTY_CONNECTION_INFO ) >>= aConnectionInfo ); Reference< XDriverManager > xDriverManager; - xDriverManager.set( m_aContext.createComponent( "com.sun.star.sdbc.ConnectionPool" ), UNO_QUERY ); + try { + xDriverManager.set( ConnectionPool::create( m_aContext.getUNOContext() ) ); + } catch( const Exception& ) { } if ( !xDriverManager.is() ) // no connection pool installed xDriverManager.set( m_aContext.createComponent( "com.sun.star.sdbc.DriverManager" ), UNO_QUERY_THROW ); |