1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * Effective License of whole file:
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License version 2.1, as published by the Free Software Foundation.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 * Parts "Copyright by Sun Microsystems, Inc" prior to August 2011:
22 * The Contents of this file are made available subject to the terms of
23 * the GNU Lesser General Public License Version 2.1
25 * Copyright: 2000 by Sun Microsystems, Inc.
27 * Contributor(s): Joerg Budischewski
29 * All parts contributed on or after August 2011:
31 * This Source Code Form is subject to the terms of the Mozilla Public
32 * License, v. 2.0. If a copy of the MPL was not distributed with this
33 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
35 ************************************************************************/
37 #ifndef INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_POSTGRESQL_PQ_DATABASEMETADATA_HXX
38 #define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_POSTGRESQL_PQ_DATABASEMETADATA_HXX
40 #include "pq_connection.hxx"
41 #include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
43 #include <cppuhelper/implbase.hxx>
45 namespace pq_sdbc_driver
48 class DatabaseMetaData
:
49 public ::cppu::WeakImplHelper
< css::sdbc::XDatabaseMetaData
>
51 ::rtl::Reference
< comphelper::RefCountedMutex
> m_xMutex
;
52 ConnectionSettings
*m_pSettings
;
53 css::uno::Reference
< css::sdbc::XConnection
> m_origin
;
54 css::uno::Reference
< css::sdbc::XPreparedStatement
> m_getIntSetting_stmt
;
55 css::uno::Reference
< css::sdbc::XPreparedStatement
> m_getReferences_stmt
[16];
56 css::uno::Reference
< css::sdbc::XPreparedStatement
> m_getTablePrivs_stmt
;
57 css::uno::Reference
< css::sdbc::XPreparedStatement
> m_getColumnPrivs_stmt
;
59 /// @throws css::sdbc::SQLException
60 /// @throws css::uno::RuntimeException
61 sal_Int32
getIntSetting(const OUString
& settingName
);
62 /// @throws css::sdbc::SQLException
63 /// @throws css::uno::RuntimeException
64 sal_Int32
getMaxIndexKeys();
65 /// @throws css::sdbc::SQLException
66 /// @throws css::uno::RuntimeException
67 sal_Int32
getMaxNameLength();
68 /// @throws css::sdbc::SQLException
69 /// @throws css::uno::RuntimeException
70 css::uno::Reference
< css::sdbc::XResultSet
> getImportedExportedKeys(
71 const css::uno::Any
& primaryCatalog
, const OUString
& primarySchema
, const OUString
& primaryTable
,
72 const css::uno::Any
& foreignCatalog
, const OUString
& foreignSchema
, const OUString
& foreignTable
);
73 void init_getReferences_stmt ();
74 void init_getPrivs_stmt ();
78 const ::rtl::Reference
< comphelper::RefCountedMutex
> & reMutex
,
79 const css::uno::Reference
< css::sdbc::XConnection
> & origin
,
80 ConnectionSettings
*pSettings
85 virtual sal_Bool SAL_CALL
allProceduresAreCallable( ) override
;
86 virtual sal_Bool SAL_CALL
allTablesAreSelectable( ) override
;
87 virtual OUString SAL_CALL
getURL( ) override
;
88 virtual OUString SAL_CALL
getUserName( ) override
;
89 virtual sal_Bool SAL_CALL
isReadOnly( ) override
;
90 virtual sal_Bool SAL_CALL
nullsAreSortedHigh( ) override
;
91 virtual sal_Bool SAL_CALL
nullsAreSortedLow( ) override
;
92 virtual sal_Bool SAL_CALL
nullsAreSortedAtStart( ) override
;
93 virtual sal_Bool SAL_CALL
nullsAreSortedAtEnd( ) override
;
94 virtual OUString SAL_CALL
getDatabaseProductName( ) override
;
95 virtual OUString SAL_CALL
getDatabaseProductVersion( ) override
;
96 virtual OUString SAL_CALL
getDriverName( ) override
;
97 virtual OUString SAL_CALL
getDriverVersion( ) override
;
98 virtual sal_Int32 SAL_CALL
getDriverMajorVersion( ) override
;
99 virtual sal_Int32 SAL_CALL
getDriverMinorVersion( ) override
;
100 virtual sal_Bool SAL_CALL
usesLocalFiles( ) override
;
101 virtual sal_Bool SAL_CALL
usesLocalFilePerTable( ) override
;
102 virtual sal_Bool SAL_CALL
supportsMixedCaseIdentifiers( ) override
;
103 virtual sal_Bool SAL_CALL
storesUpperCaseIdentifiers( ) override
;
104 virtual sal_Bool SAL_CALL
storesLowerCaseIdentifiers( ) override
;
105 virtual sal_Bool SAL_CALL
storesMixedCaseIdentifiers( ) override
;
106 virtual sal_Bool SAL_CALL
supportsMixedCaseQuotedIdentifiers( ) override
;
107 virtual sal_Bool SAL_CALL
storesUpperCaseQuotedIdentifiers( ) override
;
108 virtual sal_Bool SAL_CALL
storesLowerCaseQuotedIdentifiers( ) override
;
109 virtual sal_Bool SAL_CALL
storesMixedCaseQuotedIdentifiers( ) override
;
110 virtual OUString SAL_CALL
getIdentifierQuoteString( ) override
;
111 virtual OUString SAL_CALL
getSQLKeywords( ) override
;
112 virtual OUString SAL_CALL
getNumericFunctions( ) override
;
113 virtual OUString SAL_CALL
getStringFunctions( ) override
;
114 virtual OUString SAL_CALL
getSystemFunctions( ) override
;
115 virtual OUString SAL_CALL
getTimeDateFunctions( ) override
;
116 virtual OUString SAL_CALL
getSearchStringEscape( ) override
;
117 virtual OUString SAL_CALL
getExtraNameCharacters( ) override
;
118 virtual sal_Bool SAL_CALL
supportsAlterTableWithAddColumn( ) override
;
119 virtual sal_Bool SAL_CALL
supportsAlterTableWithDropColumn( ) override
;
120 virtual sal_Bool SAL_CALL
supportsColumnAliasing( ) override
;
121 virtual sal_Bool SAL_CALL
nullPlusNonNullIsNull( ) override
;
122 virtual sal_Bool SAL_CALL
supportsTypeConversion( ) override
;
123 virtual sal_Bool SAL_CALL
supportsConvert( sal_Int32 fromType
, sal_Int32 toType
) override
;
124 virtual sal_Bool SAL_CALL
supportsTableCorrelationNames( ) override
;
125 virtual sal_Bool SAL_CALL
supportsDifferentTableCorrelationNames( ) override
;
126 virtual sal_Bool SAL_CALL
supportsExpressionsInOrderBy( ) override
;
127 virtual sal_Bool SAL_CALL
supportsOrderByUnrelated( ) override
;
128 virtual sal_Bool SAL_CALL
supportsGroupBy( ) override
;
129 virtual sal_Bool SAL_CALL
supportsGroupByUnrelated( ) override
;
130 virtual sal_Bool SAL_CALL
supportsGroupByBeyondSelect( ) override
;
131 virtual sal_Bool SAL_CALL
supportsLikeEscapeClause( ) override
;
132 virtual sal_Bool SAL_CALL
supportsMultipleResultSets( ) override
;
133 virtual sal_Bool SAL_CALL
supportsMultipleTransactions( ) override
;
134 virtual sal_Bool SAL_CALL
supportsNonNullableColumns( ) override
;
135 virtual sal_Bool SAL_CALL
supportsMinimumSQLGrammar( ) override
;
136 virtual sal_Bool SAL_CALL
supportsCoreSQLGrammar( ) override
;
137 virtual sal_Bool SAL_CALL
supportsExtendedSQLGrammar( ) override
;
138 virtual sal_Bool SAL_CALL
supportsANSI92EntryLevelSQL( ) override
;
139 virtual sal_Bool SAL_CALL
supportsANSI92IntermediateSQL( ) override
;
140 virtual sal_Bool SAL_CALL
supportsANSI92FullSQL( ) override
;
141 virtual sal_Bool SAL_CALL
supportsIntegrityEnhancementFacility( ) override
;
142 virtual sal_Bool SAL_CALL
supportsOuterJoins( ) override
;
143 virtual sal_Bool SAL_CALL
supportsFullOuterJoins( ) override
;
144 virtual sal_Bool SAL_CALL
supportsLimitedOuterJoins( ) override
;
145 virtual OUString SAL_CALL
getSchemaTerm( ) override
;
146 virtual OUString SAL_CALL
getProcedureTerm( ) override
;
147 virtual OUString SAL_CALL
getCatalogTerm( ) override
;
148 virtual sal_Bool SAL_CALL
isCatalogAtStart( ) override
;
149 virtual OUString SAL_CALL
getCatalogSeparator( ) override
;
150 virtual sal_Bool SAL_CALL
supportsSchemasInDataManipulation( ) override
;
151 virtual sal_Bool SAL_CALL
supportsSchemasInProcedureCalls( ) override
;
152 virtual sal_Bool SAL_CALL
supportsSchemasInTableDefinitions( ) override
;
153 virtual sal_Bool SAL_CALL
supportsSchemasInIndexDefinitions( ) override
;
154 virtual sal_Bool SAL_CALL
supportsSchemasInPrivilegeDefinitions( ) override
;
155 virtual sal_Bool SAL_CALL
supportsCatalogsInDataManipulation( ) override
;
156 virtual sal_Bool SAL_CALL
supportsCatalogsInProcedureCalls( ) override
;
157 virtual sal_Bool SAL_CALL
supportsCatalogsInTableDefinitions( ) override
;
158 virtual sal_Bool SAL_CALL
supportsCatalogsInIndexDefinitions( ) override
;
159 virtual sal_Bool SAL_CALL
supportsCatalogsInPrivilegeDefinitions( ) override
;
160 virtual sal_Bool SAL_CALL
supportsPositionedDelete( ) override
;
161 virtual sal_Bool SAL_CALL
supportsPositionedUpdate( ) override
;
162 virtual sal_Bool SAL_CALL
supportsSelectForUpdate( ) override
;
163 virtual sal_Bool SAL_CALL
supportsStoredProcedures( ) override
;
164 virtual sal_Bool SAL_CALL
supportsSubqueriesInComparisons( ) override
;
165 virtual sal_Bool SAL_CALL
supportsSubqueriesInExists( ) override
;
166 virtual sal_Bool SAL_CALL
supportsSubqueriesInIns( ) override
;
167 virtual sal_Bool SAL_CALL
supportsSubqueriesInQuantifieds( ) override
;
168 virtual sal_Bool SAL_CALL
supportsCorrelatedSubqueries( ) override
;
169 virtual sal_Bool SAL_CALL
supportsUnion( ) override
;
170 virtual sal_Bool SAL_CALL
supportsUnionAll( ) override
;
171 virtual sal_Bool SAL_CALL
supportsOpenCursorsAcrossCommit( ) override
;
172 virtual sal_Bool SAL_CALL
supportsOpenCursorsAcrossRollback( ) override
;
173 virtual sal_Bool SAL_CALL
supportsOpenStatementsAcrossCommit( ) override
;
174 virtual sal_Bool SAL_CALL
supportsOpenStatementsAcrossRollback( ) override
;
175 virtual sal_Int32 SAL_CALL
getMaxBinaryLiteralLength( ) override
;
176 virtual sal_Int32 SAL_CALL
getMaxCharLiteralLength( ) override
;
177 virtual sal_Int32 SAL_CALL
getMaxColumnNameLength( ) override
;
178 virtual sal_Int32 SAL_CALL
getMaxColumnsInGroupBy( ) override
;
179 virtual sal_Int32 SAL_CALL
getMaxColumnsInIndex( ) override
;
180 virtual sal_Int32 SAL_CALL
getMaxColumnsInOrderBy( ) override
;
181 virtual sal_Int32 SAL_CALL
getMaxColumnsInSelect( ) override
;
182 virtual sal_Int32 SAL_CALL
getMaxColumnsInTable( ) override
;
183 virtual sal_Int32 SAL_CALL
getMaxConnections( ) override
;
184 virtual sal_Int32 SAL_CALL
getMaxCursorNameLength( ) override
;
185 virtual sal_Int32 SAL_CALL
getMaxIndexLength( ) override
;
186 virtual sal_Int32 SAL_CALL
getMaxSchemaNameLength( ) override
;
187 virtual sal_Int32 SAL_CALL
getMaxProcedureNameLength( ) override
;
188 virtual sal_Int32 SAL_CALL
getMaxCatalogNameLength( ) override
;
189 virtual sal_Int32 SAL_CALL
getMaxRowSize( ) override
;
190 virtual sal_Bool SAL_CALL
doesMaxRowSizeIncludeBlobs( ) override
;
191 virtual sal_Int32 SAL_CALL
getMaxStatementLength( ) override
;
192 virtual sal_Int32 SAL_CALL
getMaxStatements( ) override
;
193 virtual sal_Int32 SAL_CALL
getMaxTableNameLength( ) override
;
194 virtual sal_Int32 SAL_CALL
getMaxTablesInSelect( ) override
;
195 virtual sal_Int32 SAL_CALL
getMaxUserNameLength( ) override
;
196 virtual sal_Int32 SAL_CALL
getDefaultTransactionIsolation( ) override
;
197 virtual sal_Bool SAL_CALL
supportsTransactions( ) override
;
198 virtual sal_Bool SAL_CALL
supportsTransactionIsolationLevel( sal_Int32 level
) override
;
199 virtual sal_Bool SAL_CALL
supportsDataDefinitionAndDataManipulationTransactions( ) override
;
200 virtual sal_Bool SAL_CALL
supportsDataManipulationTransactionsOnly( ) override
;
201 virtual sal_Bool SAL_CALL
dataDefinitionCausesTransactionCommit( ) override
;
202 virtual sal_Bool SAL_CALL
dataDefinitionIgnoredInTransactions( ) override
;
203 virtual css::uno::Reference
< css::sdbc::XResultSet
> SAL_CALL
getProcedures( const css::uno::Any
& catalog
, const OUString
& schemaPattern
, const OUString
& procedureNamePattern
) override
;
204 virtual css::uno::Reference
< css::sdbc::XResultSet
> SAL_CALL
getProcedureColumns( const css::uno::Any
& catalog
, const OUString
& schemaPattern
, const OUString
& procedureNamePattern
, const OUString
& columnNamePattern
) override
;
205 virtual css::uno::Reference
< css::sdbc::XResultSet
> SAL_CALL
getTables( const css::uno::Any
& catalog
, const OUString
& schemaPattern
, const OUString
& tableNamePattern
, const css::uno::Sequence
< OUString
>& types
) override
;
206 virtual css::uno::Reference
< css::sdbc::XResultSet
> SAL_CALL
getSchemas( ) override
;
207 virtual css::uno::Reference
< css::sdbc::XResultSet
> SAL_CALL
getCatalogs( ) override
;
208 virtual css::uno::Reference
< css::sdbc::XResultSet
> SAL_CALL
getTableTypes( ) override
;
209 virtual css::uno::Reference
< css::sdbc::XResultSet
> SAL_CALL
getColumns( const css::uno::Any
& catalog
, const OUString
& schemaPattern
, const OUString
& tableNamePattern
, const OUString
& columnNamePattern
) override
;
210 virtual css::uno::Reference
< css::sdbc::XResultSet
> SAL_CALL
getColumnPrivileges( const css::uno::Any
& catalog
, const OUString
& schema
, const OUString
& table
, const OUString
& columnNamePattern
) override
;
211 virtual css::uno::Reference
< css::sdbc::XResultSet
> SAL_CALL
getTablePrivileges( const css::uno::Any
& catalog
, const OUString
& schemaPattern
, const OUString
& tableNamePattern
) override
;
212 virtual css::uno::Reference
< css::sdbc::XResultSet
> SAL_CALL
getBestRowIdentifier( const css::uno::Any
& catalog
, const OUString
& schema
, const OUString
& table
, sal_Int32 scope
, sal_Bool nullable
) override
;
213 virtual css::uno::Reference
< css::sdbc::XResultSet
> SAL_CALL
getVersionColumns( const css::uno::Any
& catalog
, const OUString
& schema
, const OUString
& table
) override
;
214 virtual css::uno::Reference
< css::sdbc::XResultSet
> SAL_CALL
getPrimaryKeys( const css::uno::Any
& catalog
, const OUString
& schema
, const OUString
& table
) override
;
215 virtual css::uno::Reference
< css::sdbc::XResultSet
> SAL_CALL
getImportedKeys( const css::uno::Any
& catalog
, const OUString
& schema
, const OUString
& table
) override
;
216 virtual css::uno::Reference
< css::sdbc::XResultSet
> SAL_CALL
getExportedKeys( const css::uno::Any
& catalog
, const OUString
& schema
, const OUString
& table
) override
;
217 virtual css::uno::Reference
< css::sdbc::XResultSet
> SAL_CALL
getCrossReference( const css::uno::Any
& primaryCatalog
, const OUString
& primarySchema
, const OUString
& primaryTable
, const css::uno::Any
& foreignCatalog
, const OUString
& foreignSchema
, const OUString
& foreignTable
) override
;
218 virtual css::uno::Reference
< css::sdbc::XResultSet
> SAL_CALL
getTypeInfo( ) override
;
219 virtual css::uno::Reference
< css::sdbc::XResultSet
> SAL_CALL
getIndexInfo( const css::uno::Any
& catalog
, const OUString
& schema
, const OUString
& table
, sal_Bool unique
, sal_Bool approximate
) override
;
220 virtual sal_Bool SAL_CALL
supportsResultSetType( sal_Int32 setType
) override
;
221 virtual sal_Bool SAL_CALL
supportsResultSetConcurrency( sal_Int32 setType
, sal_Int32 concurrency
) override
;
222 virtual sal_Bool SAL_CALL
ownUpdatesAreVisible( sal_Int32 setType
) override
;
223 virtual sal_Bool SAL_CALL
ownDeletesAreVisible( sal_Int32 setType
) override
;
224 virtual sal_Bool SAL_CALL
ownInsertsAreVisible( sal_Int32 setType
) override
;
225 virtual sal_Bool SAL_CALL
othersUpdatesAreVisible( sal_Int32 setType
) override
;
226 virtual sal_Bool SAL_CALL
othersDeletesAreVisible( sal_Int32 setType
) override
;
227 virtual sal_Bool SAL_CALL
othersInsertsAreVisible( sal_Int32 setType
) override
;
228 virtual sal_Bool SAL_CALL
updatesAreDetected( sal_Int32 setType
) override
;
229 virtual sal_Bool SAL_CALL
deletesAreDetected( sal_Int32 setType
) override
;
230 virtual sal_Bool SAL_CALL
insertsAreDetected( sal_Int32 setType
) override
;
231 virtual sal_Bool SAL_CALL
supportsBatchUpdates( ) override
;
232 virtual css::uno::Reference
< css::sdbc::XResultSet
> SAL_CALL
getUDTs( const css::uno::Any
& catalog
, const OUString
& schemaPattern
, const OUString
& typeNamePattern
, const css::uno::Sequence
< sal_Int32
>& types
) override
;
233 virtual css::uno::Reference
< css::sdbc::XConnection
> SAL_CALL
getConnection( ) override
;
240 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */