Commits

Anonymous committed db8a065

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

Comments (0)

Files changed (39)

connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx

 // 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>
 #include <cppuhelper/typeprovider.hxx>
 #include <comphelper/sequence.hxx>
 #include <cppuhelper/factory.hxx>
+#include <cppuhelper/implementationentry.hxx>
 #include "connectivity/dbexception.hxx"
 #include "TConnection.hxx"
 
     // -------------------------------------------------------------------------
     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;
 }
 
 //---------------------------------------------------------------------------------------
-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"

connectivity/source/commontools/FValue.cxx

             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);

connectivity/source/commontools/ParamterSubstitution.cxx

+/*************************************************************************
+ *
+ * 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
+// ==================================

connectivity/source/commontools/dbmetadata.cxx

         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);
             }
         }

connectivity/source/commontools/makefile.mk

         $(SLO)$/sqlerror.obj                            \
         $(SLO)$/filtermanager.obj                       \
         $(SLO)$/parameters.obj							\
+        $(SLO)$/ParamterSubstitution.obj                \
         $(SLO)$/formattedcolumnvalue.obj
 
 SLOFILES=\

connectivity/source/drivers/jdbc/CallableStatement.cxx

 // -------------------------------------------------------------------------
 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 )
 
 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 )
 }
 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 )
 }
 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!");
 }
 ::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 )
 }
 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 )
 
 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 )
 
 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 )
 
 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 ){
 
 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 ){
 
 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 ){
 
 ::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 ){
 
  ::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 )
 
  ::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 ){
 
 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 )
 	{
 }
 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 )
 	{
 
 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 ){
 
 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 ){
 }
 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 ){
 
 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 ){

connectivity/source/drivers/jdbc/DatabaseMetaData.cxx

         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 );
 	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;

connectivity/source/drivers/jdbc/JStatement.cxx

 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!");
 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);
 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);
 
 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);
 // -------------------------------------------------------------------------
 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;
 }
 // -------------------------------------------------------------------------
 
 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;
 
 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 ){
 
 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);
 
 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 ){
 
 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 ){
 
 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 )
 // -------------------------------------------------------------------------
 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 )
 // -------------------------------------------------------------------------
 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 )
 	{
 //------------------------------------------------------------------------------
 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 ){
 //------------------------------------------------------------------------------
 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 ){
 //------------------------------------------------------------------------------
 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 ){
 //------------------------------------------------------------------------------
 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 ){
 //------------------------------------------------------------------------------
 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 ){
 //------------------------------------------------------------------------------
 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 ){
 //------------------------------------------------------------------------------
 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 ){
 //------------------------------------------------------------------------------
 ::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 )
 //------------------------------------------------------------------------------
 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);
 //------------------------------------------------------------------------------
 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!");
 //------------------------------------------------------------------------------
 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);
 //------------------------------------------------------------------------------
 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 ){
 //------------------------------------------------------------------------------
 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!");
 //------------------------------------------------------------------------------
 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);
 //------------------------------------------------------------------------------
 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);

connectivity/source/drivers/jdbc/PreparedStatement.cxx

 #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"
 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!");
 
 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);
 
 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!");
 ::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!");
 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 ){
 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 ){
 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 ){
 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 ){
 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 ){
 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 ){
 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 ){
 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 ){
 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 ){
 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 ){
 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 ){
                             //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 );
 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 ){
 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 ){
 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 ){
 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 ){
 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 ){
 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 ){
 // -------------------------------------------------------------------------
 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);
 
 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);
 
 ::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 ){
 // -------------------------------------------------------------------------
 ::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 )

connectivity/source/drivers/jdbc/ResultSet.cxx

 #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"
 	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;
 		} //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 );
 }
 // -------------------------------------------------------------------------
 

connectivity/source/inc/ParameterSubstitution.hxx

+/*************************************************************************
+ *
+ * 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
+// ==================================

connectivity/source/inc/TSkipDeletedSet.hxx

 		/**
 			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

dbaccess/source/core/api/RowSetBase.cxx

         return;
 
 	::osl::MutexGuard aGuard( *m_pMutex );
-	OSL_ENSURE( m_aBookmark.hasValue(), "ORowSetBase::onDeleteRow: Bookmark isn't valid!" );
+	//OSL_ENSURE( m_aBookmark.hasValue(), "ORowSetBase::onDeleteRow: Bookmark isn't valid!" );
 	if ( compareBookmarks( _rBookmark, m_aBookmark ) == 0 )
     {
         positionCache( MOVE_NONE_REFRESH_ONLY );

dbaccess/source/core/dataaccess/documentdefinition.cxx

 				Reference<XNameContainer> xNC(pDocuSave->getContent(),UNO_QUERY);
 				if ( xNC.is() )
 				{
-                    try
+                    if ( m_pImpl->m_aProps.aTitle == pDocuSave->getName() )
                     {
-                        Reference< XStorage> xStorage = getContainerStorage();
-		                const static ::rtl::OUString sBaseName(RTL_CONSTASCII_USTRINGPARAM("Obj"));
-			            // -----------------------------------------------------------------------------
-			            Reference<XNameAccess> xElements(xStorage,UNO_QUERY_THROW);
-			            ::rtl::OUString sPersistentName = ::dbtools::createUniqueName(xElements,sBaseName);
-                        xStorage->copyElementTo(m_pImpl->m_aProps.sPersistentName,xStorage,sPersistentName);
+                        Reference<XEmbedPersist> xPersist(m_xEmbeddedObject,UNO_QUERY);
+		                if ( xPersist.is() )
+		                {
+			                xPersist->storeOwn();
+			                notifyDataSourceModified();
+		                }
+                    }
+                    else
+                    {
+                        try
+                        {
+                            Reference< XStorage> xStorage = getContainerStorage();
+		                    const static ::rtl::OUString sBaseName(RTL_CONSTASCII_USTRINGPARAM("Obj"));
+			                // -----------------------------------------------------------------------------
+			                Reference<XNameAccess> xElements(xStorage,UNO_QUERY_THROW);
+			                ::rtl::OUString sPersistentName = ::dbtools::createUniqueName(xElements,sBaseName);
+                            xStorage->copyElementTo(m_pImpl->m_aProps.sPersistentName,xStorage,sPersistentName);
 
-                        ::rtl::OUString sOldName = m_pImpl->m_aProps.aTitle;
-                        rename(pDocuSave->getName());
-                        updateDocumentTitle();
+                            ::rtl::OUString sOldName = m_pImpl->m_aProps.aTitle;
+                            rename(pDocuSave->getName());
+                            updateDocumentTitle();
 
-                        Sequence< Any > aArguments(3);
-		                PropertyValue aValue;
-		                // set as folder
-		                aValue.Name = PROPERTY_NAME;
-		                aValue.Value <<= sOldName;
-		                aArguments[0] <<= aValue;
+                            Sequence< Any > aArguments(3);
+		                    PropertyValue aValue;
+		                    // set as folder
+		                    aValue.Name = PROPERTY_NAME;
+		                    aValue.Value <<= sOldName;
+		                    aArguments[0] <<= aValue;
 
-		                aValue.Name = PROPERTY_PERSISTENT_NAME;
-		                aValue.Value <<= sPersistentName;
-		                aArguments[1] <<= aValue;
+		                    aValue.Name = PROPERTY_PERSISTENT_NAME;
+		                    aValue.Value <<= sPersistentName;
+		                    aArguments[1] <<= aValue;
 
-		                aValue.Name = PROPERTY_AS_TEMPLATE;
-		                aValue.Value <<= m_pImpl->m_aProps.bAsTemplate;
-		                aArguments[2] <<= aValue;
+		                    aValue.Name = PROPERTY_AS_TEMPLATE;
+		                    aValue.Value <<= m_pImpl->m_aProps.bAsTemplate;
+		                    aArguments[2] <<= aValue;
 
-			            Reference< XMultiServiceFactory > xORB( m_xParentContainer, UNO_QUERY_THROW );
-			            Reference< XInterface > xComponent( xORB->createInstanceWithArguments( SERVICE_SDB_DOCUMENTDEFINITION, aArguments ) );
-			            Reference< XNameContainer > xNameContainer( m_xParentContainer, UNO_QUERY_THROW );
-			            xNameContainer->insertByName( sOldName, makeAny( xComponent ) );
-		            }
-		            catch(Exception&)
-		            {
-                        DBG_UNHANDLED_EXCEPTION();
-		            }
+			                Reference< XMultiServiceFactory > xORB( m_xParentContainer, UNO_QUERY_THROW );
+			                Reference< XInterface > xComponent( xORB->createInstanceWithArguments( SERVICE_SDB_DOCUMENTDEFINITION, aArguments ) );
+			                Reference< XNameContainer > xNameContainer( m_xParentContainer, UNO_QUERY_THROW );
+			                xNameContainer->insertByName( sOldName, makeAny( xComponent ) );
+		                }
+		                catch(Exception&)
+		                {
+                            DBG_UNHANDLED_EXCEPTION();
+		                }
+                    }
 				}
 			}
 		}

dbaccess/source/core/dataaccess/documentevents.cxx

                 { "OnPrepareViewClosing",   true  },
                 { "OnViewClosed",           false },
                 { "OnTitleChanged",         false },
+                { "OnSubComponentOpened",   false },
+                { "OnSubComponentClosed",   false },
                 { NULL, false }
             };
             return s_aData;

dbaccess/source/ui/app/AppController.cxx

 OApplicationController::OApplicationController(const Reference< XMultiServiceFactory >& _rxORB)
 	:OApplicationController_CBASE( _rxORB )
     ,m_aContextMenuInterceptors( getMutex() )
-    ,m_pSubComponentManager( new SubComponentManager( getSharedMutex() ) )
+    ,m_pSubComponentManager( new SubComponentManager( *this, getSharedMutex() ) )
     ,m_aTableCopyHelper(this)
 	,m_pClipbordNotifier(NULL)
 	,m_nAsyncDrop(0)
 			case SID_DB_APP_DSUSERADMIN:
 			{
 				::dbaccess::DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL)));
-				aReturn.bEnabled =  ::dbaccess::DST_EMBEDDED_HSQLDB != eType;
+                aReturn.bEnabled = ( ::dbaccess::DST_EMBEDDED_HSQLDB != eType );
 			}
 			break;
 			case SID_DB_APP_DSRELDESIGN:
 // -----------------------------------------------------------------------------
 void OApplicationController::showPreviewFor(const ElementType _eType,const ::rtl::OUString& _sName)
 {
+    if ( m_ePreviewMode == E_PREVIEWNONE )
+        return;
+
     OApplicationView* pView = getContainer();
     if ( !pView )
         return;

dbaccess/source/ui/app/subcomponentmanager.cxx

 ************************************************************************/
 
 #include "subcomponentmanager.hxx"
+#include "AppController.hxx"
 
 /** === begin UNO includes === **/
 #include <com/sun/star/frame/XFrame.hpp>
 #include <com/sun/star/frame/XModel2.hpp>
 #include <com/sun/star/util/XCloseable.hpp>
 #include <com/sun/star/awt/XTopWindow.hpp>
+#include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
 /** === end UNO includes === **/
 
 #include <tools/diagnose_ex.h>
     using ::com::sun::star::container::XEnumeration;
     using ::com::sun::star::util::XCloseable;
     using ::com::sun::star::awt::XTopWindow;
+    using ::com::sun::star::document::XDocumentEventBroadcaster;
 	/** === end UNO using === **/
 
     //==============================================================================
                 if ( !xModel.is() )
                     xModel.set( xController->getModel() );
             }
+
+            inline bool is() const { return xFrame.is(); }
         };
 
         struct SelectSubComponent : public ::std::unary_function< SubComponentDescriptor, Reference< XComponent > >
     //==============================================================================
     struct SubComponentManager_Data
     {
-        SubComponentManager_Data( const ::comphelper::SharedMutex& _rMutex )
-            :m_aMutex( _rMutex )
+        SubComponentManager_Data( OApplicationController& _rController, const ::comphelper::SharedMutex& _rMutex )
+            :m_rController( _rController )
+            ,m_aMutex( _rMutex )
         {
         }
 
+        OApplicationController&             m_rController;
         mutable ::comphelper::SharedMutex   m_aMutex;
         SubComponentMap                     m_aComponents;
 
 	//= SubComponentManager
 	//====================================================================
 	//--------------------------------------------------------------------
-    SubComponentManager::SubComponentManager( const ::comphelper::SharedMutex& _rMutex )
-        :m_pData( new SubComponentManager_Data( _rMutex ) )
+    SubComponentManager::SubComponentManager( OApplicationController& _rController, const ::comphelper::SharedMutex& _rMutex )
+        :m_pData( new SubComponentManager_Data( _rController, _rMutex ) )
     {
     }
 
             }
             return bSuccess;
         }
+
+        // -----------------------------------------------------------------------------
+        void lcl_notifySubComponentEvent( const SubComponentManager_Data& _rData, const sal_Char* _pAsciiEventName,
+                const SubComponentDescriptor& _rComponent )
+        {
+            try
+            {
+                Reference< XDocumentEventBroadcaster > xBroadcaster( _rData.m_rController.getModel(), UNO_QUERY_THROW );
+                xBroadcaster->notifyDocumentEvent(
+                    ::rtl::OUString::createFromAscii( _pAsciiEventName ),
+                    &_rData.m_rController,
+                    makeAny( _rComponent.xFrame )
+                );
+            }
+            catch( const Exception& )
+            {
+        	    DBG_UNHANDLED_EXCEPTION();
+            }
+        }
     }
 
 	//--------------------------------------------------------------------
     void SAL_CALL SubComponentManager::disposing( const EventObject& _rSource ) throw (RuntimeException)
     {
-        ::osl::MutexGuard aGuard( m_pData->getMutex() );
+        ::osl::ClearableMutexGuard aGuard( m_pData->getMutex() );
+
+        SubComponentDescriptor aClosedComponent;
 
         for (   SubComponentMap::iterator comp = m_pData->m_aComponents.begin();
                 comp != m_pData->m_aComponents.end();
 
             if ( bRemove )
             {
+                aClosedComponent = comp->second;
                 m_pData->m_aComponents.erase( comp );
                 break;
             }
         }
+
+        if ( aClosedComponent.is() )
+        {
+            aGuard.clear();
+            lcl_notifySubComponentEvent( *m_pData, "OnSubComponentClosed", aClosedComponent );
+        }
     }
 
 	//--------------------------------------------------------------------
     void SubComponentManager::onSubComponentOpened( const ::rtl::OUString&  _rName, const sal_Int32 _nComponentType,
         const ElementOpenMode _eOpenMode, const Reference< XComponent >& _rxComponent )
     {
-	    ::osl::MutexGuard aGuard( m_pData->getMutex() );
+	    ::osl::ClearableMutexGuard aGuard( m_pData->getMutex() );
 
         // put into map
         SubComponentAccessor aKey( _rName, _nComponentType, _eOpenMode );
         aElement.xController->addEventListener( this );
         if ( aElement.xModel.is() )
             aElement.xModel->addEventListener( this );
+
+        // notify this to interested parties
+        aGuard.clear();
+        lcl_notifySubComponentEvent( *m_pData, "OnSubComponentOpened", aElement );
     }
 
     // -----------------------------------------------------------------------------

dbaccess/source/ui/app/subcomponentmanager.hxx

 //........................................................................
 
     struct SubComponentManager_Data;
+    class OApplicationController;
+
 	//====================================================================
 	//= SubComponentManager
 	//====================================================================
     class SubComponentManager : public SubComponentManager_Base
 	{
     public:
-        SubComponentManager( const ::comphelper::SharedMutex& _rMutex );
+        SubComponentManager( OApplicationController& _rController, const ::comphelper::SharedMutex& _rMutex );
         virtual ~SubComponentManager();
 
         void    disposing();

dbaccess/source/ui/dlg/CollectionView.cxx

 				QueryBox aBox( this, WB_YES_NO, ModuleRes( STR_ALREADYEXISTOVERWRITE ) );
 				if ( aBox.Execute() != RET_YES )
 					return 0;
-				xNameContainer->removeByName(sName);
+				// xNameContainer->removeByName(sName);
 			}
 			m_aName.SetText(sName);
 			EndDialog( TRUE );

dbaccess/source/ui/misc/dsmeta.cxx

             s_aSupport[  ::dbaccess::DST_MSACCESS            ] = InitAdvanced( 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0 );
             s_aSupport[  ::dbaccess::DST_MYSQL_ODBC          ] = InitAdvanced( 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0 );
             s_aSupport[  ::dbaccess::DST_MYSQL_JDBC          ] = InitAdvanced( 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0 );
