1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _CONNECTIVITY_ADABAS_BCONNECTION_HXX_
28 #define _CONNECTIVITY_ADABAS_BCONNECTION_HXX_
29 
30 #include <cppuhelper/compbase2.hxx>
31 #include "odbc/OConnection.hxx"
32 #include <com/sun/star/sdbcx/XTablesSupplier.hpp>
33 #include <cppuhelper/weakref.hxx>
34 #include <vos/ref.hxx>
35 
36 namespace connectivity
37 {
38 	namespace odbc
39 	{
40 		class ODBCDriver;
41 	}
42     namespace adabas
43 	{
44         typedef connectivity::odbc::OConnection OConnection_BASE2;
45 
46 		// we must use the name "OAdabasConnection" because of a compiler bug
47 
48 		class OAdabasConnection :	 public OConnection_BASE2
49 		{
50             ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbcx::XTablesSupplier>      m_xCatalog;
51 
52 		protected:
53 			virtual SQLRETURN							openConnectionWithAuth(const ::rtl::OUString& aConnectStr,sal_Int32 nTimeOut, const ::rtl::OUString& _uid,const ::rtl::OUString& _pwd);
54 			virtual connectivity::odbc::OConnection*	cloneConnection(); // creates a new connection
55 		public:
56             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);
57 
58            OAdabasConnection(const SQLHANDLE _pDriverHandle,connectivity::odbc::ODBCDriver*      _pDriver);
59 
60 			// OComponentHelper;
61 			virtual void SAL_CALL disposing();
62 
63             ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > createCatalog();
64             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);
65 
66 			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);
67             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);
68 
69 			//XUnoTunnel
70 			virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw (::com::sun::star::uno::RuntimeException);
71 			static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
72 
73 			::vos::ORef<OSQLColumns> createSelectColumns(const ::rtl::OUString& _rSql);
74 		};
75 	}
76 }
77 #endif // _CONNECTIVITY_ADABAS_BCONNECTION_HXX_
78 
79