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
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_connectivity.hxx"
26
27
28 #include "flat/ECatalog.hxx"
29
30 #ifndef _CONNECTIVITY_FLAT_DCONNECTION_HXX_
31 #include "flat/EConnection.hxx"
32 #endif
33 #include "flat/ETables.hxx"
34 #include <com/sun/star/sdbc/XRow.hpp>
35 #include <com/sun/star/sdbc/XResultSet.hpp>
36
37 using namespace ::com::sun::star::uno;
38 using namespace ::com::sun::star::beans;
39 using namespace ::com::sun::star::sdbcx;
40 using namespace ::com::sun::star::sdbc;
41 using namespace ::com::sun::star::container;
42
43 // -------------------------------------------------------------------------
44 using namespace connectivity::flat;
45 // -------------------------------------------------------------------------
OFlatCatalog(OFlatConnection * _pCon)46 OFlatCatalog::OFlatCatalog(OFlatConnection* _pCon) : file::OFileCatalog(_pCon)
47 {
48 }
49 // -------------------------------------------------------------------------
refreshTables()50 void OFlatCatalog::refreshTables()
51 {
52 TStringVector aVector;
53 Sequence< ::rtl::OUString > aTypes;
54 Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
55 ::rtl::OUString::createFromAscii("%"),::rtl::OUString::createFromAscii("%"),aTypes);
56
57 if(xResult.is())
58 {
59 Reference< XRow > xRow(xResult,UNO_QUERY);
60 while(xResult->next())
61 aVector.push_back(xRow->getString(3));
62 }
63 if(m_pTables)
64 m_pTables->reFill(aVector);
65 else
66 m_pTables = new OFlatTables(m_xMetaData,*this,m_aMutex,aVector);
67 }
68 // -----------------------------------------------------------------------------
69
70
71
72