diff options
Diffstat (limited to 'connectivity/source')
-rwxr-xr-x | connectivity/source/commontools/DriversConfig.cxx | 62 | ||||
-rw-r--r-- | connectivity/source/commontools/dbmetadata.cxx | 16 | ||||
-rwxr-xr-x | connectivity/source/drivers/jdbc/jdbc.xcu | 2 |
3 files changed, 51 insertions, 29 deletions
diff --git a/connectivity/source/commontools/DriversConfig.cxx b/connectivity/source/commontools/DriversConfig.cxx index b9b771af64..b4cee320dc 100755 --- a/connectivity/source/commontools/DriversConfig.cxx +++ b/connectivity/source/commontools/DriversConfig.cxx @@ -108,36 +108,39 @@ namespace } } // ----------------------------------------------------------------------------- -DriversConfigImpl::DriversConfigImpl() +DriversConfigImpl::DriversConfigImpl() { } // ----------------------------------------------------------------------------- -void DriversConfigImpl::Load(const uno::Reference< lang::XMultiServiceFactory >& _rxORB,TInstalledDrivers& _rDrivers) +void DriversConfigImpl::Load(const uno::Reference< lang::XMultiServiceFactory >& _rxORB) const { - if ( !m_aInstalled.isValid() ) + if ( m_aDrivers.empty() ) { - static const ::rtl::OUString s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.DataAccess.Drivers/Installed")); ///Installed - m_aInstalled = ::utl::OConfigurationTreeRoot::createWithServiceFactory(_rxORB, s_sNodeName, -1, ::utl::OConfigurationTreeRoot::CM_READONLY); - } - - if ( m_aInstalled.isValid() ) - { - const uno::Sequence< ::rtl::OUString > aURLPatterns = m_aInstalled.getNodeNames(); - const ::rtl::OUString* pPatternIter = aURLPatterns.getConstArray(); - const ::rtl::OUString* pPatternEnd = pPatternIter + aURLPatterns.getLength(); - for (;pPatternIter != pPatternEnd ; ++pPatternIter) + if ( !m_aInstalled.isValid() ) { - TInstalledDriver aInstalledDriver; - lcl_readURLPatternNode(m_aInstalled,*pPatternIter,aInstalledDriver); - if ( aInstalledDriver.sDriverFactory.getLength() ) - _rDrivers.insert(TInstalledDrivers::value_type(*pPatternIter,aInstalledDriver)); + static const ::rtl::OUString s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.DataAccess.Drivers/Installed")); ///Installed + m_aInstalled = ::utl::OConfigurationTreeRoot::createWithServiceFactory(_rxORB, s_sNodeName, -1, ::utl::OConfigurationTreeRoot::CM_READONLY); } + + if ( m_aInstalled.isValid() ) + { + const uno::Sequence< ::rtl::OUString > aURLPatterns = m_aInstalled.getNodeNames(); + const ::rtl::OUString* pPatternIter = aURLPatterns.getConstArray(); + const ::rtl::OUString* pPatternEnd = pPatternIter + aURLPatterns.getLength(); + for (;pPatternIter != pPatternEnd ; ++pPatternIter) + { + TInstalledDriver aInstalledDriver; + lcl_readURLPatternNode(m_aInstalled,*pPatternIter,aInstalledDriver); + if ( aInstalledDriver.sDriverFactory.getLength() ) + m_aDrivers.insert(TInstalledDrivers::value_type(*pPatternIter,aInstalledDriver)); + } + } // if ( m_aInstalled.isValid() ) } } // ----------------------------------------------------------------------------- DriversConfig::DriversConfig(const uno::Reference< lang::XMultiServiceFactory >& _rxORB) +:m_xORB(_rxORB) { - m_aNode->Load(_rxORB,m_aDrivers); } // ----------------------------------------------------------------------------- @@ -156,7 +159,6 @@ DriversConfig& DriversConfig::operator=( const DriversConfig& _rhs ) {
if ( this != &_rhs )
{
- m_aDrivers = _rhs.m_aDrivers;
m_aNode = _rhs.m_aNode;
}
return *this;
@@ -165,10 +167,11 @@ DriversConfig& DriversConfig::operator=( const DriversConfig& _rhs ) // ----------------------------------------------------------------------------- ::rtl::OUString DriversConfig::getDriverFactoryName(const ::rtl::OUString& _sURL) const { + const TInstalledDrivers& rDrivers = m_aNode->getInstalledDrivers(m_xORB); ::rtl::OUString sRet; ::rtl::OUString sOldPattern; - TInstalledDrivers::const_iterator aIter = m_aDrivers.begin(); - TInstalledDrivers::const_iterator aEnd = m_aDrivers.end(); + TInstalledDrivers::const_iterator aIter = rDrivers.begin(); + TInstalledDrivers::const_iterator aEnd = rDrivers.end(); for(;aIter != aEnd;++aIter) { WildCard aWildCard(aIter->first); @@ -184,10 +187,11 @@ DriversConfig& DriversConfig::operator=( const DriversConfig& _rhs ) // ----------------------------------------------------------------------------- ::rtl::OUString DriversConfig::getDriverTypeDisplayName(const ::rtl::OUString& _sURL) const { + const TInstalledDrivers& rDrivers = m_aNode->getInstalledDrivers(m_xORB); ::rtl::OUString sRet; ::rtl::OUString sOldPattern; - TInstalledDrivers::const_iterator aIter = m_aDrivers.begin(); - TInstalledDrivers::const_iterator aEnd = m_aDrivers.end(); + TInstalledDrivers::const_iterator aIter = rDrivers.begin(); + TInstalledDrivers::const_iterator aEnd = rDrivers.end(); for(;aIter != aEnd;++aIter) { WildCard aWildCard(aIter->first); @@ -218,10 +222,11 @@ const ::comphelper::NamedValueCollection& DriversConfig::getMetaData(const ::rtl // ----------------------------------------------------------------------------- const ::comphelper::NamedValueCollection& DriversConfig::impl_get(const ::rtl::OUString& _sURL,sal_Int32 _nProps) const { + const TInstalledDrivers& rDrivers = m_aNode->getInstalledDrivers(m_xORB); const ::comphelper::NamedValueCollection* pRet = NULL; ::rtl::OUString sOldPattern; - TInstalledDrivers::const_iterator aIter = m_aDrivers.begin(); - TInstalledDrivers::const_iterator aEnd = m_aDrivers.end(); + TInstalledDrivers::const_iterator aIter = rDrivers.begin(); + TInstalledDrivers::const_iterator aEnd = rDrivers.end(); for(;aIter != aEnd;++aIter) { WildCard aWildCard(aIter->first); @@ -252,10 +257,11 @@ const ::comphelper::NamedValueCollection& DriversConfig::impl_get(const ::rtl::O // ----------------------------------------------------------------------------- uno::Sequence< ::rtl::OUString > DriversConfig::getURLs() const { - uno::Sequence< ::rtl::OUString > aRet(m_aDrivers.size()); + const TInstalledDrivers& rDrivers = m_aNode->getInstalledDrivers(m_xORB); + uno::Sequence< ::rtl::OUString > aRet(rDrivers.size()); ::rtl::OUString* pIter = aRet.getArray(); - TInstalledDrivers::const_iterator aIter = m_aDrivers.begin(); - TInstalledDrivers::const_iterator aEnd = m_aDrivers.end(); + TInstalledDrivers::const_iterator aIter = rDrivers.begin(); + TInstalledDrivers::const_iterator aEnd = rDrivers.end(); for(;aIter != aEnd;++aIter,++pIter) { *pIter = aIter->first; diff --git a/connectivity/source/commontools/dbmetadata.cxx b/connectivity/source/commontools/dbmetadata.cxx index 0463b5106f..5e07514624 100644 --- a/connectivity/source/commontools/dbmetadata.cxx +++ b/connectivity/source/commontools/dbmetadata.cxx @@ -407,6 +407,22 @@ namespace dbtools #endif return doDisplay; } + //-------------------------------------------------------------------- + bool DatabaseMetaData::supportsThreads() const + { + bool bSupported( true ); + try + { + Reference< XDatabaseMetaData > xMeta( m_pImpl->xConnectionMetaData, UNO_SET_THROW ); + ::rtl::OUString sConnectionURL( xMeta->getURL() ); + bSupported = sConnectionURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "sdbc:mysql:mysqlc" ) ) != 0; + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + return bSupported; + } //........................................................................ } // namespace dbtools diff --git a/connectivity/source/drivers/jdbc/jdbc.xcu b/connectivity/source/drivers/jdbc/jdbc.xcu index c758a79bd0..7a64519e48 100755 --- a/connectivity/source/drivers/jdbc/jdbc.xcu +++ b/connectivity/source/drivers/jdbc/jdbc.xcu @@ -174,7 +174,7 @@ <node oor:name="Properties"> <node oor:name="IgnoreCurrency" oor:op="replace"> <prop oor:name="Value" oor:type="xs:boolean"> - <value>false</value> + <value>true</value> </prop> </node> <node oor:name="TypeInfoSettings" oor:op="replace"> |