1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 #ifndef _CONNECTIVITY_ADABAS_BCONNECTION_HXX_ 24 #define _CONNECTIVITY_ADABAS_BCONNECTION_HXX_ 25 26 #include <cppuhelper/compbase2.hxx> 27 #include "odbc/OConnection.hxx" 28 #include <com/sun/star/sdbcx/XTablesSupplier.hpp> 29 #include <cppuhelper/weakref.hxx> 30 #include <vos/ref.hxx> 31 32 namespace connectivity 33 { 34 namespace odbc 35 { 36 class ODBCDriver; 37 } 38 namespace adabas 39 { 40 typedef connectivity::odbc::OConnection OConnection_BASE2; 41 42 // we must use the name "OAdabasConnection" because of a compiler bug 43 44 class OAdabasConnection : public OConnection_BASE2 45 { 46 ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbcx::XTablesSupplier> m_xCatalog; 47 48 protected: 49 virtual SQLRETURN openConnectionWithAuth(const ::rtl::OUString& aConnectStr,sal_Int32 nTimeOut, const ::rtl::OUString& _uid,const ::rtl::OUString& _pwd); 50 virtual connectivity::odbc::OConnection* cloneConnection(); // creates a new connection 51 public: 52 virtual SQLRETURN Construct( const ::rtl::OUString& url,const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info) throw(::com::sun::star::sdbc::SQLException); 53 54 OAdabasConnection(const SQLHANDLE _pDriverHandle,connectivity::odbc::ODBCDriver* _pDriver); 55 56 // OComponentHelper; 57 virtual void SAL_CALL disposing(); 58 59 ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > createCatalog(); 60 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); 61 62 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XStatement > SAL_CALL createStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); 63 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); 64 65 //XUnoTunnel 66 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw (::com::sun::star::uno::RuntimeException); 67 static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId(); 68 69 ::vos::ORef<OSQLColumns> createSelectColumns(const ::rtl::OUString& _rSql); 70 }; 71 } 72 } 73 #endif // _CONNECTIVITY_ADABAS_BCONNECTION_HXX_ 74 75