-            s_aSupport[  ::dbaccess::DST_MYSQL_NATIVE        ] = InitAdvanced( 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0 );
+            s_aSupport[  ::dbaccess::DST_MYSQL_NATIVE        ] = InitAdvanced( 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0 );
             s_aSupport[  ::dbaccess::DST_ORACLE_JDBC         ] = InitAdvanced( InitAdvanced::All );
             s_aSupport[  ::dbaccess::DST_ADABAS              ] = InitAdvanced( 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0 );
             s_aSupport[  ::dbaccess::DST_CALC                ] = InitAdvanced( InitAdvanced::None );

dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx

 
 		if (bCase(aField,rInfo->GetField()) && 
 			bCase(aAlias,rInfo->GetAlias()) && 
-			pEntry->GetFunctionType() == rInfo->GetFunctionType())
+			pEntry->GetFunctionType() == rInfo->GetFunctionType() &&
+            pEntry->GetFunction() == rInfo->GetFunction())
 		{
             /*sal_uInt32 nPos = aIter - rFields.begin();
             bAppend = _nCurrentPos > nPos && (rInfo->IsGroupBy() != pEntry->IsGroupBy());
 
 		if (bCase(aField,rInfo->GetField()) && 
 			bCase(aAlias,rInfo->GetAlias()) && 
-			pEntry->GetFunctionType() == rInfo->GetFunctionType())
+			pEntry->GetFunctionType() == rInfo->GetFunctionType() &&
+            pEntry->GetFunction() == rInfo->GetFunction())
 		{
 			if ( pEntry->isNumericOrAggreateFunction() && rInfo->IsGroupBy() )
 				pEntry->SetGroupBy(sal_False);

formula/inc/formula/FormulaCompiler.hxx

     FormulaCompiler(FormulaTokenArray& _rArr);
     virtual ~FormulaCompiler();
 
+    // SUNWS7 needs a forward declared friend, otherwise members of the outer
+    // class are not accessible.
+    class OpCodeMap;
+    friend class FormulaCompiler::OpCodeMap;
     /** Mappings from strings to OpCodes and vice versa. */
     class FORMULA_DLLPUBLIC OpCodeMap
     {

formula/source/core/api/FormulaCompiler.cxx

         if ( FormulaGrammar::GRAM_ENGLISH != _eGrammar )
             fillFromAddInCollectionUpperName( _xMap);
         else
-            fillFromAddInCollectionEnglishName( mxSymbolsEnglish);
+            fillFromAddInCollectionEnglishName( _xMap);
     }
 }
 // -----------------------------------------------------------------------------

hsqldb/makefile.mk

 
 TARFILE_ROOTDIR=hsqldb
 
-CONVERTFILES=build$/build.xml
+CONVERTFILES=build$/build.xml \
+			src$/org$/hsqldb$/persist$/HsqlDatabaseProperties.java
 
-# PATCH_FILE_NAME=patches$/accumulated_patches.patch
+PATCH_FILE_NAME=patches$/accumulated_patches.patch
 
 # ADDITIONAL_FILES=   src$/org$/hsqldb$/Collation.java \
 #                     src$/org$/hsqldb$/TxManager.java \

hsqldb/patches/accumulated_patches.patch

+--- misc/hsqldb/src/org/hsqldb/persist/HsqlDatabaseProperties.java	2008-03-17 17:05:41.000000000 +0100
++++ misc/build/hsqldb/src/org/hsqldb/persist/HsqlDatabaseProperties.java	2009-01-21 13:09:24.493470142 +0100
+@@ -429,6 +429,7 @@
+             setProperty(hsqldb_log_size, 10);
+             setProperty(sql_enforce_strict_size, true);
+             setProperty(hsqldb_nio_data_file, false);
++			setProperty(hsqldb_lock_file, true);
+         }
+ 
+         // OOo end

hsqldb/patches/index.txt

 -----
   http://www.openoffice.org/issues/show_bug.cgi?id=?????
   http://www.openoffice.org/issues/show_bug.cgi?id=85087
+  http://www.openoffice.org/issues/show_bug.cgi?id=97032
   <summary>
 
 

offapi/com/sun/star/sdb/OfficeDatabaseDocument.idl

                     <td>the title of the document changed.</td>
                     <td align="center">no</td>
                 </tr>
+		        <tr><td valign="top"><em>OnSubComponentOpened</em></td>
+                    <td>From with a view to the document, a view to a sub component (e.g. a table or a report) has been opened.</td>
+                    <td align="center">no</td>
+                </tr>
+		        <tr><td valign="top"><em>OnSubComponentClosed</em></td>
+                    <td>From with a view to the document, a view to a sub component (e.g. a table or a report) has been closed.</td>
+                    <td align="center">no</td>
+                </tr>
             </tbody>
         </table>
         </p>

sc/source/core/tool/compiler.cxx

     rtl::OUStringBuffer aBuffer;
     switch ( eOp )
     {
+		case ocName:
+        {
+            ScRangeData* pData = pDoc->GetRangeName()->FindIndex(_pTokenP->GetIndex());
+            if (pData)
+            {
+                if (pData->HasType(RT_SHARED))
+                    pData->UpdateSymbol( aBuffer, aPos, GetGrammar());
+                else
+                    aBuffer.append(pData->GetName());
+            }
+        }
+        break;
         case ocDBArea:
         {
             ScDBData* pDBData = pDoc->GetDBCollection()->FindIndex(_pTokenP->GetIndex());

svtools/source/config/colorcfg.cxx

         COL_BLUE, // BASICOPERATOR  ,
         COL_BLUE, // BASICKEYWORD   ,
         COL_RED, //BASICERROR
-		0xF84E4E, // SQLIDENTIFIER
-		0xCC66CC, // SQLNUMBER
-		0x7CDB8C, // SQLSTRING
-		COL_BLACK, // SQLOPERATOR
-		0x0000FF, // SQLKEYWORD
+		0x009900, // SQLIDENTIFIER
+		0x000000, // SQLNUMBER
+		0xCE7B00, // SQLSTRING
+		0x000000, // SQLOPERATOR
+		0x0000E6, // SQLKEYWORD
 		0x259D9D, // SQLPARAMTER
-		COL_GRAY,// SQLCOMMENT 
+		0x969696,// SQLCOMMENT 
     };
     Color aRet;
     switch(eEntry)

svtools/source/contnr/svimpbox.cxx

 	// #97680# --------------
 	UpdateContextBmpWidthVectorFromMovedEntry( pEntry );
 
+    if ( !pStartEntry )
+        // this might happen if the only entry in the view is moved to its very same position
+        // #i97346#
+        pStartEntry = pView->First();
+
 	aVerSBar.SetRange( Range(0, pView->GetVisibleCount()-1));
 	USHORT nFirstPos = (USHORT)pTree->GetAbsPos( pStartEntry );
 	USHORT nNewPos = (USHORT)pTree->GetAbsPos( pEntry );

svtools/source/edit/syntaxhighlight.cxx

 				{
 					// Naechstes Zeichen holen
 					c = peekChar();
-					bIdentifierChar = testCharFlags( c, CHAR_IN_IDENTIFIER );
+					bIdentifierChar =  BasicSimpleCharClass::isAlpha( c, true );
 					if( bIdentifierChar )
 						getChar();
 				}
 			if (cPeekNext=='-')
 			{
 				// Alle Zeichen bis Zeilen-Ende oder EOF entfernen
-				sal_Unicode cPeek = peekChar();
-				while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == FALSE )
+				while( cPeekNext != CHAR_EOF && testCharFlags( cPeekNext, CHAR_EOL ) == FALSE )
 				{
 					getChar();
-					cPeek = peekChar();
+					cPeekNext = peekChar();
 				}
-
 				reType = TT_COMMENT;
 			}
 		}
+       else if (c=='/')
+       {
+           sal_Unicode cPeekNext = peekChar();
+           if (cPeekNext=='/')
+           {
+               // Alle Zeichen bis Zeilen-Ende oder EOF entfernen
+               while( cPeekNext != CHAR_EOF && testCharFlags( cPeekNext, CHAR_EOL ) == FALSE )
+               {
+                   getChar();
+                   cPeekNext = peekChar();
+               }
+               reType = TT_COMMENT;
+           }
+       }
 		else
 		{
 			// Kommentar ?

svx/inc/svx/dialogs.hrc

 #define RID_SVXSTR_SELMODE_BLK                              (RID_SVX_START + 1167)
 #define RID_SVXSTR_STYLEFAMILY_TABLEDESIGN                  (RID_SVX_START + 1168)
 #define STR_LINKEDDOC_NO_SYSTEM_FILE                        (RID_SVX_START + 1169)
-// pb: next free string resource id
-#define RID_SVXSTR_NEXTFREE                                 (RID_SVX_START + 1170)
+#define RID_SVXSTR_EVENT_SUBCOMPONENT_OPENED                (RID_SVX_START + 1170)
+#define RID_SVXSTR_EVENT_SUBCOMPONENT_CLOSED                (RID_SVX_START + 1171)
+    // if you add here, remember to adjust RID_SVXSTR_NEXTFREE
 
+#define RID_SVXSTR_NEXTFREE                                 (RID_SVX_START + 1172)
 
 // ----------------------------------------------------------------------------
 // if we have _a_lot_ time, we should group the resource ids by type, instead

svx/source/dialog/macropg.cxx

     aDisplayNames.push_back( EventDisplayName( "OnModifyChanged",       RID_SVXSTR_EVENT_MODIFYCHANGED ) );
     aDisplayNames.push_back( EventDisplayName( "OnMailMerge",           RID_SVXSTR_EVENT_MAILMERGE ) );
     aDisplayNames.push_back( EventDisplayName( "OnPageCountChange",     RID_SVXSTR_EVENT_PAGECOUNTCHANGE ) );
+    aDisplayNames.push_back( EventDisplayName( "OnSubComponentOpened",  RID_SVXSTR_EVENT_SUBCOMPONENT_OPENED ) );
+    aDisplayNames.push_back( EventDisplayName( "OnSubComponentClosed",  RID_SVXSTR_EVENT_SUBCOMPONENT_CLOSED ) );
 
     // the event name to UI string mappings for forms & dialogs
     //

svx/source/dialog/macropg.src

 {
 	Text [ en-US ] = "Changing the page count" ;
 };
+String RID_SVXSTR_EVENT_SUBCOMPONENT_OPENED
+{
+	Text = "Loaded a sub component" ;
+};
+String RID_SVXSTR_EVENT_SUBCOMPONENT_CLOSED
+{
+	Text = "Closed a sub component" ;
+};
 String RID_SVXSTR_EVENT_APPROVEPARAMETER
 {
 	Text [ en-US ] = "Fill parameters" ;

svx/source/form/fmshimp.cxx

             {
 	            Reference< XBindableValue > xOldBindable( xOldModel, UNO_QUERY );
 	            Reference< XBindableValue > xNewBindable( xNewModel, UNO_QUERY );
+                if ( xOldBindable.is() )
                 {
                     try
                     {
-                        xNewBindable->setValueBinding( xOldBindable->getValueBinding() );
+                        if ( xNewBindable.is() )
+                            xNewBindable->setValueBinding( xOldBindable->getValueBinding() );
                         xOldBindable->setValueBinding( NULL );
                     }
-                    catch(const IncompatibleTypesException&)
+		            catch(const Exception&)
                     {
+                        DBG_UNHANDLED_EXCEPTION();
                     }
                 }
             }
             {
                 Reference< XListEntrySink > xOldSink( xOldModel, UNO_QUERY );
                 Reference< XListEntrySink > xNewSink( xNewModel, UNO_QUERY );
-                if ( xOldSink.is() && xNewSink.is() )
+                if ( xOldSink.is() )
                 {
                     try
                     {
-                        xNewSink->setListEntrySource( xOldSink->getListEntrySource() );
+                        if ( xNewSink.is() )
+                            xNewSink->setListEntrySource( xOldSink->getListEntrySource() );
                         xOldSink->setListEntrySource( NULL );
                     }
 		            catch(const Exception&)
 		            {
-                        DBG_ERROR("FmXFormShell::executeControlConversionSlot: caught an exception while creating the control !");
+                        DBG_UNHANDLED_EXCEPTION();
 		            }
                 }
             }

testautomation/dbaccess/optional/includes/db_JDBCMySQL.inc

     '   databases specific settings for JDBC MySQL
     ' **************************************************
     
+    qaerrorlog "due to issue 98387 this test will not work anymore."
+    goto endsub
+    
 	Dim sFileName as string	
     sFileName = gOfficePath + Convertpath("user/work/TT_JDBC-MYSQL.odb")
         

testautomation/dbaccess/optional/input/driver/mysql_jconnector.jar

Binary file removed.

xmloff/source/forms/elementimport.cxx

 		if ( bMakeAbsolute && ( _rValue.getLength() > 0  ) )
 		{
 			// make a global URL out of the local one
-			::rtl::OUString sAdjustedValue = m_rContext.getGlobalContext().ResolveGraphicObjectURL( _rValue, FALSE );
-			OImagePositionImport::handleAttribute( _nNamespaceKey, _rLocalName, sAdjustedValue );
+                        ::rtl::OUString sAdjustedValue;
+                        // only resolve image related url
+                        // we don't want say form url targets to be resolved
+                        // using ResolveGraphicObjectURL
+                        if ( 0 == _rLocalName.compareToAscii( s_pImageDataAttributeName ) )
+                                sAdjustedValue = m_rContext.getGlobalContext().ResolveGraphicObjectURL( _rValue, FALSE );
+                        else
+                                 sAdjustedValue = m_rContext.getGlobalContext().GetAbsoluteReference( _rValue );
+                        OImagePositionImport::handleAttribute( _nNamespaceKey, _rLocalName, sAdjustedValue );
 		}
 		else
 			OImagePositionImport::handleAttribute( _nNamespaceKey, _rLocalName, _rValue );

xmloff/source/script/XMLEventExport.cxx

     { "OnSaveTo",           XML_NAMESPACE_OFFICE, "save-to" },
     { "OnSaveToDone",       XML_NAMESPACE_OFFICE, "save-to-done" },
     { "OnSaveToFailed",     XML_NAMESPACE_OFFICE, "save-to-failed" },
+    { "OnSubComponentOpened",   XML_NAMESPACE_OFFICE, "subcomponent-opened" },
+    { "OnSubComponentClosed",   XML_NAMESPACE_OFFICE, "subcomponent-closed" },
 
 	{ NULL, 0, 0 }