Tag: cws_src680_dba24d User: fs Date: 2007-12-01 20:57:58+0000 Modified: dba/connectivity/source/drivers/jdbc/JConnection.cxx
Log: #i10000# File Changes: Directory: /dba/connectivity/source/drivers/jdbc/ ================================================= File [changed]: JConnection.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/jdbc/JConnection.cxx?r1=1.6.18.6&r2=1.6.18.7 Delta lines: +19 -15 --------------------- --- JConnection.cxx 2007-12-01 13:36:36+0000 1.6.18.6 +++ JConnection.cxx 2007-12-01 20:57:56+0000 1.6.18.7 @@ -4,9 +4,9 @@ * * $RCSfile: JConnection.cxx,v $ * - * $Revision: 1.6.18.6 $ + * $Revision: 1.6.18.7 $ * - * last change: $Author: fs $ $Date: 2007/12/01 13:36:36 $ + * last change: $Author: fs $ $Date: 2007/12/01 20:57:56 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -82,7 +82,7 @@ #include "resource/jdbc_log.hrc" #include "com/sun/star/uno/XComponentContext.hpp" #include "jvmaccess/classpath.hxx" -#include <comphelper/sequenceashashmap.hxx> +#include <comphelper/namedvaluecollection.hxx> #include <rtl/ustrbuf.hxx> #include <jni.h> @@ -970,7 +970,8 @@ } // ----------------------------------------------------------------------------- -void java_sql_Connection::loadDriverFromProperties(const ::rtl::OUString& _sDriverClass,const ::rtl::OUString& _sDriverClassPath) +void java_sql_Connection::loadDriverFromProperties( const ::rtl::OUString& _sDriverClass, const ::rtl::OUString& _sDriverClassPath, + const Sequence< NamedValue >& _rSystemProperties ) { // contains the statement which should be used when query for automatically generated values ::rtl::OUString sGeneratedValueStatement; @@ -983,7 +984,7 @@ { if ( !object ) { - if ( !lcl_setSystemProperties_nothrow( getLogger(), *t.pEnv, aSystemProperties ) ) + if ( !lcl_setSystemProperties_nothrow( getLogger(), *t.pEnv, _rSystemProperties ) ) ThrowLoggedSQLException( getLogger(), t.pEnv, *this ); m_pDriverClassLoader.reset(); @@ -1082,17 +1083,20 @@ ::rtl::OUString sGeneratedValueStatement; // contains the statement which should be used when query for automatically generated values sal_Bool bAutoRetrievingEnabled = sal_False; // set to <TRUE/> when we should allow to query for generated values - ::comphelper::SequenceAsHashMap aMap(info); ::rtl::OUString sDriverClassPath,sDriverClass; - sDriverClass = aMap.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("JavaDriverClass")),sDriverClass); - sDriverClassPath = aMap.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("JavaDriverClassPath")),sDriverClassPath); - bAutoRetrievingEnabled = aMap.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsAutoRetrievingEnabled")),bAutoRetrievingEnabled); - sGeneratedValueStatement = aMap.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AutoRetrievingStatement")),sGeneratedValueStatement); - m_bParameterSubstitution = aMap.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParameterNameSubstitution")),m_bParameterSubstitution); - m_bIgnoreDriverPrivileges = aMap.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IgnoreDriverPrivileges")),m_bIgnoreDriverPrivileges); - m_bIgnoreCurrency = aMap.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IgnoreCurrency")),m_bIgnoreCurrency); + Sequence< NamedValue > aSystemProperties; - loadDriverFromProperties(sDriverClass,sDriverClassPath); + ::comphelper::NamedValueCollection aSettings( info ); + sDriverClass = aSettings.getOrDefault( "JavaDriverClass", sDriverClass ); + sDriverClassPath = aSettings.getOrDefault( "JavaDriverClassPath", sDriverClassPath); + bAutoRetrievingEnabled = aSettings.getOrDefault( "IsAutoRetrievingEnabled", bAutoRetrievingEnabled ); + sGeneratedValueStatement = aSettings.getOrDefault( "AutoRetrievingStatement", sGeneratedValueStatement ); + m_bParameterSubstitution = aSettings.getOrDefault( "ParameterNameSubstitution", m_bParameterSubstitution ); + m_bIgnoreDriverPrivileges = aSettings.getOrDefault( "IgnoreDriverPrivileges", m_bIgnoreDriverPrivileges ); + m_bIgnoreCurrency = aSettings.getOrDefault( "IgnoreCurrency", m_bIgnoreCurrency ); + aSystemProperties = aSettings.getOrDefault( "SystemProperties", aSystemProperties ); + + loadDriverFromProperties( sDriverClass, sDriverClassPath, aSystemProperties ); enableAutoRetrievingEnabled(bAutoRetrievingEnabled); setAutoRetrievingStatement(sGeneratedValueStatement); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
