diff options
author | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2013-08-20 08:16:03 +0100 |
---|---|---|
committer | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2013-08-20 21:37:50 +0100 |
commit | 38bc9693cc253d26b11f9a262f26f2cd373d50f9 (patch) | |
tree | 45ef8232b9f42843389eecd73fb332260321fe9a /connectivity | |
parent | 6b184f638d5027eab0166a11506c59fa6194dd62 (diff) |
Implement Catalog::refreshUsers. (firebird-sdbc)
Change-Id: I54ca18b36c19d5a13efd8a194b59f0d8aebbac4c
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/firebird/Catalog.cxx | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/connectivity/source/drivers/firebird/Catalog.cxx b/connectivity/source/drivers/firebird/Catalog.cxx index 4a0700d1e869..dbbfaa33691c 100644 --- a/connectivity/source/drivers/firebird/Catalog.cxx +++ b/connectivity/source/drivers/firebird/Catalog.cxx @@ -9,6 +9,7 @@ #include "Catalog.hxx" #include "Tables.hxx" +#include "Users.hxx" using namespace ::connectivity::firebird; @@ -37,6 +38,9 @@ void Catalog::refreshTables() "%", aTypes); + if (!xTables.is()) + return; + TStringVector aTableNames; fillNames(xTables, aTableNames); @@ -66,6 +70,28 @@ void Catalog::refreshGroups() //----- IRefreshableUsers ---------------------------------------------------- void Catalog::refreshUsers() { - // TODO: implement me + OUString sSql("SELECT DISTINCT RDB$USER FROM RDB$USER_PRIVILEGES"); + + uno::Reference< XResultSet > xUsers = m_xMetaData->getConnection() + ->createStatement()->executeQuery(sSql); + + if (!xUsers.is()) + return; + + TStringVector aUserNames; + + uno::Reference< XRow > xRow(xUsers,UNO_QUERY); + while (xUsers->next()) + { + aUserNames.push_back(xRow->getString(1)); + } + + if (!m_pUsers) + m_pUsers = new Users(m_xConnection->getMetaData(), + *this, + m_aMutex, + aUserNames); + else + m_pUsers->reFill(aUserNames); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file |