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
;
15 using namespace ::com::sun::star
;
16 using namespace ::com::sun::star::sdbc
;
17 using namespace ::com::sun::star::uno
;
19 Catalog::Catalog(const uno::Reference
< XConnection
>& rConnection
):
20 OCatalog(rConnection
),
21 m_xConnection(rConnection
)
25 //----- OCatalog -------------------------------------------------------------
26 void Catalog::refreshTables()
28 // TODO: set type -- currenty we also get system tables...
29 Sequence
< OUString
> aTypes(2);
33 uno::Reference
< XResultSet
> xTables
= m_xMetaData
->getTables(Any(),
41 TStringVector aTableNames
;
43 fillNames(xTables
, aTableNames
);
46 m_pTables
= new Tables(m_xConnection
->getMetaData(),
51 m_pTables
->reFill(aTableNames
);
55 void Catalog::refreshViews()
57 // TODO: implement me.
58 // Sets m_pViews (OCatalog)
61 //----- IRefreshableGroups ---------------------------------------------------
62 void Catalog::refreshGroups()
67 //----- IRefreshableUsers ----------------------------------------------------
68 void Catalog::refreshUsers()
70 OUString
sSql("SELECT DISTINCT RDB$USER FROM RDB$USER_PRIVILEGES");
72 uno::Reference
< XResultSet
> xUsers
= m_xMetaData
->getConnection()
73 ->createStatement()->executeQuery(sSql
);
78 TStringVector aUserNames
;
80 uno::Reference
< XRow
> xRow(xUsers
,UNO_QUERY
);
81 while (xUsers
->next())
83 aUserNames
.push_back(xRow
->getString(1));
87 m_pUsers
= new Users(m_xConnection
->getMetaData(),
92 m_pUsers
->reFill(aUserNames
);
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */