LibreOffice Module connectivity (master) 1
TConnection.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19#pragma once
20
21#include <rtl/textenc.h>
22#include <com/sun/star/beans/PropertyValue.hpp>
23#include <com/sun/star/lang/XServiceInfo.hpp>
24#include <com/sun/star/lang/XUnoTunnel.hpp>
25#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
26#include <com/sun/star/sdbc/XConnection.hpp>
28#include "propertyids.hxx"
32
33namespace connectivity
34{
35 typedef ::cppu::WeakComponentImplHelper< css::sdbc::XConnection,
36 css::sdbc::XWarningsSupplier,
37 css::lang::XServiceInfo,
38 css::lang::XUnoTunnel
40
42 {
43 protected:
44 ::osl::Mutex m_aMutex;
45 css::uno::Sequence< css::beans::PropertyValue >
47 connectivity::OWeakRefArray m_aStatements; // vector containing a list
48 // of all the Statement objects
49 // for this Connection
50 OUString m_sURL;
51 rtl_TextEncoding m_nTextEncoding; // the encoding which is used for all text conversions
52 css::uno::WeakReference< css::sdbc::XDatabaseMetaData >
55 public:
56
57 static ::dbtools::OPropertyMap& getPropMap();
58
60
61 rtl_TextEncoding getTextEncoding() const { return m_nTextEncoding; }
62 const OUString& getURL() const { return m_sURL; }
63 void setURL(const OUString& _rsUrl) { m_sURL = _rsUrl; }
64 void throwGenericSQLException(TranslateId pErrorResourceId, const css::uno::Reference< css::uno::XInterface>& _xContext);
65 const SharedResources& getResources() const { return m_aResources;}
66
67 void setConnectionInfo(const css::uno::Sequence< css::beans::PropertyValue >& _aInfo) { m_aConnectionInfo = _aInfo; }
68 const css::uno::Sequence< css::beans::PropertyValue >&
69 getConnectionInfo() const { return m_aConnectionInfo; }
70
71 // OComponentHelper
72 virtual void SAL_CALL disposing() override;
73
74 //XUnoTunnel
75 virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
76 static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
77 };
78}
79
80
81/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void setURL(const OUString &_rsUrl)
Definition: TConnection.hxx:63
css::uno::Sequence< css::beans::PropertyValue > m_aConnectionInfo
Definition: TConnection.hxx:46
connectivity::OWeakRefArray m_aStatements
Definition: TConnection.hxx:47
void setConnectionInfo(const css::uno::Sequence< css::beans::PropertyValue > &_aInfo)
Definition: TConnection.hxx:67
css::uno::WeakReference< css::sdbc::XDatabaseMetaData > m_xMetaData
Definition: TConnection.hxx:53
const css::uno::Sequence< css::beans::PropertyValue > & getConnectionInfo() const
Definition: TConnection.hxx:69
rtl_TextEncoding getTextEncoding() const
Definition: TConnection.hxx:61
const OUString & getURL() const
Definition: TConnection.hxx:62
rtl_TextEncoding m_nTextEncoding
Definition: TConnection.hxx:51
const SharedResources & getResources() const
Definition: TConnection.hxx:65
helper class for accessing resources shared by different libraries in the connectivity module
#define OOO_DLLPUBLIC_DBTOOLS
OUString m_sURL
std::vector< css::uno::WeakReferenceHelper > OWeakRefArray
Definition: CommonTools.hxx:53
::cppu::WeakComponentImplHelper< css::sdbc::XConnection, css::sdbc::XWarningsSupplier, css::lang::XServiceInfo, css::lang::XUnoTunnel > OMetaConnection_BASE
Definition: TConnection.hxx:39
void throwGenericSQLException(const OUString &_rMsg, const css::uno::Reference< css::uno::XInterface > &_rxSource)
throw a generic SQLException, i.e.