24#include <com/sun/star/sdbc/XRow.hpp>
25#include <com/sun/star/sdbc/XResultSet.hpp>
38OMySQLCatalog::OMySQLCatalog(
const Reference<XConnection>& _xConnection)
45 ::std::vector<OUString>& _rNames)
47 Reference<XResultSet> xResult =
m_xMetaData->getTables(
Any(),
"%",
"%", _sKindOfObject);
53 ::std::vector<OUString> aVector;
55 Sequence<OUString> sTableTypes{
69 Sequence<OUString>
aTypes{
"VIEW" };
75 ::std::vector<OUString> aVector;
88 ::std::vector<OUString> aVector;
89 Reference<XStatement> xStmt =
m_xConnection->createStatement();
90 Reference<XResultSet> xResult = xStmt->executeQuery(
91 "SELECT grantee FROM information_schema.user_privileges GROUP BY grantee");
94 Reference<XRow> xRow(xResult, UNO_QUERY);
95 while (xResult->next())
96 aVector.push_back(xRow->getString(1));
97 ::comphelper::disposeComponent(xResult);
99 ::comphelper::disposeComponent(xStmt);
112 return OCatalog::queryInterface(rType);
117 Sequence<Type>
aTypes = OCatalog::getTypes();
118 std::vector<Type> aOwnTypes;
119 aOwnTypes.reserve(
aTypes.getLength());
121 const Type* pEnd = pBegin +
aTypes.getLength();
122 for (; pBegin != pEnd; ++pBegin)
126 aOwnTypes.push_back(*pBegin);
129 return Sequence<Type>(aOwnTypes.data(), aOwnTypes.size());
virtual void refreshUsers() override
virtual void refreshTables() override
css::uno::Reference< css::sdbc::XConnection > m_xConnection
virtual void refreshViews() override
virtual void refreshGroups() override
void refreshObjects(const css::uno::Sequence< OUString > &_sKindOfObject,::std::vector< OUString > &_rNames)
calls XDatabaseMetaData::getTables.
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
void fillNames(css::uno::Reference< css::sdbc::XResultSet > &_xResult,::std::vector< OUString > &_rNames)
fills a vector with the necessary names which can be used in combination with the collections.
css::uno::Reference< css::sdbc::XDatabaseMetaData > m_xMetaData
std::unique_ptr< OCollection > m_pTables
std::unique_ptr< OCollection > m_pViews
std::unique_ptr< OCollection > m_pUsers
Reference< XConnection > m_xConnection