/************************************************************** * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * *************************************************************/ #ifndef _CONNECTIVITY_ZCONNECTIONWEAKWRAPPER_HXX_ #define _CONNECTIVITY_ZCONNECTIONWEAKWRAPPER_HXX_ #include #include #include #include #include "connectivity/ConnectionWrapper.hxx" namespace connectivity { //========================================================================== //= OConnectionWeakWrapper - wraps all methods to the real connection from the driver //= but when disposed it doesn't dispose the real connection //========================================================================== typedef ::cppu::WeakComponentImplHelper1< ::com::sun::star::sdbc::XConnection > OConnectionWeakWrapper_BASE; class OConnectionWeakWrapper : public ::comphelper::OBaseMutex ,public OConnectionWeakWrapper_BASE , public OConnectionWrapper { protected: // OComponentHelper virtual void SAL_CALL disposing(void); virtual ~OConnectionWeakWrapper(); public: OConnectionWeakWrapper(::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation >& _xConnection); // XServiceInfo DECLARE_SERVICE_INFO(); DECLARE_XTYPEPROVIDER() DECLARE_XINTERFACE( ) // XConnection virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XStatement > SAL_CALL createStatement( ); virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const ::rtl::OUString& sql ); virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareCall( const ::rtl::OUString& sql ); virtual ::rtl::OUString SAL_CALL nativeSQL( const ::rtl::OUString& sql ); virtual void SAL_CALL setAutoCommit( sal_Bool autoCommit ); virtual sal_Bool SAL_CALL getAutoCommit( ); virtual void SAL_CALL commit( ); virtual void SAL_CALL rollback( ); virtual sal_Bool SAL_CALL isClosed( ); virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ); virtual void SAL_CALL setReadOnly( sal_Bool readOnly ); virtual sal_Bool SAL_CALL isReadOnly( ); virtual void SAL_CALL setCatalog( const ::rtl::OUString& catalog ); virtual ::rtl::OUString SAL_CALL getCatalog( ); virtual void SAL_CALL setTransactionIsolation( sal_Int32 level ); virtual sal_Int32 SAL_CALL getTransactionIsolation( ); virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTypeMap( ); virtual void SAL_CALL setTypeMap( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ); // XCloseable virtual void SAL_CALL close( ); }; } #endif // _CONNECTIVITY_ZCONNECTIONWEAKWRAPPER_HXX_