diff options
author | Oliver Bolte <obo@openoffice.org> | 2009-02-17 15:39:54 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2009-02-17 15:39:54 +0000 |
commit | 2ae3df202e5864bb9beb2e01a88be554b9c897f5 (patch) | |
tree | 7d79cfcac41b570a80f93bbf12cfce651fc90dc9 /connectivity/source | |
parent | df0dd23be65a9c1c43be151d243ab95fd76c836b (diff) |
CWS-TOOLING: integrate CWS dba31h
2009-01-29 10:47:07 +0100 oj r267102 : decl OpCodeMap as friend
2009-01-26 09:41:21 +0100 fs r266905 : #i97137#
2009-01-26 09:10:39 +0100 fs r266903 : #i10000
2009-01-26 09:00:17 +0100 fs r266901 : re-enable user admin for MySQL native
2009-01-23 21:56:08 +0100 fs r266851 : #i97137#
2009-01-23 21:32:40 +0100 fs r266850 : #i97042#
2009-01-23 11:23:59 +0100 msc r266800 : #i98387#
2009-01-23 11:17:05 +0100 msc r266798 : #i98387#
2009-01-23 10:56:33 +0100 fs r266795 : for the moment, disable user administration for MySQL native
2009-01-21 15:08:54 +0100 fs r266672 : removed some advanced settings for MySQL native - letting the user control them does not make sense for this particular type
2009-01-21 13:55:13 +0100 oj r266668 : #i98317# wrong var set
2009-01-21 13:41:22 +0100 fs r266664 : #i98315#
2009-01-21 13:13:09 +0100 oj r266661 : #i97032# enable locking for OOo
2009-01-21 13:11:26 +0100 oj r266660 : #i97032# enable locking for OOo
2009-01-21 10:10:50 +0100 oj r266634 : #i98174# merge conflict resolved
2009-01-21 08:48:58 +0100 fs r266628 : CWS-TOOLING: rebase CWS dba31h to trunk@266428 (milestone: DEV300:m39)
2009-01-20 12:54:32 +0100 fs r266570 : #i98277#
2009-01-19 10:46:31 +0100 fs r266480 : #i97995#
2009-01-19 08:42:09 +0100 fs r266470 : #i97042# provided my mod@openoffice.org: support more SQL comment styles
2009-01-19 07:55:43 +0100 oj r266468 : #i98115# check function name as well
2009-01-16 10:21:28 +0100 oj r266404 : #i97861# remove invalid assertion
2009-01-16 10:18:31 +0100 oj r266403 : #i97861# ini var with false
2009-01-15 14:09:50 +0100 oj r266371 : #i97810# saveas fix
2009-01-15 11:54:18 +0100 oj r266360 : remove : from mysql
2009-01-15 11:07:46 +0100 oj r266355 : insert JNI fixes for method names
2009-01-15 10:54:44 +0100 oj r266351 : fix for parameter subst
2009-01-14 14:41:34 +0100 oj r266308 : parameter subst
2009-01-14 14:40:20 +0100 oj r266307 : add missing try catch
2009-01-14 14:38:34 +0100 oj r266306 : new service for parameter subst
2009-01-14 14:37:52 +0100 oj r266305 : missing types for hyper
2009-01-09 15:28:36 +0100 fs r266090 : #i97889#
2009-01-09 14:16:15 +0100 fs r266082 : #i97892# provided by npower: when reading the xlink:href attrib, use the graphic resolver only if appropriate
2009-01-08 21:31:21 +0100 fs r266041 : #i97346#
2009-01-08 14:51:56 +0100 fs r266012 : #i97871# showPreviewFor: bail out if preview is disabled
Diffstat (limited to 'connectivity/source')
-rw-r--r-- | connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx | 66 | ||||
-rw-r--r-- | connectivity/source/commontools/FValue.cxx | 15 | ||||
-rw-r--r-- | connectivity/source/commontools/ParamterSubstitution.cxx | 135 | ||||
-rw-r--r-- | connectivity/source/commontools/dbmetadata.cxx | 8 | ||||
-rw-r--r-- | connectivity/source/commontools/makefile.mk | 1 | ||||
-rw-r--r-- | connectivity/source/drivers/jdbc/CallableStatement.cxx | 40 | ||||
-rw-r--r-- | connectivity/source/drivers/jdbc/DatabaseMetaData.cxx | 4 | ||||
-rw-r--r-- | connectivity/source/drivers/jdbc/JStatement.cxx | 59 | ||||
-rw-r--r-- | connectivity/source/drivers/jdbc/PreparedStatement.cxx | 61 | ||||
-rw-r--r-- | connectivity/source/drivers/jdbc/ResultSet.cxx | 5 | ||||
-rw-r--r-- | connectivity/source/inc/ParameterSubstitution.hxx | 74 | ||||
-rw-r--r-- | connectivity/source/inc/TSkipDeletedSet.hxx | 4 |
12 files changed, 414 insertions, 58 deletions
diff --git a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx index c8c14200d901..9c3acfb606d5 100644 --- a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx +++ b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx @@ -31,7 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_connectivity.hxx" - +#include "ParameterSubstitution.hxx" #include "FDatabaseMetaDataResultSet.hxx" #include "FDatabaseMetaDataResultSetMetaData.hxx" #include <com/sun/star/sdbc/DataType.hpp> @@ -48,6 +48,7 @@ #include <cppuhelper/typeprovider.hxx> #include <comphelper/sequence.hxx> #include <cppuhelper/factory.hxx> +#include <cppuhelper/implementationentry.hxx> #include "connectivity/dbexception.hxx" #include "TConnection.hxx" @@ -864,14 +865,23 @@ void SAL_CALL ODatabaseMetaDataResultSet::initialize( const Sequence< Any >& _aA // ------------------------------------------------------------------------- namespace connectivity { - Reference< XInterface > SAL_CALL ODatabaseMetaDataResultSet_CreateInstance(const Reference< XMultiServiceFactory >& ) throw( Exception ) + Reference< XInterface > SAL_CALL ODatabaseMetaDataResultSet_CreateInstance(const Reference< XComponentContext >& ) throw( Exception ) { return *(new ODatabaseMetaDataResultSet()); } } // ----------------------------------------------------------------------------- - +namespace +{ + cppu::ImplementationEntry entries[] = { + { &ODatabaseMetaDataResultSet_CreateInstance, &ODatabaseMetaDataResultSet::getImplementationName_Static, &ODatabaseMetaDataResultSet::getSupportedServiceNames_Static, + &cppu::createSingleComponentFactory, 0, 0 }, + { &ParameterSubstitution::create, &ParameterSubstitution::getImplementationName_Static, &ParameterSubstitution::getSupportedServiceNames_Static, + &cppu::createSingleComponentFactory, 0, 0 }, + { 0, 0, 0, 0, 0, 0 } + }; +} using ::rtl::OUString; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; @@ -893,56 +903,14 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const } //--------------------------------------------------------------------------------------- -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(void* /*_pServiceManager*/, com::sun::star::registry::XRegistryKey* _pRegistryKey) +SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(void* serviceManager, com::sun::star::registry::XRegistryKey* registryKey) { - ::rtl::OUString sMainKeyName = ::rtl::OUString::createFromAscii("/"); - sMainKeyName += ODatabaseMetaDataResultSet::getImplementationName_Static(); - sMainKeyName += ::rtl::OUString::createFromAscii("/UNO/SERVICES"); - - try - { - Reference< XRegistryKey > xMainKey = _pRegistryKey->createKey(sMainKeyName); - if (!xMainKey.is()) - return sal_False; - - Sequence< ::rtl::OUString > sServices = ODatabaseMetaDataResultSet::getSupportedServiceNames_Static(); - const ::rtl::OUString* pServices = sServices.getConstArray(); - for (sal_Int32 i=0; i<sServices.getLength(); ++i, ++pServices) - xMainKey->createKey(*pServices); - } - catch(InvalidRegistryException&) - { - return sal_False; - } - catch(InvalidValueException&) - { - return sal_False; - } - return sal_True; + return cppu::component_writeInfoHelper(serviceManager, registryKey, entries); } //--------------------------------------------------------------------------------------- -SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(const sal_Char* _pImplName, ::com::sun::star::lang::XMultiServiceFactory* _pServiceManager, void* /*_pRegistryKey*/) +SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(const sal_Char* implName, ::com::sun::star::lang::XMultiServiceFactory* serviceManager, void* registryKey) { - void* pRet = NULL; - - if (ODatabaseMetaDataResultSet::getImplementationName_Static().compareToAscii(_pImplName) == 0) - { - Reference< XSingleServiceFactory > xFactory( - ::cppu::createSingleFactory( - _pServiceManager, - ODatabaseMetaDataResultSet::getImplementationName_Static(), - ODatabaseMetaDataResultSet_CreateInstance, - ODatabaseMetaDataResultSet::getSupportedServiceNames_Static(),0 - ) - ); - if (xFactory.is()) - { - xFactory->acquire(); - pRet = xFactory.get(); - } - } - - return pRet; + return cppu::component_getFactoryHelper(implName, serviceManager, registryKey, entries); } } // extern "C" diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx index 2823c2b43489..ffd67f9ef0fa 100644 --- a/connectivity/source/commontools/FValue.cxx +++ b/connectivity/source/commontools/FValue.cxx @@ -1939,6 +1939,21 @@ void ORowSetValue::fill(const Any& _rValue) setSigned(sal_False); break; } + case TypeClass_HYPER:
+ {
+ sal_Int64 nValue(0);
+ _rValue >>= nValue;
+ (*this) = nValue;
+ break;
+ }
+ case TypeClass_UNSIGNED_HYPER:
+ {
+ sal_uInt64 nValue(0);
+ _rValue >>= nValue;
+ (*this) = static_cast<sal_Int64>(nValue);
+ setSigned(sal_False);
+ break;
+ } case TypeClass_UNSIGNED_LONG: { sal_uInt32 nValue(0); diff --git a/connectivity/source/commontools/ParamterSubstitution.cxx b/connectivity/source/commontools/ParamterSubstitution.cxx new file mode 100644 index 000000000000..7289cd7ec725 --- /dev/null +++ b/connectivity/source/commontools/ParamterSubstitution.cxx @@ -0,0 +1,135 @@ +/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FDatabaseMetaDataResultSet.cxx,v $
+ * $Revision: 1.24 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_connectivity.hxx"
+#include "ParameterSubstitution.hxx"
+#include "connectivity/sqlparse.hxx"
+#include <comphelper/sequenceashashmap.hxx>
+
+namespace connectivity
+{
+ using namespace ::com::sun::star::uno;
+ using namespace ::com::sun::star::sdbc;
+ using namespace ::com::sun::star::lang;
+ using namespace ::com::sun::star;
+
+ ParameterSubstitution::ParameterSubstitution(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext ) : m_xContext(_rxContext)
+ {
+ }
+ void SAL_CALL ParameterSubstitution::initialize( const uno::Sequence< uno::Any >& _aArguments ) throw (uno::Exception, uno::RuntimeException)
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ comphelper::SequenceAsHashMap aArgs(_aArguments);
+ uno::Reference< sdbc::XConnection > xConnection;
+ xConnection = aArgs.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ActiveConnection")),xConnection);
+ m_xConnection = xConnection;
+ }
+ //------------------------------------------------------------------------------
+ rtl::OUString ParameterSubstitution::getImplementationName_Static( ) throw(RuntimeException)
+ {
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.helper.ParameterSubstitution"));
+ }
+ //------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL ParameterSubstitution::getImplementationName( ) throw(RuntimeException) + { + return getImplementationName_Static(); + } + //------------------------------------------------------------------ + sal_Bool SAL_CALL ParameterSubstitution::supportsService( const ::rtl::OUString& _rServiceName ) throw(RuntimeException) + { + Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames()); + const ::rtl::OUString* pSupported = aSupported.getConstArray(); + const ::rtl::OUString* pEnd = pSupported + aSupported.getLength(); + for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) + ; + + return pSupported != pEnd; + } + //------------------------------------------------------------------ + Sequence< ::rtl::OUString > SAL_CALL ParameterSubstitution::getSupportedServiceNames( ) throw(RuntimeException) + { + return getSupportedServiceNames_Static(); + }
+ //------------------------------------------------------------------
+ Sequence< ::rtl::OUString > ParameterSubstitution::getSupportedServiceNames_Static( ) throw (RuntimeException)
+ {
+ Sequence< ::rtl::OUString > aSNS( 1 );
+ aSNS[0] = ::rtl::OUString::createFromAscii("com.sun.star.sdb.ParameterSubstitution");
+ return aSNS;
+ }
+
+ //------------------------------------------------------------------
+ Reference< XInterface > ParameterSubstitution::create(const Reference< XComponentContext >& _xContext)
+ {
+ return *(new ParameterSubstitution(_xContext));
+ }
+ //------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL ParameterSubstitution::substituteVariables( const ::rtl::OUString& _sText, ::sal_Bool /*bSubstRequired*/ ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException)
+ {
+ ::rtl::OUString sRet = _sText;
+ uno::Reference< sdbc::XConnection > xConnection = m_xConnection;
+ if ( xConnection.is() )
+ {
+ try
+ {
+ uno::Reference< XMultiServiceFactory> xFac(m_xContext->getServiceManager(),uno::UNO_QUERY_THROW);
+ OSQLParser aParser( xFac );
+ ::rtl::OUString sErrorMessage;
+ ::rtl::OUString sNewSql;
+ OSQLParseNode* pNode = aParser.parseTree(sErrorMessage,_sText);
+ if(pNode)
+ { // special handling for parameters
+ OSQLParseNode::substituteParameterNames(pNode);
+ pNode->parseNodeToStr( sNewSql, xConnection );
+ delete pNode;
+ sRet = sNewSql;
+ }
+ }
+ catch(const Exception&)
+ {
+ }
+ }
+ return sRet;
+ }
+ //------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL ParameterSubstitution::reSubstituteVariables( const ::rtl::OUString& _sText ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ return _sText;
+ }
+ //------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL ParameterSubstitution::getSubstituteVariableValue( const ::rtl::OUString& /*variable*/ ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException)
+ {
+ throw container::NoSuchElementException();
+ }
+ //------------------------------------------------------------------
+
+
+// ==================================
+} // connectivity
+// ==================================
diff --git a/connectivity/source/commontools/dbmetadata.cxx b/connectivity/source/commontools/dbmetadata.cxx index 2df96597fb94..0cc19b61e72d 100644 --- a/connectivity/source/commontools/dbmetadata.cxx +++ b/connectivity/source/commontools/dbmetadata.cxx @@ -287,10 +287,16 @@ namespace dbtools try { bSupport = m_pImpl->xConnectionMetaData->supportsIntegrityEnhancementFacility(); + } + catch( const Exception& ) + { + } + try + { if ( !bSupport ) { const ::rtl::OUString url = m_pImpl->xConnectionMetaData->getURL(); - char pMySQL[] = "sdbc:mysql:"; + char pMySQL[] = "sdbc:mysql"; bSupport = url.matchAsciiL(pMySQL,(sizeof(pMySQL)/sizeof(pMySQL[0]))-1); } } diff --git a/connectivity/source/commontools/makefile.mk b/connectivity/source/commontools/makefile.mk index 814f75a3a0c7..5b8287f6c826 100644 --- a/connectivity/source/commontools/makefile.mk +++ b/connectivity/source/commontools/makefile.mk @@ -84,6 +84,7 @@ EXCEPTIONSFILES=\ $(SLO)$/sqlerror.obj \ $(SLO)$/filtermanager.obj \ $(SLO)$/parameters.obj \ + $(SLO)$/ParamterSubstitution.obj \ $(SLO)$/formattedcolumnvalue.obj SLOFILES=\ diff --git a/connectivity/source/drivers/jdbc/CallableStatement.cxx b/connectivity/source/drivers/jdbc/CallableStatement.cxx index 974baa92ab41..921ba6704105 100644 --- a/connectivity/source/drivers/jdbc/CallableStatement.cxx +++ b/connectivity/source/drivers/jdbc/CallableStatement.cxx @@ -83,6 +83,8 @@ Any SAL_CALL java_sql_CallableStatement::queryInterface( const Type & rType ) th // ------------------------------------------------------------------------- sal_Bool SAL_CALL java_sql_CallableStatement::wasNull( ) throw(starsdbc::SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ) @@ -106,6 +108,8 @@ sal_Bool SAL_CALL java_sql_CallableStatement::wasNull( ) throw(starsdbc::SQLExc sal_Bool SAL_CALL java_sql_CallableStatement::getBoolean( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ) @@ -129,6 +133,8 @@ sal_Bool SAL_CALL java_sql_CallableStatement::getBoolean( sal_Int32 columnIndex } sal_Int8 SAL_CALL java_sql_CallableStatement::getByte( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jbyte out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ) @@ -152,6 +158,8 @@ sal_Int8 SAL_CALL java_sql_CallableStatement::getByte( sal_Int32 columnIndex ) t } Sequence< sal_Int8 > SAL_CALL java_sql_CallableStatement::getBytes( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); Sequence< sal_Int8 > aSeq; SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); @@ -182,6 +190,8 @@ Sequence< sal_Int8 > SAL_CALL java_sql_CallableStatement::getBytes( sal_Int32 co } ::com::sun::star::util::Date SAL_CALL java_sql_CallableStatement::getDate( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ) @@ -206,6 +216,8 @@ Sequence< sal_Int8 > SAL_CALL java_sql_CallableStatement::getBytes( sal_Int32 co } double SAL_CALL java_sql_CallableStatement::getDouble( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jdouble out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ) @@ -229,6 +241,8 @@ double SAL_CALL java_sql_CallableStatement::getDouble( sal_Int32 columnIndex ) t float SAL_CALL java_sql_CallableStatement::getFloat( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jfloat out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ) @@ -253,6 +267,8 @@ float SAL_CALL java_sql_CallableStatement::getFloat( sal_Int32 columnIndex ) thr sal_Int32 SAL_CALL java_sql_CallableStatement::getInt( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jint out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ) @@ -277,6 +293,8 @@ sal_Int32 SAL_CALL java_sql_CallableStatement::getInt( sal_Int32 columnIndex ) t sal_Int64 SAL_CALL java_sql_CallableStatement::getLong( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jlong out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -299,6 +317,8 @@ sal_Int64 SAL_CALL java_sql_CallableStatement::getLong( sal_Int32 columnIndex ) Any SAL_CALL java_sql_CallableStatement::getObject( sal_Int32 columnIndex, const Reference< ::com::sun::star::container::XNameAccess >& /*typeMap*/ ) throw(starsdbc::SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -322,6 +342,8 @@ Any SAL_CALL java_sql_CallableStatement::getObject( sal_Int32 columnIndex, const sal_Int16 SAL_CALL java_sql_CallableStatement::getShort( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jshort out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -344,6 +366,8 @@ sal_Int16 SAL_CALL java_sql_CallableStatement::getShort( sal_Int32 columnIndex ) ::rtl::OUString SAL_CALL java_sql_CallableStatement::getString( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); ::rtl::OUString aStr; if( t.pEnv ){ @@ -368,6 +392,8 @@ sal_Int16 SAL_CALL java_sql_CallableStatement::getShort( sal_Int32 columnIndex ) ::com::sun::star::util::Time SAL_CALL java_sql_CallableStatement::getTime( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ) @@ -392,6 +418,8 @@ sal_Int16 SAL_CALL java_sql_CallableStatement::getShort( sal_Int32 columnIndex ) ::com::sun::star::util::DateTime SAL_CALL java_sql_CallableStatement::getTimestamp( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -415,6 +443,8 @@ sal_Int16 SAL_CALL java_sql_CallableStatement::getShort( sal_Int32 columnIndex ) void SAL_CALL java_sql_CallableStatement::registerOutParameter( sal_Int32 parameterIndex, sal_Int32 sqlType, const ::rtl::OUString& typeName ) throw(starsdbc::SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ) { @@ -439,6 +469,8 @@ void SAL_CALL java_sql_CallableStatement::registerOutParameter( sal_Int32 parame } void SAL_CALL java_sql_CallableStatement::registerNumericOutParameter( sal_Int32 parameterIndex, sal_Int32 sqlType, sal_Int32 scale ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ) { @@ -495,6 +527,8 @@ Reference< ::com::sun::star::io::XInputStream > SAL_CALL java_sql_CallableStatem Reference< starsdbc::XArray > SAL_CALL java_sql_CallableStatement::getArray( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -518,6 +552,8 @@ Reference< starsdbc::XArray > SAL_CALL java_sql_CallableStatement::getArray( sal Reference< starsdbc::XClob > SAL_CALL java_sql_CallableStatement::getClob( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -540,6 +576,8 @@ Reference< starsdbc::XClob > SAL_CALL java_sql_CallableStatement::getClob( sal_I } Reference< starsdbc::XBlob > SAL_CALL java_sql_CallableStatement::getBlob( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -563,6 +601,8 @@ Reference< starsdbc::XBlob > SAL_CALL java_sql_CallableStatement::getBlob( sal_I Reference< starsdbc::XRef > SAL_CALL java_sql_CallableStatement::getRef( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ diff --git a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx index fff580ef7c38..5c5b9951e031 100644 --- a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx +++ b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx @@ -388,7 +388,7 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getBestRowIdentifier const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, sal_Int32 scope, sal_Bool nullable ) throw(SQLException, RuntimeException) { - static const char * cSignature = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/sql/ResultSet;"; + static const char * cSignature = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZ)Ljava/sql/ResultSet;"; static const char * cMethodName = "getBestRowIdentifier"; m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, cMethodName ); @@ -1540,7 +1540,7 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getUDTs( if( t.pEnv ){ - static const char * cSignature = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[I;)Ljava/sql/ResultSet;"; + static const char * cSignature = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[I)Ljava/sql/ResultSet;"; static const char * cMethodName = "getUDTs"; // Java-Call absetzen static jmethodID mID = NULL; diff --git a/connectivity/source/drivers/jdbc/JStatement.cxx b/connectivity/source/drivers/jdbc/JStatement.cxx index bd28a24200cf..5ff18bb2c130 100644 --- a/connectivity/source/drivers/jdbc/JStatement.cxx +++ b/connectivity/source/drivers/jdbc/JStatement.cxx @@ -185,6 +185,8 @@ Sequence< Type > SAL_CALL java_sql_Statement_Base::getTypes( ) throw(RuntimeExc Reference< XResultSet > SAL_CALL java_sql_Statement_Base::getGeneratedValues( ) throw (SQLException, RuntimeException) { m_aLogger.log( LogLevel::FINE, STR_LOG_GENERATED_VALUES ); + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); @@ -232,6 +234,8 @@ Reference< XResultSet > SAL_CALL java_sql_Statement_Base::getGeneratedValues( ) void SAL_CALL java_sql_Statement_Base::cancel( ) throw(RuntimeException) { SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); if( t.pEnv ){ createStatement(t.pEnv); @@ -285,9 +289,12 @@ void SAL_CALL java_sql_Statement::clearBatch( ) throw(::com::sun::star::sdbc::S sal_Bool SAL_CALL java_sql_Statement_Base::execute( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException) { m_aLogger.log( LogLevel::FINE, STR_LOG_EXECUTE_STATEMENT, sql ); + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); + if( t.pEnv ) { createStatement(t.pEnv); @@ -320,6 +327,8 @@ sal_Bool SAL_CALL java_sql_Statement_Base::execute( const ::rtl::OUString& sql ) Reference< XResultSet > SAL_CALL java_sql_Statement_Base::executeQuery( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); m_aLogger.log( LogLevel::FINE, STR_LOG_EXECUTE_QUERY, sql ); jobject out(0); @@ -356,6 +365,8 @@ Reference< XResultSet > SAL_CALL java_sql_Statement_Base::executeQuery( const :: // ------------------------------------------------------------------------- Reference< XConnection > SAL_CALL java_sql_Statement_Base::getConnection( ) throw(SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); return (Reference< XConnection >)m_pConnection; } // ------------------------------------------------------------------------- @@ -369,12 +380,14 @@ Any SAL_CALL java_sql_Statement::queryInterface( const Type & rType ) throw(Runt void SAL_CALL java_sql_Statement::addBatch( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ createStatement(t.pEnv); // temporaere Variable initialisieren - static const char * cSignature = "(Ljava/lang/String;)I"; + static const char * cSignature = "(Ljava/lang/String;)V"; static const char * cMethodName = "addBatch"; // Java-Call absetzen static jmethodID mID = NULL; @@ -394,6 +407,8 @@ void SAL_CALL java_sql_Statement::addBatch( const ::rtl::OUString& sql ) throw(: Sequence< sal_Int32 > SAL_CALL java_sql_Statement::executeBatch( ) throw(::com::sun::star::sdbc::SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); Sequence< sal_Int32 > aSeq; SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -424,6 +439,8 @@ Sequence< sal_Int32 > SAL_CALL java_sql_Statement::executeBatch( ) throw(::com: sal_Int32 SAL_CALL java_sql_Statement_Base::executeUpdate( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); m_aLogger.log( LogLevel::FINE, STR_LOG_EXECUTE_UPDATE, sql ); jint out(0); @@ -459,6 +476,8 @@ sal_Int32 SAL_CALL java_sql_Statement_Base::executeUpdate( const ::rtl::OUString Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL java_sql_Statement_Base::getResultSet( ) throw(::com::sun::star::sdbc::SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -483,6 +502,8 @@ Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL java_sql_Statement_Base sal_Int32 SAL_CALL java_sql_Statement_Base::getUpdateCount( ) throw(::com::sun::star::sdbc::SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jint out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -508,6 +529,8 @@ sal_Int32 SAL_CALL java_sql_Statement_Base::getUpdateCount( ) throw(::com::sun: sal_Bool SAL_CALL java_sql_Statement_Base::getMoreResults( ) throw(::com::sun::star::sdbc::SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ) @@ -532,6 +555,8 @@ sal_Bool SAL_CALL java_sql_Statement_Base::getMoreResults( ) throw(::com::sun:: // ------------------------------------------------------------------------- Any SAL_CALL java_sql_Statement_Base::getWarnings( ) throw(::com::sun::star::sdbc::SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jobject out(NULL); SDBThreadAttach t; if( t.pEnv ) @@ -563,6 +588,8 @@ Any SAL_CALL java_sql_Statement_Base::getWarnings( ) throw(::com::sun::star::sd // ------------------------------------------------------------------------- void SAL_CALL java_sql_Statement_Base::clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; if( t.pEnv ) { @@ -583,6 +610,8 @@ void SAL_CALL java_sql_Statement_Base::clearWarnings( ) throw(::com::sun::star: //------------------------------------------------------------------------------ sal_Int32 java_sql_Statement_Base::getQueryTimeOut() throw(SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jint out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -605,6 +634,8 @@ sal_Int32 java_sql_Statement_Base::getQueryTimeOut() throw(SQLException, Runtim //------------------------------------------------------------------------------ sal_Int32 java_sql_Statement_Base::getMaxRows() throw(SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jint out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -627,6 +658,8 @@ sal_Int32 java_sql_Statement_Base::getMaxRows() throw(SQLException, RuntimeExcep //------------------------------------------------------------------------------ sal_Int32 java_sql_Statement_Base::getResultSetConcurrency() throw(SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jint out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv && object ){ @@ -651,6 +684,8 @@ sal_Int32 java_sql_Statement_Base::getResultSetConcurrency() throw(SQLException, //------------------------------------------------------------------------------ sal_Int32 java_sql_Statement_Base::getResultSetType() throw(SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jint out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv && object ){ @@ -674,6 +709,8 @@ sal_Int32 java_sql_Statement_Base::getResultSetType() throw(SQLException, Runtim //------------------------------------------------------------------------------ sal_Int32 java_sql_Statement_Base::getFetchDirection() throw(SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jint out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -696,6 +733,8 @@ sal_Int32 java_sql_Statement_Base::getFetchDirection() throw(SQLException, Runti //------------------------------------------------------------------------------ sal_Int32 java_sql_Statement_Base::getFetchSize() throw(SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jint out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -718,6 +757,8 @@ sal_Int32 java_sql_Statement_Base::getFetchSize() throw(SQLException, RuntimeExc //------------------------------------------------------------------------------ sal_Int32 java_sql_Statement_Base::getMaxFieldSize() throw(SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jint out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -740,6 +781,8 @@ sal_Int32 java_sql_Statement_Base::getMaxFieldSize() throw(SQLException, Runtime //------------------------------------------------------------------------------ ::rtl::OUString java_sql_Statement_Base::getCursorName() throw(SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); ::rtl::OUString aStr; if( t.pEnv ) @@ -765,6 +808,8 @@ sal_Int32 java_sql_Statement_Base::getMaxFieldSize() throw(SQLException, Runtime //------------------------------------------------------------------------------ void java_sql_Statement_Base::setQueryTimeOut(sal_Int32 _par0) throw(SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ createStatement(t.pEnv); @@ -787,6 +832,8 @@ void java_sql_Statement_Base::setQueryTimeOut(sal_Int32 _par0) throw(SQLExceptio //------------------------------------------------------------------------------ void java_sql_Statement_Base::setEscapeProcessing(sal_Bool _par0) throw(SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); m_aLogger.log( LogLevel::FINE, STR_LOG_SET_ESCAPE_PROCESSING, _par0 ); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); @@ -810,6 +857,8 @@ void java_sql_Statement_Base::setEscapeProcessing(sal_Bool _par0) throw(SQLExcep //------------------------------------------------------------------------------ void java_sql_Statement_Base::setMaxRows(sal_Int32 _par0) throw(SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ createStatement(t.pEnv); @@ -866,6 +915,8 @@ void java_sql_Statement_Base::setResultSetType(sal_Int32 _par0) throw(SQLExcepti //------------------------------------------------------------------------------ void java_sql_Statement_Base::setFetchDirection(sal_Int32 _par0) throw(SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); m_aLogger.log( LogLevel::FINER, STR_LOG_FETCH_DIRECTION, (sal_Int32)_par0 ); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -888,6 +939,8 @@ void java_sql_Statement_Base::setFetchDirection(sal_Int32 _par0) throw(SQLExcept //------------------------------------------------------------------------------ void java_sql_Statement_Base::setFetchSize(sal_Int32 _par0) throw(SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); m_aLogger.log( LogLevel::FINER, STR_LOG_FETCH_SIZE, (sal_Int32)_par0 ); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); @@ -911,6 +964,8 @@ void java_sql_Statement_Base::setFetchSize(sal_Int32 _par0) throw(SQLException, //------------------------------------------------------------------------------ void java_sql_Statement_Base::setMaxFieldSize(sal_Int32 _par0) throw(SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ createStatement(t.pEnv); @@ -932,6 +987,8 @@ void java_sql_Statement_Base::setMaxFieldSize(sal_Int32 _par0) throw(SQLExceptio //------------------------------------------------------------------------------ void java_sql_Statement_Base::setCursorName(const ::rtl::OUString &_par0) throw(SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ createStatement(t.pEnv); diff --git a/connectivity/source/drivers/jdbc/PreparedStatement.cxx b/connectivity/source/drivers/jdbc/PreparedStatement.cxx index 2b11797f27da..281e29fd5919 100644 --- a/connectivity/source/drivers/jdbc/PreparedStatement.cxx +++ b/connectivity/source/drivers/jdbc/PreparedStatement.cxx @@ -40,6 +40,7 @@ #include <cppuhelper/typeprovider.hxx> #include <comphelper/sequence.hxx> #include "connectivity/dbtools.hxx" +#include "connectivity/FValue.hxx" #include "connectivity/dbexception.hxx" #include "resource/jdbc_log.hrc" #include "resource/common_res.hrc" @@ -123,6 +124,8 @@ void java_sql_PreparedStatement::saveClassRef( jclass pClass ) sal_Bool SAL_CALL java_sql_PreparedStatement::execute( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { m_aLogger.log( LogLevel::FINE, STR_LOG_EXECUTING_PREPARED ); + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jboolean out(sal_False); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); @@ -147,6 +150,8 @@ sal_Bool SAL_CALL java_sql_PreparedStatement::execute( ) throw(::com::sun::star sal_Int32 SAL_CALL java_sql_PreparedStatement::executeUpdate( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); m_aLogger.log( LogLevel::FINE, STR_LOG_EXECUTING_PREPARED_UPDATE ); jint out(0); @@ -172,6 +177,8 @@ sal_Int32 SAL_CALL java_sql_PreparedStatement::executeUpdate( ) throw(::com::su void SAL_CALL java_sql_PreparedStatement::setString( sal_Int32 parameterIndex, const ::rtl::OUString& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); m_aLogger.log( LogLevel::FINER, STR_LOG_STRING_PARAMETER, parameterIndex, x ); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); @@ -203,6 +210,8 @@ void SAL_CALL java_sql_PreparedStatement::setString( sal_Int32 parameterIndex, c ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL java_sql_PreparedStatement::executeQuery( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { m_aLogger.log( LogLevel::FINE, STR_LOG_EXECUTING_PREPARED_QUERY ); + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); @@ -229,6 +238,8 @@ void SAL_CALL java_sql_PreparedStatement::setString( sal_Int32 parameterIndex, c void SAL_CALL java_sql_PreparedStatement::setBoolean( sal_Int32 parameterIndex, sal_Bool x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { m_aLogger.log( LogLevel::FINER, STR_LOG_BOOLEAN_PARAMETER, parameterIndex, x ); + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -252,6 +263,8 @@ void SAL_CALL java_sql_PreparedStatement::setBoolean( sal_Int32 parameterIndex, void SAL_CALL java_sql_PreparedStatement::setByte( sal_Int32 parameterIndex, sal_Int8 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { m_aLogger.log( LogLevel::FINER, STR_LOG_BYTE_PARAMETER, parameterIndex, (sal_Int32)x ); + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -275,6 +288,8 @@ void SAL_CALL java_sql_PreparedStatement::setByte( sal_Int32 parameterIndex, sal void SAL_CALL java_sql_PreparedStatement::setDate( sal_Int32 parameterIndex, const ::com::sun::star::util::Date& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { m_aLogger.log( LogLevel::FINER, STR_LOG_DATE_PARAMETER, parameterIndex, x ); + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -304,6 +319,8 @@ void SAL_CALL java_sql_PreparedStatement::setDate( sal_Int32 parameterIndex, con void SAL_CALL java_sql_PreparedStatement::setTime( sal_Int32 parameterIndex, const ::com::sun::star::util::Time& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { m_aLogger.log( LogLevel::FINER, STR_LOG_TIME_PARAMETER, parameterIndex, x ); + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -333,6 +350,8 @@ void SAL_CALL java_sql_PreparedStatement::setTime( sal_Int32 parameterIndex, con void SAL_CALL java_sql_PreparedStatement::setTimestamp( sal_Int32 parameterIndex, const ::com::sun::star::util::DateTime& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { m_aLogger.log( LogLevel::FINER, STR_LOG_TIMESTAMP_PARAMETER, parameterIndex, x ); + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -360,6 +379,8 @@ void SAL_CALL java_sql_PreparedStatement::setTimestamp( sal_Int32 parameterIndex void SAL_CALL java_sql_PreparedStatement::setDouble( sal_Int32 parameterIndex, double x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { m_aLogger.log( LogLevel::FINER, STR_LOG_DOUBLE_PARAMETER, parameterIndex, x ); + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -383,6 +404,8 @@ void SAL_CALL java_sql_PreparedStatement::setDouble( sal_Int32 parameterIndex, d void SAL_CALL java_sql_PreparedStatement::setFloat( sal_Int32 parameterIndex, float x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { m_aLogger.log( LogLevel::FINER, STR_LOG_FLOAT_PARAMETER, parameterIndex, x ); + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -406,6 +429,8 @@ void SAL_CALL java_sql_PreparedStatement::setFloat( sal_Int32 parameterIndex, fl void SAL_CALL java_sql_PreparedStatement::setInt( sal_Int32 parameterIndex, sal_Int32 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { m_aLogger.log( LogLevel::FINER, STR_LOG_INT_PARAMETER, parameterIndex, x ); + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -429,6 +454,8 @@ void SAL_CALL java_sql_PreparedStatement::setInt( sal_Int32 parameterIndex, sal_ void SAL_CALL java_sql_PreparedStatement::setLong( sal_Int32 parameterIndex, sal_Int64 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { m_aLogger.log( LogLevel::FINER, STR_LOG_LONG_PARAMETER, parameterIndex, x ); + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -452,6 +479,8 @@ void SAL_CALL java_sql_PreparedStatement::setLong( sal_Int32 parameterIndex, sal void SAL_CALL java_sql_PreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 sqlType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { m_aLogger.log( LogLevel::FINER, STR_LOG_NULL_PARAMETER, parameterIndex, sqlType ); + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -499,6 +528,8 @@ void SAL_CALL java_sql_PreparedStatement::setRef( sal_Int32 /*parameterIndex*/, void SAL_CALL java_sql_PreparedStatement::setObjectWithInfo( sal_Int32 parameterIndex, const ::com::sun::star::uno::Any& x, sal_Int32 targetSqlType, sal_Int32 scale ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { m_aLogger.log( LogLevel::FINER, STR_LOG_OBJECT_NULL_PARAMETER, parameterIndex ); + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -527,7 +558,15 @@ void SAL_CALL java_sql_PreparedStatement::setObjectWithInfo( sal_Int32 parameter //return; } else - pBigDecimal.reset(new java_math_BigDecimal(::comphelper::getString(x))); + { + ORowSetValue aValue; + aValue.fill(x); + const ::rtl::OUString sValue = aValue; + if ( sValue.getLength() ) + pBigDecimal.reset(new java_math_BigDecimal(sValue)); + else + pBigDecimal.reset(new java_math_BigDecimal(0.0)); + } //obj = convertwchar_tToJavaString(t.pEnv,::comphelper::getString(x)); t.pEnv->CallVoidMethod( object, mID, parameterIndex,pBigDecimal->getJavaObject(),targetSqlType,scale); ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); @@ -549,6 +588,8 @@ void SAL_CALL java_sql_PreparedStatement::setObjectWithInfo( sal_Int32 parameter void SAL_CALL java_sql_PreparedStatement::setObjectNull( sal_Int32 parameterIndex, sal_Int32 /*sqlType*/, const ::rtl::OUString& /*typeName*/ ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { m_aLogger.log( LogLevel::FINER, STR_LOG_OBJECT_NULL_PARAMETER, parameterIndex ); + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -586,6 +627,8 @@ void SAL_CALL java_sql_PreparedStatement::setObject( sal_Int32 parameterIndex, c void SAL_CALL java_sql_PreparedStatement::setShort( sal_Int32 parameterIndex, sal_Int16 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { m_aLogger.log( LogLevel::FINER, STR_LOG_SHORT_PARAMETER, parameterIndex, x ); + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -609,6 +652,8 @@ void SAL_CALL java_sql_PreparedStatement::setShort( sal_Int32 parameterIndex, sa void SAL_CALL java_sql_PreparedStatement::setBytes( sal_Int32 parameterIndex, const ::com::sun::star::uno::Sequence< sal_Int8 >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { m_aLogger.log( LogLevel::FINER, STR_LOG_BYTES_PARAMETER, parameterIndex ); + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -636,6 +681,8 @@ void SAL_CALL java_sql_PreparedStatement::setBytes( sal_Int32 parameterIndex, co void SAL_CALL java_sql_PreparedStatement::setCharacterStream( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { m_aLogger.log( LogLevel::FINER, STR_LOG_CHARSTREAM_PARAMETER, parameterIndex ); + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -687,6 +734,8 @@ void SAL_CALL java_sql_PreparedStatement::setCharacterStream( sal_Int32 paramete void SAL_CALL java_sql_PreparedStatement::setBinaryStream( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x, sal_Int32 length ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { m_aLogger.log( LogLevel::FINER, STR_LOG_BINARYSTREAM_PARAMETER, parameterIndex ); + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -736,6 +785,8 @@ void SAL_CALL java_sql_PreparedStatement::setBinaryStream( sal_Int32 parameterIn void SAL_CALL java_sql_PreparedStatement::clearParameters( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { m_aLogger.log( LogLevel::FINER, STR_LOG_CLEAR_PARAMETERS ); + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; if( t.pEnv ){ @@ -757,6 +808,8 @@ void SAL_CALL java_sql_PreparedStatement::clearParameters( ) throw(::com::sun:: // ------------------------------------------------------------------------- void SAL_CALL java_sql_PreparedStatement::clearBatch( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ createStatement(t.pEnv); @@ -778,6 +831,8 @@ void SAL_CALL java_sql_PreparedStatement::clearBatch( ) throw(::com::sun::star: void SAL_CALL java_sql_PreparedStatement::addBatch( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ createStatement(t.pEnv); @@ -798,6 +853,8 @@ void SAL_CALL java_sql_PreparedStatement::addBatch( ) throw(::com::sun::star::sd ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL java_sql_PreparedStatement::executeBatch( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); ::com::sun::star::uno::Sequence< sal_Int32 > aSeq; SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ){ @@ -826,6 +883,8 @@ void SAL_CALL java_sql_PreparedStatement::addBatch( ) throw(::com::sun::star::sd // ------------------------------------------------------------------------- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL java_sql_PreparedStatement::getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); jobject out(0); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); if( t.pEnv ) diff --git a/connectivity/source/drivers/jdbc/ResultSet.cxx b/connectivity/source/drivers/jdbc/ResultSet.cxx index 4c46666d16e8..23270f3ea3ac 100644 --- a/connectivity/source/drivers/jdbc/ResultSet.cxx +++ b/connectivity/source/drivers/jdbc/ResultSet.cxx @@ -41,6 +41,7 @@ #include "java/sql/Blob.hxx" #include "java/sql/ResultSetMetaData.hxx" #include "java/io/InputStream.hxx" +#include "java/io/Reader.hxx" #include "java/tools.hxx" #include <comphelper/property.hxx> #include "connectivity/CommonTools.hxx" @@ -232,7 +233,7 @@ Reference< ::com::sun::star::io::XInputStream > SAL_CALL java_sql_ResultSet::get if( t.pEnv ) { // temporaere Variable initialisieren - static const char * cSignature = "(I)Ljava/io/InputStream;"; + static const char * cSignature = "(I)Ljava/io/Reader;"; static const char * cMethodName = "getCharacterStream"; // Java-Call absetzen static jmethodID mID = NULL; @@ -245,7 +246,7 @@ Reference< ::com::sun::star::io::XInputStream > SAL_CALL java_sql_ResultSet::get } //mID } //t.pEnv // ACHTUNG: der Aufrufer wird Eigentuemer des zurueckgelieferten Zeigers !!! - return out==0 ? 0 : new java_io_InputStream( t.pEnv, out ); + return out==0 ? 0 : new java_io_Reader( t.pEnv, out ); } // ------------------------------------------------------------------------- diff --git a/connectivity/source/inc/ParameterSubstitution.hxx b/connectivity/source/inc/ParameterSubstitution.hxx new file mode 100644 index 000000000000..8bf4f7682f4b --- /dev/null +++ b/connectivity/source/inc/ParameterSubstitution.hxx @@ -0,0 +1,74 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: FDatabaseMetaDataResultSet.cxx,v $ + * $Revision: 1.24 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#include "precompiled_connectivity.hxx" +#include <com/sun/star/util/XStringSubstitution.hpp> +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> +#include <com/sun/star/sdbc/XConnection.hpp> +#include <cppuhelper/implbase3.hxx> + +namespace connectivity +{ + typedef ::cppu::WeakImplHelper3< ::com::sun::star::util::XStringSubstitution + ,::com::sun::star::lang::XServiceInfo + ,::com::sun::star::lang::XInitialization > ParameterSubstitution_BASE; + class ParameterSubstitution : public ParameterSubstitution_BASE + { + ::osl::Mutex m_aMutex; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; + ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XConnection > m_xConnection; + + ParameterSubstitution( const ParameterSubstitution& ); + ParameterSubstitution& operator=( const ParameterSubstitution& ); + public: + + static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException); + static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw (::com::sun::star::uno::RuntimeException); + static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > create( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & xContext); + protected: + ParameterSubstitution(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext ); + virtual ~ParameterSubstitution(){} + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); + // XInitialization + virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); + + // XStringSubstitution + virtual ::rtl::OUString SAL_CALL substituteVariables( const ::rtl::OUString& aText, ::sal_Bool bSubstRequired ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL reSubstituteVariables( const ::rtl::OUString& aText ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getSubstituteVariableValue( const ::rtl::OUString& variable ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); + }; +// ================================== +} // connectivity +// ================================== diff --git a/connectivity/source/inc/TSkipDeletedSet.hxx b/connectivity/source/inc/TSkipDeletedSet.hxx index 80cb771d8739..7d7e0852f381 100644 --- a/connectivity/source/inc/TSkipDeletedSet.hxx +++ b/connectivity/source/inc/TSkipDeletedSet.hxx @@ -79,11 +79,11 @@ namespace connectivity /** getMappedPosition returns the mapped position of a logical position @param - sal_Int32 _nPos the logical position + sal_Int32 _nBookmark the logical position @return the mapped position */ - sal_Int32 getMappedPosition(sal_Int32 _nPos) const; + sal_Int32 getMappedPosition(sal_Int32 _nBookmark) const; /** insertNewPosition adds a new position to the map @param |