LibreOffice Module connectivity (master) 1
inc/java/sql/Connection.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 <java/lang/Object.hxx>
22#include <TConnection.hxx>
26#include <java/GlobalRef.hxx>
27
28#include <com/sun/star/beans/NamedValue.hpp>
29
30namespace connectivity
31{
32 class java_sql_Driver;
33
35
37 public java_lang_Object,
39 {
40 css::uno::Reference< css::uno::XComponentContext > m_xContext;
45
51 css::uno::Any m_aCatalogRestriction;
52 css::uno::Any m_aSchemaRestriction;
53
60 OUString transFormPreparedStatement(const OUString& _sSQL);
62 const OUString& _sDriverClass,
63 const OUString& _sDriverClassPath,
64 const css::uno::Sequence< css::beans::NamedValue >& _rSystemProperties
65 );
70 OUString impl_getJavaDriverClassPath_nothrow(const OUString& _sDriverClass);
71
72 protected:
73 // Static data for the class
74 static jclass theClass;
75
76 virtual ~java_sql_Connection() override;
77
78 public:
79 virtual jclass getMyClass() const override;
80
82 // A ctor that is needed for returning the object
83 java_sql_Connection( const java_sql_Driver& _rDriver );
84 bool construct( const OUString& url,
85 const css::uno::Sequence< css::beans::PropertyValue >& info);
86
87 const css::uno::Sequence< css::beans::PropertyValue >&
89
92 const css::uno::Any& getCatalogRestriction() const { return m_aCatalogRestriction; }
93 const css::uno::Any& getSchemaRestriction() const { return m_aSchemaRestriction; }
94
97 const java::sql::ConnectionLog& getLogger() const { return m_aLogger; }
98
104
105 // OComponentHelper
106 virtual void SAL_CALL disposing() override;
107
108 // XConnection
109 virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement( ) override;
110 virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const OUString& sql ) override;
111 virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareCall( const OUString& sql ) override;
112 virtual OUString SAL_CALL nativeSQL( const OUString& sql ) override;
113 virtual void SAL_CALL setAutoCommit( sal_Bool autoCommit ) override;
114 virtual sal_Bool SAL_CALL getAutoCommit( ) override;
115 virtual void SAL_CALL commit( ) override;
116 virtual void SAL_CALL rollback( ) override;
117 virtual sal_Bool SAL_CALL isClosed( ) override;
118 virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) override;
119 virtual void SAL_CALL setReadOnly( sal_Bool readOnly ) override;
120 virtual sal_Bool SAL_CALL isReadOnly( ) override;
121 virtual void SAL_CALL setCatalog( const OUString& catalog ) override;
122 virtual OUString SAL_CALL getCatalog( ) override;
123 virtual void SAL_CALL setTransactionIsolation( sal_Int32 level ) override;
124 virtual sal_Int32 SAL_CALL getTransactionIsolation( ) override;
125 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTypeMap( ) override;
126 virtual void SAL_CALL setTypeMap( const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
127 // XCloseable
128 virtual void SAL_CALL close( ) override;
129 // XWarningsSupplier
130 virtual css::uno::Any SAL_CALL getWarnings( ) override;
131 virtual void SAL_CALL clearWarnings( ) override;
132 };
133}
134
135/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Sequence< css::beans::PropertyValue > m_aConnectionInfo
Definition: TConnection.hxx:46
virtual void SAL_CALL rollback() override
java_sql_Connection(const java_sql_Driver &_rDriver)
virtual void SAL_CALL setTypeMap(const css::uno::Reference< css::container::XNameAccess > &typeMap) override
virtual void SAL_CALL setAutoCommit(sal_Bool autoCommit) override
virtual sal_Bool SAL_CALL isClosed() override
virtual void SAL_CALL commit() override
virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement() override
virtual void SAL_CALL setTransactionIsolation(sal_Int32 level) override
virtual void SAL_CALL setCatalog(const OUString &catalog) override
virtual css::uno::Any SAL_CALL getWarnings() override
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareStatement(const OUString &sql) override
virtual void SAL_CALL disposing() override
virtual void SAL_CALL close() override
virtual ~java_sql_Connection() override
jdbc::GlobalRef< jobject > m_pDriverClassLoader
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareCall(const OUString &sql) override
const css::uno::Any & getCatalogRestriction() const
virtual sal_Int32 SAL_CALL getTransactionIsolation() override
bool construct(const OUString &url, const css::uno::Sequence< css::beans::PropertyValue > &info)
virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > SAL_CALL getMetaData() override
const jdbc::GlobalRef< jobject > & getDriverClassLoader() const
returns the class loader which was used to load the driver class
virtual sal_Bool SAL_CALL getAutoCommit() override
virtual void SAL_CALL clearWarnings() override
OUString transFormPreparedStatement(const OUString &_sSQL)
transform named parameter into unnamed one.
const java::sql::ConnectionLog & getLogger() const
returns the instance used for logging events related to this connection
virtual void SAL_CALL setReadOnly(sal_Bool readOnly) override
void loadDriverFromProperties(const OUString &_sDriverClass, const OUString &_sDriverClassPath, const css::uno::Sequence< css::beans::NamedValue > &_rSystemProperties)
virtual OUString SAL_CALL nativeSQL(const OUString &sql) override
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTypeMap() override
const css::uno::Any & getSchemaRestriction() const
virtual sal_Bool SAL_CALL isReadOnly() override
virtual OUString SAL_CALL getCatalog() override
OUString impl_getJavaDriverClassPath_nothrow(const OUString &_sDriverClass)
load driver class path from system configuration.
css::uno::Reference< css::uno::XComponentContext > m_xContext
const css::uno::Sequence< css::beans::PropertyValue > & getConnectionInfo() const
virtual jclass getMyClass() const override
OMetaConnection java_sql_Connection_BASE
unsigned char sal_Bool