39#include <config_lgpl.h>
40#include <com/sun/star/uno/XComponentContext.hpp>
41#include <com/sun/star/lang/XInitialization.hpp>
42#include <com/sun/star/script/XTypeConverter.hpp>
43#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
44#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
45#include <com/sun/star/sdbcx/XUsersSupplier.hpp>
46#include <com/sun/star/sdbcx/XViewsSupplier.hpp>
47#include <com/sun/star/sdbc/XConnection.hpp>
49#include <com/sun/star/container/XNameAccess.hpp>
52#include <rtl/byteseq.hxx>
61#include <unordered_map>
68struct ConnectionSettings;
76 static const rtl_TextEncoding
encoding = RTL_TEXTENCODING_UTF8;
80 css::uno::Reference< css::script::XTypeConverter >
tc;
81 css::uno::Reference< css::container::XNameAccess >
tables;
82 css::uno::Reference< css::container::XNameAccess >
users;
83 css::uno::Reference< css::container::XNameAccess >
views;
91typedef cppu::WeakComponentImplHelper<
92 css::sdbc::XConnection,
93 css::sdbc::XWarningsSupplier,
94 css::lang::XInitialization,
95 css::sdbcx::XTablesSupplier,
96 css::sdbcx::XViewsSupplier,
104 return *
reinterpret_cast<sal_Int32
const *
>(seq.getConstArray());
108typedef std::unordered_map<
110 css::uno::WeakReference< css::sdbc::XCloseable >,
114typedef std::unordered_map
122 css::uno::Reference< css::uno::XComponentContext >
m_ctx;
123 css::uno::Reference< css::container::XNameAccess >
m_typeMap;
126 css::uno::Reference< css::sdbc::XDatabaseMetaData >
m_meta;
137 css::uno::Reference< css::uno::XComponentContext > ctx );
142 virtual void SAL_CALL
close()
override;
146 virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL
createStatement( )
override ;
147 virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL
prepareStatement(
148 const OUString&
sql )
override;
149 virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL
prepareCall(
150 const OUString&
sql )
override;
151 virtual OUString SAL_CALL
nativeSQL(
const OUString&
sql )
override;
154 virtual void SAL_CALL
commit( )
override;
155 virtual void SAL_CALL
rollback( )
override;
157 virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > SAL_CALL
getMetaData( )
override;
160 virtual void SAL_CALL
setCatalog(
const OUString& catalog )
override;
161 virtual OUString SAL_CALL
getCatalog( )
override;
164 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL
getTypeMap( )
override;
166 const css::uno::Reference< css::container::XNameAccess >& typeMap )
override;
169 virtual css::uno::Any SAL_CALL
getWarnings( )
override;
174 const css::uno::Sequence< css::uno::Any >& aArguments )
override;
177 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL
getTables( )
override;
180 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL
getUsers( )
override;
183 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL
getViews( )
override;
186 virtual void SAL_CALL
disposing()
override;
virtual ~Connection() override
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
css::uno::Reference< css::sdbc::XDatabaseMetaData > m_meta
virtual sal_Int32 SAL_CALL getTransactionIsolation() override
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareStatement(const OUString &sql) override
virtual void SAL_CALL setReadOnly(sal_Bool readOnly) override
virtual sal_Bool SAL_CALL isClosed() override
virtual void SAL_CALL setTransactionIsolation(sal_Int32 level) override
virtual void SAL_CALL rollback() override
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareCall(const OUString &sql) override
virtual void SAL_CALL commit() override
virtual void SAL_CALL close() override
css::uno::Reference< css::uno::XComponentContext > m_ctx
virtual sal_Bool SAL_CALL getAutoCommit() override
virtual css::uno::Any SAL_CALL getWarnings() override
virtual void SAL_CALL setAutoCommit(sal_Bool autoCommit) override
ConnectionSettings m_settings
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getViews() override
::rtl::Reference< comphelper::RefCountedMutex > m_xMutex
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTables() override
virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > SAL_CALL getMetaData() override
virtual void SAL_CALL setCatalog(const OUString &catalog) override
virtual OUString SAL_CALL getCatalog() override
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTypeMap() override
virtual void SAL_CALL setTypeMap(const css::uno::Reference< css::container::XNameAccess > &typeMap) override
virtual sal_Bool SAL_CALL isReadOnly() override
WeakHashMap m_myStatements
virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement() override
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getUsers() override
Connection(const rtl::Reference< comphelper::RefCountedMutex > &refMutex, css::uno::Reference< css::uno::XComponentContext > ctx)
virtual void SAL_CALL disposing() override
virtual void SAL_CALL clearWarnings() override
css::uno::Reference< css::container::XNameAccess > m_typeMap
void removeFromWeakMap(const ::rtl::ByteSequence &seq)
virtual OUString SAL_CALL nativeSQL(const OUString &sql) override
std::unordered_map< ::rtl::ByteSequence, css::uno::WeakReference< css::sdbc::XCloseable >, HashByteSequence > WeakHashMap
std::unordered_map< sal_Int32, OUString > Int2StringMap
cppu::WeakComponentImplHelper< css::sdbc::XConnection, css::sdbc::XWarningsSupplier, css::lang::XInitialization, css::sdbcx::XTablesSupplier, css::sdbcx::XViewsSupplier, css::sdbcx::XUsersSupplier > ConnectionBase
css::uno::Reference< css::script::XTypeConverter > tc
rtl::Reference< Views > pViewsImpl
css::uno::Reference< css::container::XNameAccess > views
css::uno::Reference< css::container::XNameAccess > users
css::uno::Reference< css::container::XNameAccess > tables
static const rtl_TextEncoding encoding
rtl::Reference< Tables > pTablesImpl
sal_Int32 operator()(const ::rtl::ByteSequence &seq) const