tdf#150789 - FILEOPEN PPTX: fix text in SmartArt vertically off
[LibreOffice.git] / connectivity / source / drivers / odbc / ODatabaseMetaData.cxx
blob97cd0b1b33d93c8922fc64441b2f447ce5382ebd
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <odbc/ODatabaseMetaData.hxx>
21 #include <odbc/OTools.hxx>
22 #include <odbc/ODatabaseMetaDataResultSet.hxx>
23 #include <FDatabaseMetaDataResultSet.hxx>
24 #include <com/sun/star/sdbc/DataType.hpp>
25 #include <com/sun/star/sdbc/ResultSetType.hpp>
26 #include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
27 #include <com/sun/star/sdbc/TransactionIsolation.hpp>
28 #include <TPrivilegesResultSet.hxx>
29 #include <rtl/ustrbuf.hxx>
30 #include <sal/log.hxx>
31 #include <o3tl/string_view.hxx>
33 using namespace connectivity::odbc;
34 using namespace com::sun::star::uno;
35 using namespace com::sun::star::sdbc;
37 ODatabaseMetaData::ODatabaseMetaData(const SQLHANDLE _pHandle,OConnection* _pCon)
38 : ::connectivity::ODatabaseMetaDataBase(_pCon,_pCon->getConnectionInfo())
39 ,m_aConnectionHandle(_pHandle)
40 ,m_pConnection(_pCon)
41 ,m_bUseCatalog(true)
43 assert(m_pConnection && "ODatabaseMetaData::ODatabaseMetaData: No connection set!");
44 if(!m_pConnection->isCatalogUsed())
46 osl_atomic_increment( &m_refCount );
47 try
49 m_bUseCatalog = !(usesLocalFiles() || usesLocalFilePerTable());
51 catch(SQLException& )
52 { // doesn't matter here
54 osl_atomic_decrement( &m_refCount );
58 ODatabaseMetaData::~ODatabaseMetaData()
62 Reference< XResultSet > ODatabaseMetaData::impl_getTypeInfo_throw( )
64 Reference< XResultSet > xRef;
65 try
67 rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(m_pConnection);
68 xRef = pResult;
69 pResult->openTypeInfo();
71 catch(SQLException&)
73 xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTypeInfo);
76 return xRef;
79 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCatalogs( )
81 Reference< XResultSet > xRef;
82 if(!m_bUseCatalog)
84 xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eCatalogs);
86 else
88 try
90 rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(m_pConnection);
91 xRef = pResult;
92 pResult->openCatalogs();
94 catch(SQLException&)
96 xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eCatalogs);
100 return xRef;
103 OUString ODatabaseMetaData::impl_getCatalogSeparator_throw( )
105 OUString aVal;
106 if ( m_bUseCatalog )
107 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_NAME_SEPARATOR,aVal,*this,m_pConnection->getTextEncoding());
109 return aVal;
112 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getSchemas( )
114 Reference< XResultSet > xRef;
117 rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(m_pConnection);
118 xRef = pResult;
119 pResult->openSchemas();
121 catch(SQLException&)
123 xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eSchemas);
125 return xRef;
128 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumnPrivileges(
129 const Any& catalog, const OUString& schema, const OUString& table,
130 const OUString& columnNamePattern )
132 Reference< XResultSet > xRef;
135 rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(m_pConnection);
136 xRef = pResult;
137 pResult->openColumnPrivileges(m_bUseCatalog ? catalog : Any(),schema,table,columnNamePattern);
139 catch(SQLException&)
141 xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eColumnPrivileges);
143 return xRef;
146 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns(
147 const Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern,
148 const OUString& columnNamePattern )
150 Reference< XResultSet > xRef;
153 rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(m_pConnection);
154 xRef = pResult;
155 pResult->openColumns(m_bUseCatalog ? catalog : Any(),schemaPattern,tableNamePattern,columnNamePattern);
157 catch(SQLException&)
159 xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eColumns);
161 return xRef;
164 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
165 const Any& catalog, const OUString& schemaPattern,
166 const OUString& tableNamePattern, const Sequence< OUString >& types )
168 Reference< XResultSet > xRef;
171 rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(m_pConnection);
172 xRef = pResult;
173 pResult->openTables(m_bUseCatalog ? catalog : Any(),schemaPattern,tableNamePattern,types);
175 catch(SQLException&)
177 xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTables);
179 return xRef;
182 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedureColumns(
183 const Any& catalog, const OUString& schemaPattern,
184 const OUString& procedureNamePattern, const OUString& columnNamePattern )
186 Reference< XResultSet > xRef;
189 rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(m_pConnection);
190 xRef = pResult;
191 pResult->openProcedureColumns(m_bUseCatalog ? catalog : Any(),schemaPattern,procedureNamePattern,columnNamePattern);
193 catch(SQLException&)
195 xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eProcedureColumns);
197 return xRef;
200 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedures(
201 const Any& catalog, const OUString& schemaPattern,
202 const OUString& procedureNamePattern )
204 Reference< XResultSet > xRef;
207 rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(m_pConnection);
208 xRef = pResult;
209 pResult->openProcedures(m_bUseCatalog ? catalog : Any(),schemaPattern,procedureNamePattern);
211 catch(SQLException&)
213 xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eProcedures);
215 return xRef;
218 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getVersionColumns(
219 const Any& catalog, const OUString& schema, const OUString& table )
221 Reference< XResultSet > xRef;
222 bool bSuccess = false;
225 if ( !m_pConnection->preventGetVersionColumns() )
227 rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(m_pConnection);
228 xRef = pResult;
229 pResult->openVersionColumns(m_bUseCatalog ? catalog : Any(),schema,table);
230 bSuccess = true;
233 catch(SQLException&)
237 if ( !bSuccess )
239 xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eVersionColumns);
242 return xRef;
245 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxBinaryLiteralLength( )
247 SQLUINTEGER nValue;
248 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_BINARY_LITERAL_LEN,nValue,*this);
249 return nValue;
252 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxRowSize( )
254 SQLUINTEGER nValue;
255 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_ROW_SIZE,nValue,*this);
256 return nValue;
259 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCatalogNameLength( )
261 SQLUSMALLINT nValue;
262 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_CATALOG_NAME_LEN,nValue,*this);
263 return nValue;
266 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCharLiteralLength( )
268 SQLUINTEGER nValue;
269 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_CHAR_LITERAL_LEN,nValue,*this);
270 return nValue;
273 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnNameLength( )
275 SQLUSMALLINT nValue;
276 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMN_NAME_LEN,nValue,*this);
277 return nValue;
280 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInIndex( )
282 SQLUSMALLINT nValue;
283 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMNS_IN_INDEX,nValue,*this);
284 return nValue;
287 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCursorNameLength( )
289 SQLUSMALLINT nValue;
290 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_CURSOR_NAME_LEN,nValue,*this);
291 return nValue;
294 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxConnections( )
296 SQLUSMALLINT nValue;
297 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_DRIVER_CONNECTIONS/*SQL_ACTIVE_CONNECTIONS*/,nValue,*this);
298 return nValue;
301 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInTable( )
303 SQLUSMALLINT nValue;
304 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMNS_IN_TABLE,nValue,*this);
305 return nValue;
308 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxStatementLength( )
310 SQLUINTEGER nValue;
311 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_STATEMENT_LEN,nValue,*this);
312 return nValue;
315 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxTableNameLength( )
317 SQLUSMALLINT nValue;
318 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_TABLE_NAME_LEN,nValue,*this);
319 return nValue;
322 sal_Int32 ODatabaseMetaData::impl_getMaxTablesInSelect_throw( )
324 SQLUSMALLINT nValue;
325 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_TABLES_IN_SELECT,nValue,*this);
326 return nValue;
329 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getExportedKeys(
330 const Any& catalog, const OUString& schema, const OUString& table )
332 Reference< XResultSet > xRef;
335 rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(m_pConnection);
336 xRef = pResult;
337 pResult->openExportedKeys(m_bUseCatalog ? catalog : Any(),schema,table);
339 catch(SQLException&)
341 xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eExportedKeys);
343 return xRef;
346 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getImportedKeys(
347 const Any& catalog, const OUString& schema, const OUString& table )
349 Reference< XResultSet > xRef;
352 rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(m_pConnection);
353 xRef = pResult;
354 pResult->openImportedKeys(m_bUseCatalog ? catalog : Any(),schema,table);
356 catch(SQLException&)
358 xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eImportedKeys);
360 return xRef;
363 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getPrimaryKeys(
364 const Any& catalog, const OUString& schema, const OUString& table )
366 Reference< XResultSet > xRef;
369 rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(m_pConnection);
370 xRef = pResult;
371 pResult->openPrimaryKeys(m_bUseCatalog ? catalog : Any(),schema,table);
373 catch(SQLException&)
375 xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::ePrimaryKeys);
377 return xRef;
380 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getIndexInfo(
381 const Any& catalog, const OUString& schema, const OUString& table,
382 sal_Bool unique, sal_Bool approximate )
384 Reference< XResultSet > xRef;
387 rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(m_pConnection);
388 xRef = pResult;
389 pResult->openIndexInfo(m_bUseCatalog ? catalog : Any(),schema,table,unique,approximate);
391 catch(SQLException&)
393 xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eIndexInfo);
395 return xRef;
398 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getBestRowIdentifier(
399 const Any& catalog, const OUString& schema, const OUString& table, sal_Int32 scope,
400 sal_Bool nullable )
402 Reference< XResultSet > xRef;
405 rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(m_pConnection);
406 xRef = pResult;
407 pResult->openBestRowIdentifier(m_bUseCatalog ? catalog : Any(),schema,table,scope,nullable);
409 catch(SQLException&)
411 xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eBestRowIdentifier);
413 return xRef;
416 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges(
417 const Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern )
419 if ( m_pConnection->isIgnoreDriverPrivilegesEnabled() )
421 return new OResultSetPrivileges(this,catalog,schemaPattern,tableNamePattern);
423 rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(m_pConnection);
424 pResult->openTablePrivileges(m_bUseCatalog ? catalog : Any(),schemaPattern,tableNamePattern);
425 return pResult;
428 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCrossReference(
429 const Any& primaryCatalog, const OUString& primarySchema,
430 const OUString& primaryTable, const Any& foreignCatalog,
431 const OUString& foreignSchema, const OUString& foreignTable )
433 Reference< XResultSet > xRef;
436 rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(m_pConnection);
437 xRef = pResult;
438 pResult->openForeignKeys(m_bUseCatalog ? primaryCatalog : Any(),primarySchema.toChar() == '%' ? &primarySchema : nullptr,&primaryTable,
439 m_bUseCatalog ? foreignCatalog : Any(), foreignSchema.toChar() == '%' ? &foreignSchema : nullptr,&foreignTable);
441 catch(SQLException&)
443 xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eCrossReference);
445 return xRef;
448 sal_Bool SAL_CALL ODatabaseMetaData::doesMaxRowSizeIncludeBlobs( )
450 OUString aVal;
451 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_ROW_SIZE_INCLUDES_LONG,aVal,*this,m_pConnection->getTextEncoding());
452 return aVal.toChar() == 'Y';
455 sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseQuotedIdentifiers( )
457 SQLUSMALLINT nValue;
458 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_QUOTED_IDENTIFIER_CASE,nValue,*this);
459 return nValue == SQL_IC_LOWER;
462 sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseIdentifiers( )
464 SQLUSMALLINT nValue;
465 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_IDENTIFIER_CASE,nValue,*this);
466 return nValue == SQL_IC_LOWER;
469 bool ODatabaseMetaData::impl_storesMixedCaseQuotedIdentifiers_throw( )
471 SQLUSMALLINT nValue;
472 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_QUOTED_IDENTIFIER_CASE,nValue,*this);
473 return nValue == SQL_IC_MIXED;
476 sal_Bool SAL_CALL ODatabaseMetaData::storesMixedCaseIdentifiers( )
478 SQLUSMALLINT nValue;
479 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_IDENTIFIER_CASE,nValue,*this);
480 return nValue == SQL_IC_MIXED;
483 sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseQuotedIdentifiers( )
485 SQLUSMALLINT nValue;
486 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_QUOTED_IDENTIFIER_CASE,nValue,*this);
487 return nValue == SQL_IC_UPPER;
490 sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseIdentifiers( )
492 SQLUSMALLINT nValue;
493 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_IDENTIFIER_CASE,nValue,*this);
494 return nValue == SQL_IC_UPPER;
497 bool ODatabaseMetaData::impl_supportsAlterTableWithAddColumn_throw( )
499 SQLUINTEGER nValue;
500 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ALTER_TABLE,nValue,*this);
501 return (nValue & SQL_AT_ADD_COLUMN) == SQL_AT_ADD_COLUMN;
504 bool ODatabaseMetaData::impl_supportsAlterTableWithDropColumn_throw( )
506 SQLUINTEGER nValue;
507 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ALTER_TABLE,nValue,*this);
508 return ((nValue & SQL_AT_DROP_COLUMN) == SQL_AT_DROP_COLUMN) ||
509 ((nValue & SQL_AT_DROP_COLUMN_CASCADE) == SQL_AT_DROP_COLUMN_CASCADE) ||
510 ((nValue & SQL_AT_DROP_COLUMN_RESTRICT) == SQL_AT_DROP_COLUMN_RESTRICT);
513 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxIndexLength( )
515 SQLUINTEGER nValue;
516 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_INDEX_SIZE,nValue,*this);
517 return nValue;
520 sal_Bool SAL_CALL ODatabaseMetaData::supportsNonNullableColumns( )
522 SQLUSMALLINT nValue;
523 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NON_NULLABLE_COLUMNS,nValue,*this);
524 return nValue == SQL_NNC_NON_NULL;
527 OUString SAL_CALL ODatabaseMetaData::getCatalogTerm( )
529 OUString aVal;
530 if(m_bUseCatalog)
531 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_TERM,aVal,*this,m_pConnection->getTextEncoding());
532 return aVal;
535 OUString ODatabaseMetaData::impl_getIdentifierQuoteString_throw( )
537 OUString aVal;
538 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_IDENTIFIER_QUOTE_CHAR,aVal,*this,m_pConnection->getTextEncoding());
539 return aVal;
542 OUString SAL_CALL ODatabaseMetaData::getExtraNameCharacters( )
544 OUString aVal;
545 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SPECIAL_CHARACTERS,aVal,*this,m_pConnection->getTextEncoding());
546 return aVal;
549 sal_Bool SAL_CALL ODatabaseMetaData::supportsDifferentTableCorrelationNames( )
551 SQLUSMALLINT nValue;
552 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
553 return nValue != SQL_CN_NONE;
556 bool ODatabaseMetaData::impl_isCatalogAtStart_throw( )
558 SQLUSMALLINT nValue=0;
559 if ( m_bUseCatalog )
560 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_LOCATION,nValue,*this);
561 return nValue == SQL_CL_START;
564 sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionIgnoredInTransactions( )
566 SQLUSMALLINT nValue;
567 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this);
568 return nValue == SQL_TC_DDL_IGNORE;
571 sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionCausesTransactionCommit( )
573 SQLUSMALLINT nValue;
574 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this);
575 return nValue == SQL_TC_DDL_COMMIT;
578 sal_Bool SAL_CALL ODatabaseMetaData::supportsDataManipulationTransactionsOnly( )
580 SQLUSMALLINT nValue;
581 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this);
582 return nValue == SQL_TC_DML;
585 sal_Bool SAL_CALL ODatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions( )
587 SQLUSMALLINT nValue;
588 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this);
589 return nValue == SQL_TC_ALL;
592 sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedDelete( )
594 SQLUINTEGER nValue;
595 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DYNAMIC_CURSOR_ATTRIBUTES1,nValue,*this);
596 return (nValue & SQL_CA1_POS_DELETE) == SQL_CA1_POS_DELETE;
599 sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedUpdate( )
601 SQLUINTEGER nValue;
602 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DYNAMIC_CURSOR_ATTRIBUTES1,nValue,*this);
603 return (nValue & SQL_CA1_POS_UPDATE) == SQL_CA1_POS_UPDATE;
606 sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossRollback( )
608 SQLUSMALLINT nValue;
609 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CURSOR_ROLLBACK_BEHAVIOR,nValue,*this);
610 return nValue == SQL_CB_PRESERVE || nValue == SQL_CB_CLOSE;
613 sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossCommit( )
615 SQLUSMALLINT nValue;
616 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CURSOR_COMMIT_BEHAVIOR,nValue,*this);
617 return nValue == SQL_CB_PRESERVE || nValue == SQL_CB_CLOSE;
620 sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossCommit( )
622 SQLUSMALLINT nValue;
623 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CURSOR_COMMIT_BEHAVIOR,nValue,*this);
624 return nValue == SQL_CB_PRESERVE;
627 sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossRollback( )
629 SQLUSMALLINT nValue;
630 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CURSOR_ROLLBACK_BEHAVIOR,nValue,*this);
631 return nValue == SQL_CB_PRESERVE;
634 sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactionIsolationLevel( sal_Int32 level )
636 SQLUINTEGER nValue;
637 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_ISOLATION_OPTION,nValue,*this);
638 return (nValue & static_cast<SQLUINTEGER>(level)) == static_cast<SQLUINTEGER>(level);
641 bool ODatabaseMetaData::impl_supportsSchemasInDataManipulation_throw( )
643 SQLUINTEGER nValue;
644 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this);
645 return (nValue & SQL_SU_DML_STATEMENTS) == SQL_SU_DML_STATEMENTS;
648 sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92FullSQL( )
650 SQLUINTEGER nValue;
651 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SQL_CONFORMANCE,nValue,*this);
652 return static_cast<bool>(nValue & SQL_SC_SQL92_FULL);
655 sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92EntryLevelSQL( )
657 SQLUINTEGER nValue;
658 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SQL_CONFORMANCE,nValue,*this);
659 return static_cast<bool>(nValue &SQL_SC_SQL92_ENTRY);
662 sal_Bool SAL_CALL ODatabaseMetaData::supportsIntegrityEnhancementFacility( )
664 OUString aStr;
665 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_INTEGRITY,aStr,*this,m_pConnection->getTextEncoding());
666 return aStr.toChar() == 'Y';
669 sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInIndexDefinitions( )
671 SQLUINTEGER nValue;
672 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this);
673 return (nValue & SQL_SU_INDEX_DEFINITION) == SQL_SU_INDEX_DEFINITION;
676 bool ODatabaseMetaData::impl_supportsSchemasInTableDefinitions_throw( )
678 SQLUINTEGER nValue;
679 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this);
680 return (nValue & SQL_SU_TABLE_DEFINITION) == SQL_SU_TABLE_DEFINITION;
683 bool ODatabaseMetaData::impl_supportsCatalogsInTableDefinitions_throw( )
685 SQLUINTEGER nValue=0;
686 if(m_bUseCatalog)
687 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this);
688 return (nValue & SQL_CU_TABLE_DEFINITION) == SQL_CU_TABLE_DEFINITION;
691 sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInIndexDefinitions( )
693 SQLUINTEGER nValue=0;
694 if(m_bUseCatalog)
695 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this);
696 return (nValue & SQL_CU_INDEX_DEFINITION) == SQL_CU_INDEX_DEFINITION;
699 bool ODatabaseMetaData::impl_supportsCatalogsInDataManipulation_throw( )
701 SQLUINTEGER nValue=0;
702 if(m_bUseCatalog)
703 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this);
704 return (nValue & SQL_CU_DML_STATEMENTS) == SQL_CU_DML_STATEMENTS;
707 sal_Bool SAL_CALL ODatabaseMetaData::supportsOuterJoins( )
709 SQLUINTEGER nValue;
710 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_OJ_CAPABILITIES,nValue,*this);
711 return ((nValue & (SQL_OJ_FULL|SQL_OJ_LEFT|SQL_OJ_RIGHT|SQL_OJ_NESTED|SQL_OJ_NOT_ORDERED|SQL_OJ_ALL_COMPARISON_OPS|SQL_OJ_INNER)) != 0);
714 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTableTypes( )
716 Reference< XResultSet > xRef;
719 rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(m_pConnection);
720 xRef = pResult;
721 pResult->openTablesTypes();
723 catch(SQLException&)
725 xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTableTypes);
727 return xRef;
730 sal_Int32 ODatabaseMetaData::impl_getMaxStatements_throw( )
732 SQLUSMALLINT nValue;
733 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_CONCURRENT_ACTIVITIES,nValue,*this);
734 return nValue;
737 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxProcedureNameLength( )
739 SQLUSMALLINT nValue;
740 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_PROCEDURE_NAME_LEN,nValue,*this);
741 return nValue;
744 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxSchemaNameLength( )
746 SQLUSMALLINT nValue;
747 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_SCHEMA_NAME_LEN,nValue,*this);
748 return nValue;
751 sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactions( )
753 SQLUSMALLINT nValue;
754 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this);
755 return nValue != SQL_TC_NONE;
758 sal_Bool SAL_CALL ODatabaseMetaData::allProceduresAreCallable( )
760 OUString aValue;
761 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ACCESSIBLE_PROCEDURES,aValue,*this,m_pConnection->getTextEncoding());
762 return aValue.toChar() == 'Y';
765 sal_Bool SAL_CALL ODatabaseMetaData::supportsStoredProcedures( )
767 OUString aValue;
768 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_PROCEDURES,aValue,*this,m_pConnection->getTextEncoding());
769 return aValue.toChar() == 'Y';
772 sal_Bool SAL_CALL ODatabaseMetaData::supportsSelectForUpdate( )
774 SQLUINTEGER nValue;
775 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DYNAMIC_CURSOR_ATTRIBUTES1,nValue,*this);
776 return (nValue & SQL_CA1_POSITIONED_UPDATE) == SQL_CA1_POSITIONED_UPDATE;
779 sal_Bool SAL_CALL ODatabaseMetaData::allTablesAreSelectable( )
781 OUString aValue;
782 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ACCESSIBLE_TABLES,aValue,*this,m_pConnection->getTextEncoding());
783 return aValue.toChar() == 'Y';
786 sal_Bool SAL_CALL ODatabaseMetaData::isReadOnly( )
788 return m_pConnection->isReadOnly();
791 sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFiles( )
793 SQLUSMALLINT nValue;
794 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_FILE_USAGE,nValue,*this);
795 return nValue == SQL_FILE_CATALOG;
798 sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFilePerTable( )
800 SQLUSMALLINT nValue;
801 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_FILE_USAGE,nValue,*this);
802 return nValue == SQL_FILE_TABLE;
805 sal_Bool SAL_CALL ODatabaseMetaData::supportsTypeConversion( )
807 SQLUINTEGER nValue;
808 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_FUNCTIONS,nValue,*this);
809 return (nValue & SQL_FN_CVT_CONVERT) == SQL_FN_CVT_CONVERT;
812 sal_Bool SAL_CALL ODatabaseMetaData::nullPlusNonNullIsNull( )
814 SQLUSMALLINT nValue;
815 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONCAT_NULL_BEHAVIOR,nValue,*this);
816 return nValue == SQL_CB_NULL;
819 sal_Bool SAL_CALL ODatabaseMetaData::supportsColumnAliasing( )
821 OUString aValue;
822 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_COLUMN_ALIAS,aValue,*this,m_pConnection->getTextEncoding());
823 return aValue.toChar() == 'Y';
826 sal_Bool SAL_CALL ODatabaseMetaData::supportsTableCorrelationNames( )
828 SQLUSMALLINT nValue;
829 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
830 return nValue != SQL_CN_NONE;
833 sal_Bool SAL_CALL ODatabaseMetaData::supportsConvert( sal_Int32 fromType, sal_Int32 toType )
835 if(fromType == toType)
836 return true;
838 SQLUINTEGER nValue=0;
839 switch(fromType)
841 case DataType::BIT:
842 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_BIT,nValue,*this);
843 break;
844 case DataType::TINYINT:
845 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_TINYINT,nValue,*this);
846 break;
847 case DataType::SMALLINT:
848 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_SMALLINT,nValue,*this);
849 break;
850 case DataType::INTEGER:
851 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_INTEGER,nValue,*this);
852 break;
853 case DataType::BIGINT:
854 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_BIGINT,nValue,*this);
855 break;
856 case DataType::FLOAT:
857 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_FLOAT,nValue,*this);
858 break;
859 case DataType::REAL:
860 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_REAL,nValue,*this);
861 break;
862 case DataType::DOUBLE:
863 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_DOUBLE,nValue,*this);
864 break;
865 case DataType::NUMERIC:
866 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_NUMERIC,nValue,*this);
867 break;
868 case DataType::DECIMAL:
869 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_DECIMAL,nValue,*this);
870 break;
871 case DataType::CHAR:
872 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_CHAR,nValue,*this);
873 break;
874 case DataType::VARCHAR:
875 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_VARCHAR,nValue,*this);
876 break;
877 case DataType::LONGVARCHAR:
878 case DataType::CLOB:
879 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_LONGVARCHAR,nValue,*this);
880 break;
881 case DataType::DATE:
882 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_DATE,nValue,*this);
883 break;
884 case DataType::TIME:
885 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_TIME,nValue,*this);
886 break;
887 case DataType::TIMESTAMP:
888 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_TIMESTAMP,nValue,*this);
889 break;
890 case DataType::BINARY:
891 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_BINARY,nValue,*this);
892 break;
893 case DataType::VARBINARY:
894 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_VARBINARY,nValue,*this);
895 break;
896 case DataType::LONGVARBINARY:
897 case DataType::BLOB:
898 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_LONGVARBINARY,nValue,*this);
899 break;
900 case DataType::SQLNULL:
901 // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
902 break;
903 case DataType::OTHER:
904 // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
905 break;
906 case DataType::OBJECT:
907 // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
908 break;
909 case DataType::DISTINCT:
910 // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
911 break;
912 case DataType::STRUCT:
913 // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
914 break;
915 case DataType::ARRAY:
916 // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
917 break;
918 case DataType::REF:
919 // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
920 break;
922 bool bConvert = false;
923 switch(toType)
925 case DataType::BIT:
926 bConvert = (nValue & SQL_CVT_BIT) == SQL_CVT_BIT;
927 break;
928 case DataType::TINYINT:
929 bConvert = (nValue & SQL_CVT_TINYINT) == SQL_CVT_TINYINT;
930 break;
931 case DataType::SMALLINT:
932 bConvert = (nValue & SQL_CVT_SMALLINT) == SQL_CVT_SMALLINT;
933 break;
934 case DataType::INTEGER:
935 bConvert = (nValue & SQL_CVT_INTEGER) == SQL_CVT_INTEGER;
936 break;
937 case DataType::BIGINT:
938 bConvert = (nValue & SQL_CVT_BIGINT) == SQL_CVT_BIGINT;
939 break;
940 case DataType::FLOAT:
941 bConvert = (nValue & SQL_CVT_FLOAT) == SQL_CVT_FLOAT;
942 break;
943 case DataType::REAL:
944 bConvert = (nValue & SQL_CVT_REAL) == SQL_CVT_REAL;
945 break;
946 case DataType::DOUBLE:
947 bConvert = (nValue & SQL_CVT_DOUBLE) == SQL_CVT_DOUBLE;
948 break;
949 case DataType::NUMERIC:
950 bConvert = (nValue & SQL_CVT_NUMERIC) == SQL_CVT_NUMERIC;
951 break;
952 case DataType::DECIMAL:
953 bConvert = (nValue & SQL_CVT_DECIMAL) == SQL_CVT_DECIMAL;
954 break;
955 case DataType::CHAR:
956 bConvert = (nValue & SQL_CVT_CHAR) == SQL_CVT_CHAR;
957 break;
958 case DataType::VARCHAR:
959 bConvert = (nValue & SQL_CVT_VARCHAR) == SQL_CVT_VARCHAR;
960 break;
961 case DataType::LONGVARCHAR:
962 case DataType::CLOB:
963 bConvert = (nValue & SQL_CVT_LONGVARCHAR) == SQL_CVT_LONGVARCHAR;
964 break;
965 case DataType::DATE:
966 bConvert = (nValue & SQL_CVT_DATE) == SQL_CVT_DATE;
967 break;
968 case DataType::TIME:
969 bConvert = (nValue & SQL_CVT_TIME) == SQL_CVT_TIME;
970 break;
971 case DataType::TIMESTAMP:
972 bConvert = (nValue & SQL_CVT_TIMESTAMP) == SQL_CVT_TIMESTAMP;
973 break;
974 case DataType::BINARY:
975 bConvert = (nValue & SQL_CVT_BINARY) == SQL_CVT_BINARY;
976 break;
977 case DataType::VARBINARY:
978 bConvert = (nValue & SQL_CVT_VARBINARY) == SQL_CVT_VARBINARY;
979 break;
980 case DataType::LONGVARBINARY:
981 case DataType::BLOB:
982 bConvert = (nValue & SQL_CVT_LONGVARBINARY) == SQL_CVT_LONGVARBINARY;
983 break;
986 return bConvert;
989 sal_Bool SAL_CALL ODatabaseMetaData::supportsExpressionsInOrderBy( )
991 OUString aValue;
992 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_EXPRESSIONS_IN_ORDERBY,aValue,*this,m_pConnection->getTextEncoding());
993 return aValue.toChar() == 'Y';
996 sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupBy( )
998 SQLUSMALLINT nValue;
999 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_GROUP_BY,nValue,*this);
1000 return nValue != SQL_GB_NOT_SUPPORTED;
1003 sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByBeyondSelect( )
1005 SQLUSMALLINT nValue;
1006 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_GROUP_BY,nValue,*this);
1007 return nValue != SQL_GB_GROUP_BY_CONTAINS_SELECT;
1010 sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByUnrelated( )
1012 SQLUSMALLINT nValue;
1013 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_GROUP_BY,nValue,*this);
1014 return nValue == SQL_GB_NO_RELATION;
1017 sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleTransactions( )
1019 OUString aValue;
1020 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MULTIPLE_ACTIVE_TXN,aValue,*this,m_pConnection->getTextEncoding());
1021 return aValue.toChar() == 'Y';
1024 sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleResultSets( )
1026 OUString aValue;
1027 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MULT_RESULT_SETS,aValue,*this,m_pConnection->getTextEncoding());
1028 return aValue.toChar() == 'Y';
1031 sal_Bool SAL_CALL ODatabaseMetaData::supportsLikeEscapeClause( )
1033 OUString aValue;
1034 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_LIKE_ESCAPE_CLAUSE,aValue,*this,m_pConnection->getTextEncoding());
1035 return aValue.toChar() == 'Y';
1038 sal_Bool SAL_CALL ODatabaseMetaData::supportsOrderByUnrelated( )
1040 OUString aValue;
1041 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ORDER_BY_COLUMNS_IN_SELECT,aValue,*this,m_pConnection->getTextEncoding());
1042 return aValue.toChar() == 'N';
1045 sal_Bool SAL_CALL ODatabaseMetaData::supportsUnion( )
1047 SQLUINTEGER nValue;
1048 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_UNION,nValue,*this);
1049 return (nValue & SQL_U_UNION) == SQL_U_UNION;
1052 sal_Bool SAL_CALL ODatabaseMetaData::supportsUnionAll( )
1054 SQLUINTEGER nValue;
1055 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_UNION,nValue,*this);
1056 return (nValue & SQL_U_UNION_ALL) == SQL_U_UNION_ALL;
1059 sal_Bool SAL_CALL ODatabaseMetaData::supportsMixedCaseIdentifiers( )
1061 SQLUSMALLINT nValue;
1062 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_IDENTIFIER_CASE,nValue,*this);
1063 return nValue == SQL_IC_MIXED;
1066 bool ODatabaseMetaData::impl_supportsMixedCaseQuotedIdentifiers_throw( )
1068 SQLUSMALLINT nValue;
1069 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_QUOTED_IDENTIFIER_CASE,nValue,*this);
1070 return nValue == SQL_IC_MIXED;
1073 sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtEnd( )
1075 SQLUSMALLINT nValue;
1076 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NULL_COLLATION,nValue,*this);
1077 return nValue == SQL_NC_END;
1080 sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtStart( )
1082 SQLUSMALLINT nValue;
1083 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NULL_COLLATION,nValue,*this);
1084 return nValue == SQL_NC_START;
1087 sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedHigh( )
1089 SQLUSMALLINT nValue;
1090 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NULL_COLLATION,nValue,*this);
1091 return nValue == SQL_NC_HIGH;
1094 sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedLow( )
1096 SQLUSMALLINT nValue;
1097 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NULL_COLLATION,nValue,*this);
1098 return nValue == SQL_NC_LOW;
1101 sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInProcedureCalls( )
1103 SQLUINTEGER nValue;
1104 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this);
1105 return (nValue & SQL_SU_PROCEDURE_INVOCATION) == SQL_SU_PROCEDURE_INVOCATION;
1108 sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInPrivilegeDefinitions( )
1110 SQLUINTEGER nValue;
1111 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this);
1112 return (nValue & SQL_SU_PRIVILEGE_DEFINITION) == SQL_SU_PRIVILEGE_DEFINITION;
1115 sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInProcedureCalls( )
1117 SQLUINTEGER nValue=0;
1118 if(m_bUseCatalog)
1119 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this);
1120 return (nValue & SQL_CU_PROCEDURE_INVOCATION) == SQL_CU_PROCEDURE_INVOCATION;
1123 sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInPrivilegeDefinitions( )
1125 SQLUINTEGER nValue=0;
1126 if(m_bUseCatalog)
1127 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this);
1128 return (nValue & SQL_CU_PRIVILEGE_DEFINITION) == SQL_CU_PRIVILEGE_DEFINITION;
1131 sal_Bool SAL_CALL ODatabaseMetaData::supportsCorrelatedSubqueries( )
1133 SQLUINTEGER nValue;
1134 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
1135 return (nValue & SQL_SQ_CORRELATED_SUBQUERIES) == SQL_SQ_CORRELATED_SUBQUERIES;
1138 sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInComparisons( )
1140 SQLUINTEGER nValue;
1141 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
1142 return (nValue & SQL_SQ_COMPARISON) == SQL_SQ_COMPARISON;
1145 sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInExists( )
1147 SQLUINTEGER nValue;
1148 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
1149 return (nValue & SQL_SQ_EXISTS) == SQL_SQ_EXISTS;
1152 sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInIns( )
1154 SQLUINTEGER nValue;
1155 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
1156 return (nValue & SQL_SQ_IN) == SQL_SQ_IN;
1159 sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInQuantifieds( )
1161 SQLUINTEGER nValue;
1162 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
1163 return (nValue & SQL_SQ_QUANTIFIED) == SQL_SQ_QUANTIFIED;
1166 sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92IntermediateSQL( )
1168 SQLUINTEGER nValue;
1169 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SQL_CONFORMANCE,nValue,*this);
1170 return static_cast<bool>(nValue & SQL_SC_SQL92_INTERMEDIATE);
1173 OUString ODatabaseMetaData::getURLImpl()
1175 OUString aValue;
1176 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DATA_SOURCE_NAME,aValue,*this,m_pConnection->getTextEncoding());
1177 return aValue;
1180 OUString SAL_CALL ODatabaseMetaData::getURL( )
1182 OUString aValue = m_pConnection->getURL();
1183 if ( aValue.isEmpty() )
1185 aValue = "sdbc:odbc:" + getURLImpl();
1187 return aValue;
1190 OUString SAL_CALL ODatabaseMetaData::getUserName( )
1192 OUString aValue;
1193 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_USER_NAME,aValue,*this,m_pConnection->getTextEncoding());
1194 return aValue;
1197 OUString SAL_CALL ODatabaseMetaData::getDriverName( )
1199 OUString aValue;
1200 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_NAME,aValue,*this,m_pConnection->getTextEncoding());
1201 return aValue;
1204 OUString SAL_CALL ODatabaseMetaData::getDriverVersion()
1206 OUString aValue;
1207 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_ODBC_VER,aValue,*this,m_pConnection->getTextEncoding());
1208 return aValue;
1211 OUString SAL_CALL ODatabaseMetaData::getDatabaseProductVersion( )
1213 OUString aValue;
1214 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_VER,aValue,*this,m_pConnection->getTextEncoding());
1215 return aValue;
1218 OUString SAL_CALL ODatabaseMetaData::getDatabaseProductName( )
1220 OUString aValue;
1221 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DBMS_NAME,aValue,*this,m_pConnection->getTextEncoding());
1222 return aValue;
1225 OUString SAL_CALL ODatabaseMetaData::getProcedureTerm( )
1227 OUString aValue;
1228 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_PROCEDURE_TERM,aValue,*this,m_pConnection->getTextEncoding());
1229 return aValue;
1232 OUString SAL_CALL ODatabaseMetaData::getSchemaTerm( )
1234 OUString aValue;
1235 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_TERM,aValue,*this,m_pConnection->getTextEncoding());
1236 return aValue;
1239 sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMajorVersion( ) try
1241 OUString aValue;
1242 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_VER,aValue,*this,m_pConnection->getTextEncoding());
1243 return o3tl::toInt32(aValue.subView(0,aValue.indexOf('.')));
1245 catch (const SQLException &)
1247 return 0;
1250 sal_Int32 SAL_CALL ODatabaseMetaData::getDefaultTransactionIsolation( )
1252 SQLUINTEGER nValue;
1253 sal_Int32 nValueTranslated;
1254 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DEFAULT_TXN_ISOLATION,nValue,*this);
1255 switch(nValue)
1257 case SQL_TXN_READ_UNCOMMITTED:
1258 nValueTranslated = css::sdbc::TransactionIsolation::READ_UNCOMMITTED;
1259 break;
1260 case SQL_TXN_READ_COMMITTED:
1261 nValueTranslated = css::sdbc::TransactionIsolation::READ_COMMITTED;
1262 break;
1263 case SQL_TXN_REPEATABLE_READ:
1264 nValueTranslated = css::sdbc::TransactionIsolation::REPEATABLE_READ;
1265 break;
1266 case SQL_TXN_SERIALIZABLE:
1267 nValueTranslated = css::sdbc::TransactionIsolation::SERIALIZABLE;
1268 break;
1269 default:
1270 nValueTranslated = 0;
1272 return nValueTranslated;
1275 sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion( ) try
1277 OUString aValue;
1278 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_VER,aValue,*this,m_pConnection->getTextEncoding());
1279 return o3tl::toInt32(aValue.subView(0,aValue.lastIndexOf('.')));
1281 catch (const SQLException &)
1283 return 0;
1286 OUString SAL_CALL ODatabaseMetaData::getSQLKeywords( )
1288 OUString aValue;
1289 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_KEYWORDS,aValue,*this,m_pConnection->getTextEncoding());
1290 return aValue;
1293 OUString SAL_CALL ODatabaseMetaData::getSearchStringEscape( )
1295 OUString aValue;
1296 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SEARCH_PATTERN_ESCAPE,aValue,*this,m_pConnection->getTextEncoding());
1297 return aValue;
1300 OUString SAL_CALL ODatabaseMetaData::getStringFunctions( )
1302 SQLUINTEGER nValue;
1303 OUStringBuffer aValue;
1304 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_STRING_FUNCTIONS,nValue,*this);
1305 if(nValue & SQL_FN_STR_ASCII)
1306 aValue.append("ASCII,");
1307 if(nValue & SQL_FN_STR_BIT_LENGTH)
1308 aValue.append("BIT_LENGTH,");
1309 if(nValue & SQL_FN_STR_CHAR)
1310 aValue.append("CHAR,");
1311 if(nValue & SQL_FN_STR_CHAR_LENGTH)
1312 aValue.append("CHAR_LENGTH,");
1313 if(nValue & SQL_FN_STR_CHARACTER_LENGTH)
1314 aValue.append("CHARACTER_LENGTH,");
1315 if(nValue & SQL_FN_STR_CONCAT)
1316 aValue.append("CONCAT,");
1317 if(nValue & SQL_FN_STR_DIFFERENCE)
1318 aValue.append("DIFFERENCE,");
1319 if(nValue & SQL_FN_STR_INSERT)
1320 aValue.append("INSERT,");
1321 if(nValue & SQL_FN_STR_LCASE)
1322 aValue.append("LCASE,");
1323 if(nValue & SQL_FN_STR_LEFT)
1324 aValue.append("LEFT,");
1325 if(nValue & SQL_FN_STR_LENGTH)
1326 aValue.append("LENGTH,");
1327 if(nValue & SQL_FN_STR_LOCATE)
1328 aValue.append("LOCATE,");
1329 if(nValue & SQL_FN_STR_LOCATE_2)
1330 aValue.append("LOCATE_2,");
1331 if(nValue & SQL_FN_STR_LTRIM)
1332 aValue.append("LTRIM,");
1333 if(nValue & SQL_FN_STR_OCTET_LENGTH)
1334 aValue.append("OCTET_LENGTH,");
1335 if(nValue & SQL_FN_STR_POSITION)
1336 aValue.append("POSITION,");
1337 if(nValue & SQL_FN_STR_REPEAT)
1338 aValue.append("REPEAT,");
1339 if(nValue & SQL_FN_STR_REPLACE)
1340 aValue.append("REPLACE,");
1341 if(nValue & SQL_FN_STR_RIGHT)
1342 aValue.append("RIGHT,");
1343 if(nValue & SQL_FN_STR_RTRIM)
1344 aValue.append("RTRIM,");
1345 if(nValue & SQL_FN_STR_SOUNDEX)
1346 aValue.append("SOUNDEX,");
1347 if(nValue & SQL_FN_STR_SPACE)
1348 aValue.append("SPACE,");
1349 if(nValue & SQL_FN_STR_SUBSTRING)
1350 aValue.append("SUBSTRING,");
1351 if(nValue & SQL_FN_STR_UCASE)
1352 aValue.append("UCASE,");
1355 if ( !aValue.isEmpty() )
1356 aValue.setLength(aValue.getLength()-1);
1358 return aValue.makeStringAndClear();
1361 OUString SAL_CALL ODatabaseMetaData::getTimeDateFunctions( )
1363 SQLUINTEGER nValue;
1364 OUStringBuffer aValue;
1365 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TIMEDATE_FUNCTIONS,nValue,*this);
1367 if(nValue & SQL_FN_TD_CURRENT_DATE)
1368 aValue.append("CURRENT_DATE,");
1369 if(nValue & SQL_FN_TD_CURRENT_TIME)
1370 aValue.append("CURRENT_TIME,");
1371 if(nValue & SQL_FN_TD_CURRENT_TIMESTAMP)
1372 aValue.append("CURRENT_TIMESTAMP,");
1373 if(nValue & SQL_FN_TD_CURDATE)
1374 aValue.append("CURDATE,");
1375 if(nValue & SQL_FN_TD_CURTIME)
1376 aValue.append("CURTIME,");
1377 if(nValue & SQL_FN_TD_DAYNAME)
1378 aValue.append("DAYNAME,");
1379 if(nValue & SQL_FN_TD_DAYOFMONTH)
1380 aValue.append("DAYOFMONTH,");
1381 if(nValue & SQL_FN_TD_DAYOFWEEK)
1382 aValue.append("DAYOFWEEK,");
1383 if(nValue & SQL_FN_TD_DAYOFYEAR)
1384 aValue.append("DAYOFYEAR,");
1385 if(nValue & SQL_FN_TD_EXTRACT)
1386 aValue.append("EXTRACT,");
1387 if(nValue & SQL_FN_TD_HOUR)
1388 aValue.append("HOUR,");
1389 if(nValue & SQL_FN_TD_MINUTE)
1390 aValue.append("MINUTE,");
1391 if(nValue & SQL_FN_TD_MONTH)
1392 aValue.append("MONTH,");
1393 if(nValue & SQL_FN_TD_MONTHNAME)
1394 aValue.append("MONTHNAME,");
1395 if(nValue & SQL_FN_TD_NOW)
1396 aValue.append("NOW,");
1397 if(nValue & SQL_FN_TD_QUARTER)
1398 aValue.append("QUARTER,");
1399 if(nValue & SQL_FN_TD_SECOND)
1400 aValue.append("SECOND,");
1401 if(nValue & SQL_FN_TD_TIMESTAMPADD)
1402 aValue.append("TIMESTAMPADD,");
1403 if(nValue & SQL_FN_TD_TIMESTAMPDIFF)
1404 aValue.append("TIMESTAMPDIFF,");
1405 if(nValue & SQL_FN_TD_WEEK)
1406 aValue.append("WEEK,");
1407 if(nValue & SQL_FN_TD_YEAR)
1408 aValue.append("YEAR,");
1410 if ( !aValue.isEmpty() )
1411 aValue.setLength(aValue.getLength()-1);
1413 return aValue.makeStringAndClear();
1416 OUString SAL_CALL ODatabaseMetaData::getSystemFunctions( )
1418 SQLUINTEGER nValue;
1419 OUStringBuffer aValue;
1420 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SYSTEM_FUNCTIONS,nValue,*this);
1422 if(nValue & SQL_FN_SYS_DBNAME)
1423 aValue.append("DBNAME,");
1424 if(nValue & SQL_FN_SYS_IFNULL)
1425 aValue.append("IFNULL,");
1426 if(nValue & SQL_FN_SYS_USERNAME)
1427 aValue.append("USERNAME,");
1429 if ( !aValue.isEmpty() )
1430 aValue.setLength(aValue.getLength()-1);
1432 return aValue.makeStringAndClear();
1435 OUString SAL_CALL ODatabaseMetaData::getNumericFunctions( )
1437 SQLUINTEGER nValue;
1438 OUStringBuffer aValue;
1439 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NUMERIC_FUNCTIONS,nValue,*this);
1441 if(nValue & SQL_FN_NUM_ABS)
1442 aValue.append("ABS,");
1443 if(nValue & SQL_FN_NUM_ACOS)
1444 aValue.append("ACOS,");
1445 if(nValue & SQL_FN_NUM_ASIN)
1446 aValue.append("ASIN,");
1447 if(nValue & SQL_FN_NUM_ATAN)
1448 aValue.append("ATAN,");
1449 if(nValue & SQL_FN_NUM_ATAN2)
1450 aValue.append("ATAN2,");
1451 if(nValue & SQL_FN_NUM_CEILING)
1452 aValue.append("CEILING,");
1453 if(nValue & SQL_FN_NUM_COS)
1454 aValue.append("COS,");
1455 if(nValue & SQL_FN_NUM_COT)
1456 aValue.append("COT,");
1457 if(nValue & SQL_FN_NUM_DEGREES)
1458 aValue.append("DEGREES,");
1459 if(nValue & SQL_FN_NUM_EXP)
1460 aValue.append("EXP,");
1461 if(nValue & SQL_FN_NUM_FLOOR)
1462 aValue.append("FLOOR,");
1463 if(nValue & SQL_FN_NUM_LOG)
1464 aValue.append("LOGF,");
1465 if(nValue & SQL_FN_NUM_LOG10)
1466 aValue.append("LOG10,");
1467 if(nValue & SQL_FN_NUM_MOD)
1468 aValue.append("MOD,");
1469 if(nValue & SQL_FN_NUM_PI)
1470 aValue.append("PI,");
1471 if(nValue & SQL_FN_NUM_POWER)
1472 aValue.append("POWER,");
1473 if(nValue & SQL_FN_NUM_RADIANS)
1474 aValue.append("RADIANS,");
1475 if(nValue & SQL_FN_NUM_RAND)
1476 aValue.append("RAND,");
1477 if(nValue & SQL_FN_NUM_ROUND)
1478 aValue.append("ROUND,");
1479 if(nValue & SQL_FN_NUM_SIGN)
1480 aValue.append("SIGN,");
1481 if(nValue & SQL_FN_NUM_SIN)
1482 aValue.append("SIN,");
1483 if(nValue & SQL_FN_NUM_SQRT)
1484 aValue.append("SQRT,");
1485 if(nValue & SQL_FN_NUM_TAN)
1486 aValue.append("TAN,");
1487 if(nValue & SQL_FN_NUM_TRUNCATE)
1488 aValue.append("TRUNCATE,");
1490 if ( !aValue.isEmpty() )
1491 aValue.setLength(aValue.getLength()-1);
1493 return aValue.makeStringAndClear();
1496 sal_Bool SAL_CALL ODatabaseMetaData::supportsExtendedSQLGrammar( )
1498 SQLUINTEGER nValue;
1499 // SQL_ODBC_SQL_CONFORMANCE is deprecated in ODBC 3.x, but there does not seem te be any equivalent.
1500 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ODBC_SQL_CONFORMANCE,nValue,*this);
1501 SAL_WARN_IF(! (nValue == SQL_OSC_MINIMUM || nValue == SQL_OSC_CORE || nValue == SQL_OSC_EXTENDED),
1502 "connectivity.odbc",
1503 "SQL_ODBC_SQL_CONFORMANCE is neither MINIMAL nor CORE nor EXTENDED");
1504 return nValue == SQL_OSC_EXTENDED;
1507 sal_Bool SAL_CALL ODatabaseMetaData::supportsCoreSQLGrammar( )
1509 SQLUINTEGER nValue;
1510 // SQL_ODBC_SQL_CONFORMANCE is deprecated in ODBC 3.x, but there does not seem te be any equivalent.
1511 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ODBC_SQL_CONFORMANCE,nValue,*this);
1512 SAL_WARN_IF(! (nValue == SQL_OSC_MINIMUM || nValue == SQL_OSC_CORE || nValue == SQL_OSC_EXTENDED),
1513 "connectivity.odbc",
1514 "SQL_ODBC_SQL_CONFORMANCE is neither MINIMAL nor CORE nor EXTENDED");
1515 return nValue == SQL_OSC_CORE || nValue == SQL_OSC_EXTENDED;
1518 sal_Bool SAL_CALL ODatabaseMetaData::supportsMinimumSQLGrammar( )
1520 SQLUINTEGER nValue;
1521 // SQL_ODBC_SQL_CONFORMANCE is deprecated in ODBC 3.x, but there does not seem te be any equivalent.
1522 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ODBC_SQL_CONFORMANCE,nValue,*this);
1523 SAL_WARN_IF(! (nValue == SQL_OSC_MINIMUM || nValue == SQL_OSC_CORE || nValue == SQL_OSC_EXTENDED),
1524 "connectivity.odbc",
1525 "SQL_ODBC_SQL_CONFORMANCE is neither MINIMAL nor CORE nor EXTENDED");
1526 return nValue == SQL_OSC_MINIMUM || nValue == SQL_OSC_CORE || nValue == SQL_OSC_EXTENDED;
1529 sal_Bool SAL_CALL ODatabaseMetaData::supportsFullOuterJoins( )
1531 SQLUINTEGER nValue;
1532 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_OJ_CAPABILITIES,nValue,*this);
1533 return (nValue & SQL_OJ_FULL) == SQL_OJ_FULL;
1536 sal_Bool SAL_CALL ODatabaseMetaData::supportsLimitedOuterJoins( )
1538 return supportsFullOuterJoins( );
1541 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInGroupBy( )
1543 SQLUSMALLINT nValue;
1544 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMNS_IN_GROUP_BY,nValue,*this);
1545 return nValue;
1548 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInOrderBy( )
1550 SQLUSMALLINT nValue;
1551 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMNS_IN_ORDER_BY,nValue,*this);
1552 return nValue;
1555 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInSelect( )
1557 SQLUSMALLINT nValue;
1558 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMNS_IN_SELECT,nValue,*this);
1559 return nValue;
1562 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxUserNameLength( )
1564 SQLUSMALLINT nValue;
1565 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_USER_NAME_LEN,nValue,*this);
1566 return nValue;
1569 sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetType( sal_Int32 setType )
1571 SQLUINTEGER nValue;
1572 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CURSOR_SENSITIVITY,nValue,*this);
1573 return (nValue & static_cast<SQLUINTEGER>(setType)) == static_cast<SQLUINTEGER>(setType);
1576 sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 concurrency )
1578 SQLUINTEGER nValue;
1579 SQLUSMALLINT nAskFor( SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 );
1580 switch(setType)
1582 default:
1583 case ResultSetType::FORWARD_ONLY:
1584 nAskFor = SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2;
1585 break;
1586 case ResultSetType::SCROLL_INSENSITIVE:
1587 nAskFor = SQL_STATIC_CURSOR_ATTRIBUTES2;
1588 break;
1589 case ResultSetType::SCROLL_SENSITIVE:
1590 nAskFor = SQL_DYNAMIC_CURSOR_ATTRIBUTES2;
1591 break;
1594 OTools::GetInfo(m_pConnection,m_aConnectionHandle,nAskFor,nValue,*this);
1595 bool bRet = false;
1596 switch(concurrency)
1598 case ResultSetConcurrency::READ_ONLY:
1599 bRet = (nValue & SQL_CA2_READ_ONLY_CONCURRENCY) == SQL_CA2_READ_ONLY_CONCURRENCY;
1600 break;
1601 case ResultSetConcurrency::UPDATABLE:
1602 bRet = (nValue & SQL_CA2_OPT_VALUES_CONCURRENCY) == SQL_CA2_OPT_VALUES_CONCURRENCY;
1603 break;
1605 return bRet;
1608 sal_Bool SAL_CALL ODatabaseMetaData::ownUpdatesAreVisible( sal_Int32 setType )
1610 SQLUINTEGER nValue;
1611 SQLUSMALLINT nAskFor( SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 );
1612 switch(setType)
1614 default:
1615 case ResultSetType::FORWARD_ONLY:
1616 nAskFor = SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2;
1617 break;
1618 case ResultSetType::SCROLL_INSENSITIVE:
1619 nAskFor = SQL_STATIC_CURSOR_ATTRIBUTES2;
1620 break;
1621 case ResultSetType::SCROLL_SENSITIVE:
1622 nAskFor = SQL_DYNAMIC_CURSOR_ATTRIBUTES2;
1623 break;
1626 OTools::GetInfo(m_pConnection,m_aConnectionHandle,nAskFor,nValue,*this);
1627 return (nValue & SQL_CA2_SENSITIVITY_UPDATES) == SQL_CA2_SENSITIVITY_UPDATES;
1630 sal_Bool SAL_CALL ODatabaseMetaData::ownDeletesAreVisible( sal_Int32 setType )
1632 SQLUINTEGER nValue;
1633 SQLUSMALLINT nAskFor( SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 );
1634 switch(setType)
1636 default:
1637 case ResultSetType::FORWARD_ONLY:
1638 nAskFor = SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2;
1639 break;
1640 case ResultSetType::SCROLL_INSENSITIVE:
1641 nAskFor = SQL_STATIC_CURSOR_ATTRIBUTES2;
1642 break;
1643 case ResultSetType::SCROLL_SENSITIVE:
1644 nAskFor = SQL_DYNAMIC_CURSOR_ATTRIBUTES2;
1645 break;
1648 OTools::GetInfo(m_pConnection,m_aConnectionHandle,nAskFor,nValue,*this);
1649 return (nValue & SQL_CA2_SENSITIVITY_DELETIONS) != SQL_CA2_SENSITIVITY_DELETIONS;
1652 sal_Bool SAL_CALL ODatabaseMetaData::ownInsertsAreVisible( sal_Int32 setType )
1654 SQLUINTEGER nValue;
1655 SQLUSMALLINT nAskFor( SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 );
1656 switch(setType)
1658 default:
1659 case ResultSetType::FORWARD_ONLY:
1660 nAskFor = SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2;
1661 break;
1662 case ResultSetType::SCROLL_INSENSITIVE:
1663 nAskFor = SQL_STATIC_CURSOR_ATTRIBUTES2;
1664 break;
1665 case ResultSetType::SCROLL_SENSITIVE:
1666 nAskFor = SQL_DYNAMIC_CURSOR_ATTRIBUTES2;
1667 break;
1670 OTools::GetInfo(m_pConnection,m_aConnectionHandle,nAskFor,nValue,*this);
1671 return (nValue & SQL_CA2_SENSITIVITY_ADDITIONS) == SQL_CA2_SENSITIVITY_ADDITIONS;
1674 sal_Bool SAL_CALL ODatabaseMetaData::othersUpdatesAreVisible( sal_Int32 setType )
1676 return ownUpdatesAreVisible(setType);
1679 sal_Bool SAL_CALL ODatabaseMetaData::othersDeletesAreVisible( sal_Int32 setType )
1681 return ownDeletesAreVisible(setType);
1684 sal_Bool SAL_CALL ODatabaseMetaData::othersInsertsAreVisible( sal_Int32 setType )
1686 return ownInsertsAreVisible(setType);
1689 sal_Bool SAL_CALL ODatabaseMetaData::updatesAreDetected( sal_Int32 /*setType*/ )
1691 return false;
1694 sal_Bool SAL_CALL ODatabaseMetaData::deletesAreDetected( sal_Int32 /*setType*/ )
1696 return false;
1699 sal_Bool SAL_CALL ODatabaseMetaData::insertsAreDetected( sal_Int32 /*setType*/ )
1701 return false;
1704 sal_Bool SAL_CALL ODatabaseMetaData::supportsBatchUpdates( )
1706 return false;
1709 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getUDTs( const Any& /*catalog*/, const OUString& /*schemaPattern*/, const OUString& /*typeNamePattern*/, const Sequence< sal_Int32 >& /*types*/ )
1711 return nullptr;
1715 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */