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_CATALOG_HXX_
24 #define _CONNECTIVITY_ADABAS_CATALOG_HXX_
25 
26 #include "connectivity/sdbcx/VCatalog.hxx"
27 #include "odbc/OFunctiondefs.hxx"
28 #include "connectivity/StdTypeDefs.hxx"
29 
30 namespace connectivity
31 {
32 	namespace adabas
33 	{
34 		// please don't name the class the same name as in an other namespaces
35 		// some compilers have problems with this task as I noticed on windows
36         class OAdabasConnection;
37 		class OAdabasCatalog : public connectivity::sdbcx::OCatalog
38 		{
39 			OAdabasConnection*	m_pConnection;		// used to get the metadata
40 			SQLHANDLE			m_aConnectionHdl;	// used for odbc specific stuff
41 
42             void fillVector(const ::rtl::OUString& _sQuery,TStringVector& _rVector);
43 
44 		protected:
45 			/** builds the name which should be used to access the object later on in the collection.
46 				Will only be called in fillNames.
47 				@param	_xRow
48 					The cuurent row from a call of XDatabaseMetaData::getTables.
49 			*/
50 			virtual ::rtl::OUString buildName(	const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow >& _xRow);
51 		public:
52 			// implementation of the pure virtual methods
53 			virtual void refreshTables();
54 			virtual void refreshViews()	;
55 			virtual void refreshGroups();
56 			virtual void refreshUsers()	;
57 
58 		public:
59 			OAdabasCatalog(SQLHANDLE _aConnectionHdl,OAdabasConnection* _pCon);
60 
getConnection() const61 			OAdabasConnection*		getConnection()		const { return m_pConnection; }
getPrivateTables() const62 			sdbcx::OCollection*		getPrivateTables()	const { return m_pTables;}
getPrivateViews() const63 			sdbcx::OCollection*		getPrivateViews()	const { return m_pViews; }
64 
65 			static const ::rtl::OUString& getDot();
66 			// correct the the column properties of float/real/double values
67 			// all & parameters are IN and OUT
68 			static void correctColumnProperties(sal_Int32 _nPrec, sal_Int32& _rnType,::rtl::OUString& _rsTypeName);
69 		};
70 	}
71 }
72 #endif // _CONNECTIVITY_ADABAS_CATALOG_HXX_
73 
74