1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #include "Catalog.hxx"
14 using namespace ::connectivity::firebird
;
16 using namespace ::rtl
;
18 using namespace ::com::sun::star
;
19 using namespace ::com::sun::star::sdbc
;
20 using namespace ::com::sun::star::uno
;
22 Catalog::Catalog(const uno::Reference
< XConnection
>& rConnection
):
23 OCatalog(rConnection
),
24 m_xConnection(rConnection
)
28 //----- OCatalog -------------------------------------------------------------
29 void Catalog::refreshTables()
31 // TODO: set type -- currenty we also get system tables...
32 Sequence
< OUString
> aTypes(2);
36 uno::Reference
< XResultSet
> xTables
= m_xMetaData
->getTables(Any(),
44 TStringVector aTableNames
;
46 fillNames(xTables
, aTableNames
);
49 m_pTables
= new Tables(m_xConnection
->getMetaData(),
54 m_pTables
->reFill(aTableNames
);
58 void Catalog::refreshViews()
60 // TODO: implement me.
61 // Sets m_pViews (OCatalog)
64 //----- IRefreshableGroups ---------------------------------------------------
65 void Catalog::refreshGroups()
70 //----- IRefreshableUsers ----------------------------------------------------
71 void Catalog::refreshUsers()
73 OUString
sSql("SELECT DISTINCT RDB$USER FROM RDB$USER_PRIVILEGES");
75 uno::Reference
< XResultSet
> xUsers
= m_xMetaData
->getConnection()
76 ->createStatement()->executeQuery(sSql
);
81 TStringVector aUserNames
;
83 uno::Reference
< XRow
> xRow(xUsers
,UNO_QUERY
);
84 while (xUsers
->next())
86 aUserNames
.push_back(xRow
->getString(1));
90 m_pUsers
= new Users(m_xConnection
->getMetaData(),
95 m_pUsers
->reFill(aUserNames
);
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */