1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 "odbc/OFunctiondefs.hxx"
30 #include "TPrivilegesResultSet.hxx"
31 #include <connectivity/dbexception.hxx>
32 #include <rtl/ustrbuf.hxx>
34 using namespace connectivity::odbc
;
35 using namespace com::sun::star::uno
;
36 using namespace com::sun::star::lang
;
37 using namespace com::sun::star::beans
;
38 using namespace com::sun::star::sdbc
;
40 ODatabaseMetaData::ODatabaseMetaData(const SQLHANDLE _pHandle
,OConnection
* _pCon
)
41 : ::connectivity::ODatabaseMetaDataBase(_pCon
,_pCon
->getConnectionInfo())
42 ,m_aConnectionHandle(_pHandle
)
47 OSL_ENSURE(m_pConnection
,"ODatabaseMetaData::ODatabaseMetaData: No connection set!");
48 if(!m_pConnection
->isCatalogUsed())
50 osl_atomic_increment( &m_refCount
);
53 m_bUseCatalog
= !(usesLocalFiles() || usesLocalFilePerTable());
54 OUString sVersion
= getDriverVersion();
55 m_bOdbc3
= sVersion
!= "02.50" && sVersion
!= "02.00";
58 { // doesn't matter here
60 osl_atomic_decrement( &m_refCount
);
64 ODatabaseMetaData::~ODatabaseMetaData()
68 Reference
< XResultSet
> ODatabaseMetaData::impl_getTypeInfo_throw( )
70 Reference
< XResultSet
> xRef
;
73 ODatabaseMetaDataResultSet
* pResult
= new ODatabaseMetaDataResultSet(m_pConnection
);
75 pResult
->openTypeInfo();
79 xRef
= new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTypeInfo
);
85 Reference
< XResultSet
> SAL_CALL
ODatabaseMetaData::getCatalogs( ) throw(SQLException
, RuntimeException
, std::exception
)
87 Reference
< XResultSet
> xRef
;
90 xRef
= new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eCatalogs
);
96 ODatabaseMetaDataResultSet
* pResult
= new ODatabaseMetaDataResultSet(m_pConnection
);
98 pResult
->openCatalogs();
102 xRef
= new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eCatalogs
);
109 OUString
ODatabaseMetaData::impl_getCatalogSeparator_throw( )
113 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CATALOG_NAME_SEPARATOR
,aVal
,*this,m_pConnection
->getTextEncoding());
118 Reference
< XResultSet
> SAL_CALL
ODatabaseMetaData::getSchemas( ) throw(SQLException
, RuntimeException
, std::exception
)
120 Reference
< XResultSet
> xRef
;
123 ODatabaseMetaDataResultSet
* pResult
= new ODatabaseMetaDataResultSet(m_pConnection
);
125 pResult
->openSchemas();
129 xRef
= new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eSchemas
);
134 Reference
< XResultSet
> SAL_CALL
ODatabaseMetaData::getColumnPrivileges(
135 const Any
& catalog
, const OUString
& schema
, const OUString
& table
,
136 const OUString
& columnNamePattern
) throw(SQLException
, RuntimeException
, std::exception
)
138 Reference
< XResultSet
> xRef
;
141 ODatabaseMetaDataResultSet
* pResult
= new ODatabaseMetaDataResultSet(m_pConnection
);
143 pResult
->openColumnPrivileges(m_bUseCatalog
? catalog
: Any(),schema
,table
,columnNamePattern
);
147 xRef
= new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eColumnPrivileges
);
152 Reference
< XResultSet
> SAL_CALL
ODatabaseMetaData::getColumns(
153 const Any
& catalog
, const OUString
& schemaPattern
, const OUString
& tableNamePattern
,
154 const OUString
& columnNamePattern
) throw(SQLException
, RuntimeException
, std::exception
)
156 Reference
< XResultSet
> xRef
;
159 ODatabaseMetaDataResultSet
* pResult
= new ODatabaseMetaDataResultSet(m_pConnection
);
161 pResult
->openColumns(m_bUseCatalog
? catalog
: Any(),schemaPattern
,tableNamePattern
,columnNamePattern
);
165 xRef
= new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eColumns
);
170 Reference
< XResultSet
> SAL_CALL
ODatabaseMetaData::getTables(
171 const Any
& catalog
, const OUString
& schemaPattern
,
172 const OUString
& tableNamePattern
, const Sequence
< OUString
>& types
) throw(SQLException
, RuntimeException
, std::exception
)
174 Reference
< XResultSet
> xRef
;
177 ODatabaseMetaDataResultSet
* pResult
= new ODatabaseMetaDataResultSet(m_pConnection
);
179 pResult
->openTables(m_bUseCatalog
? catalog
: Any(),schemaPattern
,tableNamePattern
,types
);
183 xRef
= new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTables
);
188 Reference
< XResultSet
> SAL_CALL
ODatabaseMetaData::getProcedureColumns(
189 const Any
& catalog
, const OUString
& schemaPattern
,
190 const OUString
& procedureNamePattern
, const OUString
& columnNamePattern
) throw(SQLException
, RuntimeException
, std::exception
)
192 Reference
< XResultSet
> xRef
;
195 ODatabaseMetaDataResultSet
* pResult
= new ODatabaseMetaDataResultSet(m_pConnection
);
197 pResult
->openProcedureColumns(m_bUseCatalog
? catalog
: Any(),schemaPattern
,procedureNamePattern
,columnNamePattern
);
201 xRef
= new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eProcedureColumns
);
206 Reference
< XResultSet
> SAL_CALL
ODatabaseMetaData::getProcedures(
207 const Any
& catalog
, const OUString
& schemaPattern
,
208 const OUString
& procedureNamePattern
) throw(SQLException
, RuntimeException
, std::exception
)
210 Reference
< XResultSet
> xRef
;
213 ODatabaseMetaDataResultSet
* pResult
= new ODatabaseMetaDataResultSet(m_pConnection
);
215 pResult
->openProcedures(m_bUseCatalog
? catalog
: Any(),schemaPattern
,procedureNamePattern
);
219 xRef
= new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eProcedures
);
224 Reference
< XResultSet
> SAL_CALL
ODatabaseMetaData::getVersionColumns(
225 const Any
& catalog
, const OUString
& schema
, const OUString
& table
) throw(SQLException
, RuntimeException
, std::exception
)
227 Reference
< XResultSet
> xRef
;
228 bool bSuccess
= false;
231 if ( !m_pConnection
->preventGetVersionColumns() )
233 ODatabaseMetaDataResultSet
* pResult
= new ODatabaseMetaDataResultSet(m_pConnection
);
235 pResult
->openVersionColumns(m_bUseCatalog
? catalog
: Any(),schema
,table
);
245 xRef
= new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eVersionColumns
);
251 sal_Int32 SAL_CALL
ODatabaseMetaData::getMaxBinaryLiteralLength( ) throw(SQLException
, RuntimeException
, std::exception
)
254 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_MAX_BINARY_LITERAL_LEN
,nValue
,*this);
258 sal_Int32 SAL_CALL
ODatabaseMetaData::getMaxRowSize( ) throw(SQLException
, RuntimeException
, std::exception
)
261 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_MAX_ROW_SIZE
,nValue
,*this);
265 sal_Int32 SAL_CALL
ODatabaseMetaData::getMaxCatalogNameLength( ) throw(SQLException
, RuntimeException
, std::exception
)
268 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_MAX_CATALOG_NAME_LEN
,nValue
,*this);
272 sal_Int32 SAL_CALL
ODatabaseMetaData::getMaxCharLiteralLength( ) throw(SQLException
, RuntimeException
, std::exception
)
275 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_MAX_CHAR_LITERAL_LEN
,nValue
,*this);
279 sal_Int32 SAL_CALL
ODatabaseMetaData::getMaxColumnNameLength( ) throw(SQLException
, RuntimeException
, std::exception
)
282 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_MAX_COLUMN_NAME_LEN
,nValue
,*this);
286 sal_Int32 SAL_CALL
ODatabaseMetaData::getMaxColumnsInIndex( ) throw(SQLException
, RuntimeException
, std::exception
)
289 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_MAX_COLUMNS_IN_INDEX
,nValue
,*this);
293 sal_Int32 SAL_CALL
ODatabaseMetaData::getMaxCursorNameLength( ) throw(SQLException
, RuntimeException
, std::exception
)
296 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_MAX_CURSOR_NAME_LEN
,nValue
,*this);
300 sal_Int32 SAL_CALL
ODatabaseMetaData::getMaxConnections( ) throw(SQLException
, RuntimeException
, std::exception
)
303 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_MAX_DRIVER_CONNECTIONS
/*SQL_ACTIVE_CONNECTIONS*/,nValue
,*this);
307 sal_Int32 SAL_CALL
ODatabaseMetaData::getMaxColumnsInTable( ) throw(SQLException
, RuntimeException
, std::exception
)
310 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_MAX_COLUMNS_IN_TABLE
,nValue
,*this);
314 sal_Int32 SAL_CALL
ODatabaseMetaData::getMaxStatementLength( ) throw(SQLException
, RuntimeException
, std::exception
)
317 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_MAX_STATEMENT_LEN
,nValue
,*this);
321 sal_Int32 SAL_CALL
ODatabaseMetaData::getMaxTableNameLength( ) throw(SQLException
, RuntimeException
, std::exception
)
324 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_MAX_TABLE_NAME_LEN
,nValue
,*this);
328 sal_Int32
ODatabaseMetaData::impl_getMaxTablesInSelect_throw( )
331 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_MAX_TABLES_IN_SELECT
,nValue
,*this);
335 Reference
< XResultSet
> SAL_CALL
ODatabaseMetaData::getExportedKeys(
336 const Any
& catalog
, const OUString
& schema
, const OUString
& table
) throw(SQLException
, RuntimeException
, std::exception
)
338 Reference
< XResultSet
> xRef
;
341 ODatabaseMetaDataResultSet
* pResult
= new ODatabaseMetaDataResultSet(m_pConnection
);
343 pResult
->openExportedKeys(m_bUseCatalog
? catalog
: Any(),schema
,table
);
347 xRef
= new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eExportedKeys
);
352 Reference
< XResultSet
> SAL_CALL
ODatabaseMetaData::getImportedKeys(
353 const Any
& catalog
, const OUString
& schema
, const OUString
& table
) throw(SQLException
, RuntimeException
, std::exception
)
355 Reference
< XResultSet
> xRef
;
358 ODatabaseMetaDataResultSet
* pResult
= new ODatabaseMetaDataResultSet(m_pConnection
);
360 pResult
->openImportedKeys(m_bUseCatalog
? catalog
: Any(),schema
,table
);
364 xRef
= new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eImportedKeys
);
369 Reference
< XResultSet
> SAL_CALL
ODatabaseMetaData::getPrimaryKeys(
370 const Any
& catalog
, const OUString
& schema
, const OUString
& table
) throw(SQLException
, RuntimeException
, std::exception
)
372 Reference
< XResultSet
> xRef
;
375 ODatabaseMetaDataResultSet
* pResult
= new ODatabaseMetaDataResultSet(m_pConnection
);
377 pResult
->openPrimaryKeys(m_bUseCatalog
? catalog
: Any(),schema
,table
);
381 xRef
= new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::ePrimaryKeys
);
386 Reference
< XResultSet
> SAL_CALL
ODatabaseMetaData::getIndexInfo(
387 const Any
& catalog
, const OUString
& schema
, const OUString
& table
,
388 sal_Bool unique
, sal_Bool approximate
) throw(SQLException
, RuntimeException
, std::exception
)
390 Reference
< XResultSet
> xRef
;
393 ODatabaseMetaDataResultSet
* pResult
= new ODatabaseMetaDataResultSet(m_pConnection
);
395 pResult
->openIndexInfo(m_bUseCatalog
? catalog
: Any(),schema
,table
,unique
,approximate
);
399 xRef
= new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eIndexInfo
);
404 Reference
< XResultSet
> SAL_CALL
ODatabaseMetaData::getBestRowIdentifier(
405 const Any
& catalog
, const OUString
& schema
, const OUString
& table
, sal_Int32 scope
,
406 sal_Bool nullable
) throw(SQLException
, RuntimeException
, std::exception
)
408 Reference
< XResultSet
> xRef
;
411 ODatabaseMetaDataResultSet
* pResult
= new ODatabaseMetaDataResultSet(m_pConnection
);
413 pResult
->openBestRowIdentifier(m_bUseCatalog
? catalog
: Any(),schema
,table
,scope
,nullable
);
417 xRef
= new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eBestRowIdentifier
);
422 Reference
< XResultSet
> SAL_CALL
ODatabaseMetaData::getTablePrivileges(
423 const Any
& catalog
, const OUString
& schemaPattern
, const OUString
& tableNamePattern
) throw(SQLException
, RuntimeException
, std::exception
)
425 if ( m_pConnection
->isIgnoreDriverPrivilegesEnabled() )
427 return new OResultSetPrivileges(this,catalog
,schemaPattern
,tableNamePattern
);
429 ODatabaseMetaDataResultSet
* pResult
= new ODatabaseMetaDataResultSet(m_pConnection
);
430 Reference
< XResultSet
> xRef
= pResult
;
431 pResult
->openTablePrivileges(m_bUseCatalog
? catalog
: Any(),schemaPattern
,tableNamePattern
);
435 Reference
< XResultSet
> SAL_CALL
ODatabaseMetaData::getCrossReference(
436 const Any
& primaryCatalog
, const OUString
& primarySchema
,
437 const OUString
& primaryTable
, const Any
& foreignCatalog
,
438 const OUString
& foreignSchema
, const OUString
& foreignTable
) throw(SQLException
, RuntimeException
, std::exception
)
440 Reference
< XResultSet
> xRef
;
443 ODatabaseMetaDataResultSet
* pResult
= new ODatabaseMetaDataResultSet(m_pConnection
);
445 pResult
->openForeignKeys(m_bUseCatalog
? primaryCatalog
: Any(),primarySchema
.toChar() == '%' ? &primarySchema
: NULL
,&primaryTable
,
446 m_bUseCatalog
? foreignCatalog
: Any(), foreignSchema
.toChar() == '%' ? &foreignSchema
: NULL
,&foreignTable
);
450 xRef
= new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eCrossReference
);
455 sal_Bool SAL_CALL
ODatabaseMetaData::doesMaxRowSizeIncludeBlobs( ) throw(SQLException
, RuntimeException
, std::exception
)
458 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_MAX_ROW_SIZE_INCLUDES_LONG
,aVal
,*this,m_pConnection
->getTextEncoding());
459 return aVal
.toChar() == 'Y';
462 sal_Bool SAL_CALL
ODatabaseMetaData::storesLowerCaseQuotedIdentifiers( ) throw(SQLException
, RuntimeException
, std::exception
)
465 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_QUOTED_IDENTIFIER_CASE
,nValue
,*this);
466 return nValue
== SQL_IC_LOWER
;
469 sal_Bool SAL_CALL
ODatabaseMetaData::storesLowerCaseIdentifiers( ) throw(SQLException
, RuntimeException
, std::exception
)
472 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_IDENTIFIER_CASE
,nValue
,*this);
473 return nValue
== SQL_IC_LOWER
;
476 bool ODatabaseMetaData::impl_storesMixedCaseQuotedIdentifiers_throw( )
479 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_QUOTED_IDENTIFIER_CASE
,nValue
,*this);
480 return nValue
== SQL_IC_MIXED
;
483 sal_Bool SAL_CALL
ODatabaseMetaData::storesMixedCaseIdentifiers( ) throw(SQLException
, RuntimeException
, std::exception
)
486 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_IDENTIFIER_CASE
,nValue
,*this);
487 return nValue
== SQL_IC_MIXED
;
490 sal_Bool SAL_CALL
ODatabaseMetaData::storesUpperCaseQuotedIdentifiers( ) throw(SQLException
, RuntimeException
, std::exception
)
493 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_QUOTED_IDENTIFIER_CASE
,nValue
,*this);
494 return nValue
== SQL_IC_UPPER
;
497 sal_Bool SAL_CALL
ODatabaseMetaData::storesUpperCaseIdentifiers( ) throw(SQLException
, RuntimeException
, std::exception
)
500 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_IDENTIFIER_CASE
,nValue
,*this);
501 return nValue
== SQL_IC_UPPER
;
504 bool ODatabaseMetaData::impl_supportsAlterTableWithAddColumn_throw( )
507 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_ALTER_TABLE
,nValue
,*this);
508 return (nValue
& SQL_AT_ADD_COLUMN
) == SQL_AT_ADD_COLUMN
;
511 bool ODatabaseMetaData::impl_supportsAlterTableWithDropColumn_throw( )
514 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_ALTER_TABLE
,nValue
,*this);
515 return ((nValue
& SQL_AT_DROP_COLUMN
) == SQL_AT_DROP_COLUMN
) ||
516 ((nValue
& SQL_AT_DROP_COLUMN_CASCADE
) == SQL_AT_DROP_COLUMN_CASCADE
) ||
517 ((nValue
& SQL_AT_DROP_COLUMN_RESTRICT
) == SQL_AT_DROP_COLUMN_RESTRICT
);
520 sal_Int32 SAL_CALL
ODatabaseMetaData::getMaxIndexLength( ) throw(SQLException
, RuntimeException
, std::exception
)
523 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_MAX_INDEX_SIZE
,nValue
,*this);
527 sal_Bool SAL_CALL
ODatabaseMetaData::supportsNonNullableColumns( ) throw(SQLException
, RuntimeException
, std::exception
)
530 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_NON_NULLABLE_COLUMNS
,nValue
,*this);
531 return nValue
== SQL_NNC_NON_NULL
;
534 OUString SAL_CALL
ODatabaseMetaData::getCatalogTerm( ) throw(SQLException
, RuntimeException
, std::exception
)
538 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CATALOG_TERM
,aVal
,*this,m_pConnection
->getTextEncoding());
542 OUString
ODatabaseMetaData::impl_getIdentifierQuoteString_throw( )
545 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_IDENTIFIER_QUOTE_CHAR
,aVal
,*this,m_pConnection
->getTextEncoding());
549 OUString SAL_CALL
ODatabaseMetaData::getExtraNameCharacters( ) throw(SQLException
, RuntimeException
, std::exception
)
552 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_SPECIAL_CHARACTERS
,aVal
,*this,m_pConnection
->getTextEncoding());
556 sal_Bool SAL_CALL
ODatabaseMetaData::supportsDifferentTableCorrelationNames( ) throw(SQLException
, RuntimeException
, std::exception
)
559 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CORRELATION_NAME
,nValue
,*this);
560 return nValue
!= SQL_CN_NONE
;
563 bool ODatabaseMetaData::impl_isCatalogAtStart_throw( )
565 SQLUSMALLINT nValue
=0;
567 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CATALOG_LOCATION
,nValue
,*this);
568 return nValue
== SQL_CL_START
;
571 sal_Bool SAL_CALL
ODatabaseMetaData::dataDefinitionIgnoredInTransactions( ) throw(SQLException
, RuntimeException
, std::exception
)
574 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_TXN_CAPABLE
,nValue
,*this);
575 return nValue
== SQL_TC_DDL_IGNORE
;
578 sal_Bool SAL_CALL
ODatabaseMetaData::dataDefinitionCausesTransactionCommit( ) throw(SQLException
, RuntimeException
, std::exception
)
581 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_TXN_CAPABLE
,nValue
,*this);
582 return nValue
== SQL_TC_DDL_COMMIT
;
585 sal_Bool SAL_CALL
ODatabaseMetaData::supportsDataManipulationTransactionsOnly( ) throw(SQLException
, RuntimeException
, std::exception
)
588 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_TXN_CAPABLE
,nValue
,*this);
589 return nValue
== SQL_TC_DML
;
592 sal_Bool SAL_CALL
ODatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions( ) throw(SQLException
, RuntimeException
, std::exception
)
595 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_TXN_CAPABLE
,nValue
,*this);
596 return nValue
== SQL_TC_ALL
;
599 sal_Bool SAL_CALL
ODatabaseMetaData::supportsPositionedDelete( ) throw(SQLException
, RuntimeException
, std::exception
)
602 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_DYNAMIC_CURSOR_ATTRIBUTES1
,nValue
,*this);
603 return (nValue
& SQL_CA1_POS_DELETE
) == SQL_CA1_POS_DELETE
;
606 sal_Bool SAL_CALL
ODatabaseMetaData::supportsPositionedUpdate( ) throw(SQLException
, RuntimeException
, std::exception
)
609 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_DYNAMIC_CURSOR_ATTRIBUTES1
,nValue
,*this);
610 return (nValue
& SQL_CA1_POS_UPDATE
) == SQL_CA1_POS_UPDATE
;
613 sal_Bool SAL_CALL
ODatabaseMetaData::supportsOpenStatementsAcrossRollback( ) throw(SQLException
, RuntimeException
, std::exception
)
616 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CURSOR_ROLLBACK_BEHAVIOR
,nValue
,*this);
617 return nValue
== SQL_CB_PRESERVE
|| nValue
== SQL_CB_CLOSE
;
620 sal_Bool SAL_CALL
ODatabaseMetaData::supportsOpenStatementsAcrossCommit( ) throw(SQLException
, RuntimeException
, std::exception
)
623 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CURSOR_COMMIT_BEHAVIOR
,nValue
,*this);
624 return nValue
== SQL_CB_PRESERVE
|| nValue
== SQL_CB_CLOSE
;
627 sal_Bool SAL_CALL
ODatabaseMetaData::supportsOpenCursorsAcrossCommit( ) throw(SQLException
, RuntimeException
, std::exception
)
630 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CURSOR_COMMIT_BEHAVIOR
,nValue
,*this);
631 return nValue
== SQL_CB_PRESERVE
;
634 sal_Bool SAL_CALL
ODatabaseMetaData::supportsOpenCursorsAcrossRollback( ) throw(SQLException
, RuntimeException
, std::exception
)
637 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CURSOR_ROLLBACK_BEHAVIOR
,nValue
,*this);
638 return nValue
== SQL_CB_PRESERVE
;
641 sal_Bool SAL_CALL
ODatabaseMetaData::supportsTransactionIsolationLevel( sal_Int32 level
) throw(SQLException
, RuntimeException
, std::exception
)
644 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_TXN_ISOLATION_OPTION
,nValue
,*this);
645 return (nValue
& static_cast<SQLUINTEGER
>(level
)) == static_cast<SQLUINTEGER
>(level
);
648 bool ODatabaseMetaData::impl_supportsSchemasInDataManipulation_throw( )
651 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_SCHEMA_USAGE
,nValue
,*this);
652 return (nValue
& SQL_SU_DML_STATEMENTS
) == SQL_SU_DML_STATEMENTS
;
655 sal_Bool SAL_CALL
ODatabaseMetaData::supportsANSI92FullSQL( ) throw(SQLException
, RuntimeException
, std::exception
)
658 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_SQL_CONFORMANCE
,nValue
,*this);
659 return static_cast<bool>(nValue
& SQL_SC_SQL92_FULL
);
662 sal_Bool SAL_CALL
ODatabaseMetaData::supportsANSI92EntryLevelSQL( ) throw(SQLException
, RuntimeException
, std::exception
)
665 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_SQL_CONFORMANCE
,nValue
,*this);
666 return static_cast<bool>(nValue
&SQL_SC_SQL92_ENTRY
);
669 sal_Bool SAL_CALL
ODatabaseMetaData::supportsIntegrityEnhancementFacility( ) throw(SQLException
, RuntimeException
, std::exception
)
672 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_INTEGRITY
,aStr
,*this,m_pConnection
->getTextEncoding());
673 return aStr
.toChar() == 'Y';
676 sal_Bool SAL_CALL
ODatabaseMetaData::supportsSchemasInIndexDefinitions( ) throw(SQLException
, RuntimeException
, std::exception
)
679 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_SCHEMA_USAGE
,nValue
,*this);
680 return (nValue
& SQL_SU_INDEX_DEFINITION
) == SQL_SU_INDEX_DEFINITION
;
683 bool ODatabaseMetaData::impl_supportsSchemasInTableDefinitions_throw( )
686 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_SCHEMA_USAGE
,nValue
,*this);
687 return (nValue
& SQL_SU_TABLE_DEFINITION
) == SQL_SU_TABLE_DEFINITION
;
690 bool ODatabaseMetaData::impl_supportsCatalogsInTableDefinitions_throw( )
692 SQLUINTEGER nValue
=0;
694 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CATALOG_USAGE
,nValue
,*this);
695 return (nValue
& SQL_CU_TABLE_DEFINITION
) == SQL_CU_TABLE_DEFINITION
;
698 sal_Bool SAL_CALL
ODatabaseMetaData::supportsCatalogsInIndexDefinitions( ) throw(SQLException
, RuntimeException
, std::exception
)
700 SQLUINTEGER nValue
=0;
702 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CATALOG_USAGE
,nValue
,*this);
703 return (nValue
& SQL_CU_INDEX_DEFINITION
) == SQL_CU_INDEX_DEFINITION
;
706 bool ODatabaseMetaData::impl_supportsCatalogsInDataManipulation_throw( )
708 SQLUINTEGER nValue
=0;
710 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CATALOG_USAGE
,nValue
,*this);
711 return (nValue
& SQL_CU_DML_STATEMENTS
) == SQL_CU_DML_STATEMENTS
;
714 sal_Bool SAL_CALL
ODatabaseMetaData::supportsOuterJoins( ) throw(SQLException
, RuntimeException
, std::exception
)
717 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_OJ_CAPABILITIES
,nValue
,*this);
718 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);
721 Reference
< XResultSet
> SAL_CALL
ODatabaseMetaData::getTableTypes( ) throw(SQLException
, RuntimeException
, std::exception
)
723 Reference
< XResultSet
> xRef
;
726 ODatabaseMetaDataResultSet
* pResult
= new ODatabaseMetaDataResultSet(m_pConnection
);
728 pResult
->openTablesTypes();
732 xRef
= new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTableTypes
);
737 sal_Int32
ODatabaseMetaData::impl_getMaxStatements_throw( )
740 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_MAX_CONCURRENT_ACTIVITIES
,nValue
,*this);
744 sal_Int32 SAL_CALL
ODatabaseMetaData::getMaxProcedureNameLength( ) throw(SQLException
, RuntimeException
, std::exception
)
747 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_MAX_PROCEDURE_NAME_LEN
,nValue
,*this);
751 sal_Int32 SAL_CALL
ODatabaseMetaData::getMaxSchemaNameLength( ) throw(SQLException
, RuntimeException
, std::exception
)
754 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_MAX_SCHEMA_NAME_LEN
,nValue
,*this);
758 sal_Bool SAL_CALL
ODatabaseMetaData::supportsTransactions( ) throw(SQLException
, RuntimeException
, std::exception
)
761 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_TXN_CAPABLE
,nValue
,*this);
762 return nValue
!= SQL_TC_NONE
;
765 sal_Bool SAL_CALL
ODatabaseMetaData::allProceduresAreCallable( ) throw(SQLException
, RuntimeException
, std::exception
)
768 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_ACCESSIBLE_PROCEDURES
,aValue
,*this,m_pConnection
->getTextEncoding());
769 return aValue
.toChar() == 'Y';
772 sal_Bool SAL_CALL
ODatabaseMetaData::supportsStoredProcedures( ) throw(SQLException
, RuntimeException
, std::exception
)
775 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_PROCEDURES
,aValue
,*this,m_pConnection
->getTextEncoding());
776 return aValue
.toChar() == 'Y';
779 sal_Bool SAL_CALL
ODatabaseMetaData::supportsSelectForUpdate( ) throw(SQLException
, RuntimeException
, std::exception
)
782 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_DYNAMIC_CURSOR_ATTRIBUTES1
,nValue
,*this);
783 return (nValue
& SQL_CA1_POSITIONED_UPDATE
) == SQL_CA1_POSITIONED_UPDATE
;
786 sal_Bool SAL_CALL
ODatabaseMetaData::allTablesAreSelectable( ) throw(SQLException
, RuntimeException
, std::exception
)
789 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_ACCESSIBLE_TABLES
,aValue
,*this,m_pConnection
->getTextEncoding());
790 return aValue
.toChar() == 'Y';
793 sal_Bool SAL_CALL
ODatabaseMetaData::isReadOnly( ) throw(SQLException
, RuntimeException
, std::exception
)
795 return m_pConnection
->isReadOnly();
798 sal_Bool SAL_CALL
ODatabaseMetaData::usesLocalFiles( ) throw(SQLException
, RuntimeException
, std::exception
)
801 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_FILE_USAGE
,nValue
,*this);
802 return nValue
== SQL_FILE_CATALOG
;
805 sal_Bool SAL_CALL
ODatabaseMetaData::usesLocalFilePerTable( ) throw(SQLException
, RuntimeException
, std::exception
)
808 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_FILE_USAGE
,nValue
,*this);
809 return nValue
== SQL_FILE_TABLE
;
812 sal_Bool SAL_CALL
ODatabaseMetaData::supportsTypeConversion( ) throw(SQLException
, RuntimeException
, std::exception
)
815 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CONVERT_FUNCTIONS
,nValue
,*this);
816 return (nValue
& SQL_FN_CVT_CONVERT
) == SQL_FN_CVT_CONVERT
;
819 sal_Bool SAL_CALL
ODatabaseMetaData::nullPlusNonNullIsNull( ) throw(SQLException
, RuntimeException
, std::exception
)
822 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CONCAT_NULL_BEHAVIOR
,nValue
,*this);
823 return nValue
== SQL_CB_NULL
;
826 sal_Bool SAL_CALL
ODatabaseMetaData::supportsColumnAliasing( ) throw(SQLException
, RuntimeException
, std::exception
)
829 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_COLUMN_ALIAS
,aValue
,*this,m_pConnection
->getTextEncoding());
830 return aValue
.toChar() == 'Y';
833 sal_Bool SAL_CALL
ODatabaseMetaData::supportsTableCorrelationNames( ) throw(SQLException
, RuntimeException
, std::exception
)
836 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CORRELATION_NAME
,nValue
,*this);
837 return nValue
!= SQL_CN_NONE
;
840 sal_Bool SAL_CALL
ODatabaseMetaData::supportsConvert( sal_Int32 fromType
, sal_Int32 toType
) throw(SQLException
, RuntimeException
, std::exception
)
842 if(fromType
== toType
)
845 SQLUINTEGER nValue
=0;
849 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CONVERT_BIT
,nValue
,*this);
851 case DataType::TINYINT
:
852 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CONVERT_TINYINT
,nValue
,*this);
854 case DataType::SMALLINT
:
855 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CONVERT_SMALLINT
,nValue
,*this);
857 case DataType::INTEGER
:
858 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CONVERT_INTEGER
,nValue
,*this);
860 case DataType::BIGINT
:
861 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CONVERT_BIGINT
,nValue
,*this);
863 case DataType::FLOAT
:
864 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CONVERT_FLOAT
,nValue
,*this);
867 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CONVERT_REAL
,nValue
,*this);
869 case DataType::DOUBLE
:
870 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CONVERT_DOUBLE
,nValue
,*this);
872 case DataType::NUMERIC
:
873 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CONVERT_NUMERIC
,nValue
,*this);
875 case DataType::DECIMAL
:
876 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CONVERT_DECIMAL
,nValue
,*this);
879 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CONVERT_CHAR
,nValue
,*this);
881 case DataType::VARCHAR
:
882 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CONVERT_VARCHAR
,nValue
,*this);
884 case DataType::LONGVARCHAR
:
886 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CONVERT_LONGVARCHAR
,nValue
,*this);
889 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CONVERT_DATE
,nValue
,*this);
892 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CONVERT_TIME
,nValue
,*this);
894 case DataType::TIMESTAMP
:
895 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CONVERT_TIMESTAMP
,nValue
,*this);
897 case DataType::BINARY
:
898 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CONVERT_BINARY
,nValue
,*this);
900 case DataType::VARBINARY
:
901 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CONVERT_VARBINARY
,nValue
,*this);
903 case DataType::LONGVARBINARY
:
905 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CONVERT_LONGVARBINARY
,nValue
,*this);
907 case DataType::SQLNULL
:
908 // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
910 case DataType::OTHER
:
911 // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
913 case DataType::OBJECT
:
914 // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
916 case DataType::DISTINCT
:
917 // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
919 case DataType::STRUCT
:
920 // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
922 case DataType::ARRAY
:
923 // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
926 // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
929 bool bConvert
= false;
933 bConvert
= (nValue
& SQL_CVT_BIT
) == SQL_CVT_BIT
;
935 case DataType::TINYINT
:
936 bConvert
= (nValue
& SQL_CVT_TINYINT
) == SQL_CVT_TINYINT
;
938 case DataType::SMALLINT
:
939 bConvert
= (nValue
& SQL_CVT_SMALLINT
) == SQL_CVT_SMALLINT
;
941 case DataType::INTEGER
:
942 bConvert
= (nValue
& SQL_CVT_INTEGER
) == SQL_CVT_INTEGER
;
944 case DataType::BIGINT
:
945 bConvert
= (nValue
& SQL_CVT_BIGINT
) == SQL_CVT_BIGINT
;
947 case DataType::FLOAT
:
948 bConvert
= (nValue
& SQL_CVT_FLOAT
) == SQL_CVT_FLOAT
;
951 bConvert
= (nValue
& SQL_CVT_REAL
) == SQL_CVT_REAL
;
953 case DataType::DOUBLE
:
954 bConvert
= (nValue
& SQL_CVT_DOUBLE
) == SQL_CVT_DOUBLE
;
956 case DataType::NUMERIC
:
957 bConvert
= (nValue
& SQL_CVT_NUMERIC
) == SQL_CVT_NUMERIC
;
959 case DataType::DECIMAL
:
960 bConvert
= (nValue
& SQL_CVT_DECIMAL
) == SQL_CVT_DECIMAL
;
963 bConvert
= (nValue
& SQL_CVT_CHAR
) == SQL_CVT_CHAR
;
965 case DataType::VARCHAR
:
966 bConvert
= (nValue
& SQL_CVT_VARCHAR
) == SQL_CVT_VARCHAR
;
968 case DataType::LONGVARCHAR
:
970 bConvert
= (nValue
& SQL_CVT_LONGVARCHAR
) == SQL_CVT_LONGVARCHAR
;
973 bConvert
= (nValue
& SQL_CVT_DATE
) == SQL_CVT_DATE
;
976 bConvert
= (nValue
& SQL_CVT_TIME
) == SQL_CVT_TIME
;
978 case DataType::TIMESTAMP
:
979 bConvert
= (nValue
& SQL_CVT_TIMESTAMP
) == SQL_CVT_TIMESTAMP
;
981 case DataType::BINARY
:
982 bConvert
= (nValue
& SQL_CVT_BINARY
) == SQL_CVT_BINARY
;
984 case DataType::VARBINARY
:
985 bConvert
= (nValue
& SQL_CVT_VARBINARY
) == SQL_CVT_VARBINARY
;
987 case DataType::LONGVARBINARY
:
989 bConvert
= (nValue
& SQL_CVT_LONGVARBINARY
) == SQL_CVT_LONGVARBINARY
;
996 sal_Bool SAL_CALL
ODatabaseMetaData::supportsExpressionsInOrderBy( ) throw(SQLException
, RuntimeException
, std::exception
)
999 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_EXPRESSIONS_IN_ORDERBY
,aValue
,*this,m_pConnection
->getTextEncoding());
1000 return aValue
.toChar() == 'Y';
1003 sal_Bool SAL_CALL
ODatabaseMetaData::supportsGroupBy( ) throw(SQLException
, RuntimeException
, std::exception
)
1005 SQLUSMALLINT nValue
;
1006 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_GROUP_BY
,nValue
,*this);
1007 return nValue
!= SQL_GB_NOT_SUPPORTED
;
1010 sal_Bool SAL_CALL
ODatabaseMetaData::supportsGroupByBeyondSelect( ) throw(SQLException
, RuntimeException
, std::exception
)
1012 SQLUSMALLINT nValue
;
1013 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_GROUP_BY
,nValue
,*this);
1014 return nValue
!= SQL_GB_GROUP_BY_CONTAINS_SELECT
;
1017 sal_Bool SAL_CALL
ODatabaseMetaData::supportsGroupByUnrelated( ) throw(SQLException
, RuntimeException
, std::exception
)
1019 SQLUSMALLINT nValue
;
1020 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_GROUP_BY
,nValue
,*this);
1021 return nValue
== SQL_GB_NO_RELATION
;
1024 sal_Bool SAL_CALL
ODatabaseMetaData::supportsMultipleTransactions( ) throw(SQLException
, RuntimeException
, std::exception
)
1027 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_MULTIPLE_ACTIVE_TXN
,aValue
,*this,m_pConnection
->getTextEncoding());
1028 return aValue
.toChar() == 'Y';
1031 sal_Bool SAL_CALL
ODatabaseMetaData::supportsMultipleResultSets( ) throw(SQLException
, RuntimeException
, std::exception
)
1034 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_MULT_RESULT_SETS
,aValue
,*this,m_pConnection
->getTextEncoding());
1035 return aValue
.toChar() == 'Y';
1038 sal_Bool SAL_CALL
ODatabaseMetaData::supportsLikeEscapeClause( ) throw(SQLException
, RuntimeException
, std::exception
)
1041 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_LIKE_ESCAPE_CLAUSE
,aValue
,*this,m_pConnection
->getTextEncoding());
1042 return aValue
.toChar() == 'Y';
1045 sal_Bool SAL_CALL
ODatabaseMetaData::supportsOrderByUnrelated( ) throw(SQLException
, RuntimeException
, std::exception
)
1048 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_ORDER_BY_COLUMNS_IN_SELECT
,aValue
,*this,m_pConnection
->getTextEncoding());
1049 return aValue
.toChar() == 'N';
1052 sal_Bool SAL_CALL
ODatabaseMetaData::supportsUnion( ) throw(SQLException
, RuntimeException
, std::exception
)
1055 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_UNION
,nValue
,*this);
1056 return (nValue
& SQL_U_UNION
) == SQL_U_UNION
;
1059 sal_Bool SAL_CALL
ODatabaseMetaData::supportsUnionAll( ) throw(SQLException
, RuntimeException
, std::exception
)
1062 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_UNION
,nValue
,*this);
1063 return (nValue
& SQL_U_UNION_ALL
) == SQL_U_UNION_ALL
;
1066 sal_Bool SAL_CALL
ODatabaseMetaData::supportsMixedCaseIdentifiers( ) throw(SQLException
, RuntimeException
, std::exception
)
1068 SQLUSMALLINT nValue
;
1069 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_IDENTIFIER_CASE
,nValue
,*this);
1070 return nValue
== SQL_IC_MIXED
;
1073 bool ODatabaseMetaData::impl_supportsMixedCaseQuotedIdentifiers_throw( )
1075 SQLUSMALLINT nValue
;
1076 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_QUOTED_IDENTIFIER_CASE
,nValue
,*this);
1077 return nValue
== SQL_IC_MIXED
;
1080 sal_Bool SAL_CALL
ODatabaseMetaData::nullsAreSortedAtEnd( ) throw(SQLException
, RuntimeException
, std::exception
)
1082 SQLUSMALLINT nValue
;
1083 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_NULL_COLLATION
,nValue
,*this);
1084 return nValue
== SQL_NC_END
;
1087 sal_Bool SAL_CALL
ODatabaseMetaData::nullsAreSortedAtStart( ) throw(SQLException
, RuntimeException
, std::exception
)
1089 SQLUSMALLINT nValue
;
1090 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_NULL_COLLATION
,nValue
,*this);
1091 return nValue
== SQL_NC_START
;
1094 sal_Bool SAL_CALL
ODatabaseMetaData::nullsAreSortedHigh( ) throw(SQLException
, RuntimeException
, std::exception
)
1096 SQLUSMALLINT nValue
;
1097 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_NULL_COLLATION
,nValue
,*this);
1098 return nValue
== SQL_NC_HIGH
;
1101 sal_Bool SAL_CALL
ODatabaseMetaData::nullsAreSortedLow( ) throw(SQLException
, RuntimeException
, std::exception
)
1103 SQLUSMALLINT nValue
;
1104 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_NULL_COLLATION
,nValue
,*this);
1105 return nValue
== SQL_NC_LOW
;
1108 sal_Bool SAL_CALL
ODatabaseMetaData::supportsSchemasInProcedureCalls( ) throw(SQLException
, RuntimeException
, std::exception
)
1111 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_SCHEMA_USAGE
,nValue
,*this);
1112 return (nValue
& SQL_SU_PROCEDURE_INVOCATION
) == SQL_SU_PROCEDURE_INVOCATION
;
1115 sal_Bool SAL_CALL
ODatabaseMetaData::supportsSchemasInPrivilegeDefinitions( ) throw(SQLException
, RuntimeException
, std::exception
)
1118 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_SCHEMA_USAGE
,nValue
,*this);
1119 return (nValue
& SQL_SU_PRIVILEGE_DEFINITION
) == SQL_SU_PRIVILEGE_DEFINITION
;
1122 sal_Bool SAL_CALL
ODatabaseMetaData::supportsCatalogsInProcedureCalls( ) throw(SQLException
, RuntimeException
, std::exception
)
1124 SQLUINTEGER nValue
=0;
1126 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CATALOG_USAGE
,nValue
,*this);
1127 return (nValue
& SQL_CU_PROCEDURE_INVOCATION
) == SQL_CU_PROCEDURE_INVOCATION
;
1130 sal_Bool SAL_CALL
ODatabaseMetaData::supportsCatalogsInPrivilegeDefinitions( ) throw(SQLException
, RuntimeException
, std::exception
)
1132 SQLUINTEGER nValue
=0;
1134 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CATALOG_USAGE
,nValue
,*this);
1135 return (nValue
& SQL_CU_PRIVILEGE_DEFINITION
) == SQL_CU_PRIVILEGE_DEFINITION
;
1138 sal_Bool SAL_CALL
ODatabaseMetaData::supportsCorrelatedSubqueries( ) throw(SQLException
, RuntimeException
, std::exception
)
1141 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_SUBQUERIES
,nValue
,*this);
1142 return (nValue
& SQL_SQ_CORRELATED_SUBQUERIES
) == SQL_SQ_CORRELATED_SUBQUERIES
;
1145 sal_Bool SAL_CALL
ODatabaseMetaData::supportsSubqueriesInComparisons( ) throw(SQLException
, RuntimeException
, std::exception
)
1148 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_SUBQUERIES
,nValue
,*this);
1149 return (nValue
& SQL_SQ_COMPARISON
) == SQL_SQ_COMPARISON
;
1152 sal_Bool SAL_CALL
ODatabaseMetaData::supportsSubqueriesInExists( ) throw(SQLException
, RuntimeException
, std::exception
)
1155 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_SUBQUERIES
,nValue
,*this);
1156 return (nValue
& SQL_SQ_EXISTS
) == SQL_SQ_EXISTS
;
1159 sal_Bool SAL_CALL
ODatabaseMetaData::supportsSubqueriesInIns( ) throw(SQLException
, RuntimeException
, std::exception
)
1162 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_SUBQUERIES
,nValue
,*this);
1163 return (nValue
& SQL_SQ_IN
) == SQL_SQ_IN
;
1166 sal_Bool SAL_CALL
ODatabaseMetaData::supportsSubqueriesInQuantifieds( ) throw(SQLException
, RuntimeException
, std::exception
)
1169 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_SUBQUERIES
,nValue
,*this);
1170 return (nValue
& SQL_SQ_QUANTIFIED
) == SQL_SQ_QUANTIFIED
;
1173 sal_Bool SAL_CALL
ODatabaseMetaData::supportsANSI92IntermediateSQL( ) throw(SQLException
, RuntimeException
, std::exception
)
1176 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_SQL_CONFORMANCE
,nValue
,*this);
1177 return static_cast<bool>(nValue
& SQL_SC_SQL92_INTERMEDIATE
);
1180 OUString
ODatabaseMetaData::getURLImpl()
1183 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_DATA_SOURCE_NAME
,aValue
,*this,m_pConnection
->getTextEncoding());
1187 OUString SAL_CALL
ODatabaseMetaData::getURL( ) throw(SQLException
, RuntimeException
, std::exception
)
1189 OUString aValue
= m_pConnection
->getURL();
1190 if ( aValue
.isEmpty() )
1192 aValue
= "sdbc:odbc:" + getURLImpl();
1197 OUString SAL_CALL
ODatabaseMetaData::getUserName( ) throw(SQLException
, RuntimeException
, std::exception
)
1200 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_USER_NAME
,aValue
,*this,m_pConnection
->getTextEncoding());
1204 OUString SAL_CALL
ODatabaseMetaData::getDriverName( ) throw(SQLException
, RuntimeException
, std::exception
)
1207 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_DRIVER_NAME
,aValue
,*this,m_pConnection
->getTextEncoding());
1211 OUString SAL_CALL
ODatabaseMetaData::getDriverVersion() throw(SQLException
, RuntimeException
, std::exception
)
1214 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_DRIVER_ODBC_VER
,aValue
,*this,m_pConnection
->getTextEncoding());
1218 OUString SAL_CALL
ODatabaseMetaData::getDatabaseProductVersion( ) throw(SQLException
, RuntimeException
, std::exception
)
1221 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_DRIVER_VER
,aValue
,*this,m_pConnection
->getTextEncoding());
1225 OUString SAL_CALL
ODatabaseMetaData::getDatabaseProductName( ) throw(SQLException
, RuntimeException
, std::exception
)
1228 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_DBMS_NAME
,aValue
,*this,m_pConnection
->getTextEncoding());
1232 OUString SAL_CALL
ODatabaseMetaData::getProcedureTerm( ) throw(SQLException
, RuntimeException
, std::exception
)
1235 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_PROCEDURE_TERM
,aValue
,*this,m_pConnection
->getTextEncoding());
1239 OUString SAL_CALL
ODatabaseMetaData::getSchemaTerm( ) throw(SQLException
, RuntimeException
, std::exception
)
1242 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_SCHEMA_TERM
,aValue
,*this,m_pConnection
->getTextEncoding());
1246 sal_Int32 SAL_CALL
ODatabaseMetaData::getDriverMajorVersion( ) throw(RuntimeException
, std::exception
)
1249 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_DRIVER_VER
,aValue
,*this,m_pConnection
->getTextEncoding());
1250 return aValue
.copy(0,aValue
.indexOf('.')).toInt32();
1253 sal_Int32 SAL_CALL
ODatabaseMetaData::getDefaultTransactionIsolation( ) throw(SQLException
, RuntimeException
, std::exception
)
1256 sal_Int32 nValueTranslated
;
1257 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_DEFAULT_TXN_ISOLATION
,nValue
,*this);
1260 case SQL_TXN_READ_UNCOMMITTED
:
1261 nValueTranslated
= com::sun::star::sdbc::TransactionIsolation::READ_UNCOMMITTED
;
1263 case SQL_TXN_READ_COMMITTED
:
1264 nValueTranslated
= com::sun::star::sdbc::TransactionIsolation::READ_COMMITTED
;
1266 case SQL_TXN_REPEATABLE_READ
:
1267 nValueTranslated
= com::sun::star::sdbc::TransactionIsolation::REPEATABLE_READ
;
1269 case SQL_TXN_SERIALIZABLE
:
1270 nValueTranslated
= com::sun::star::sdbc::TransactionIsolation::SERIALIZABLE
;
1273 nValueTranslated
= 0;
1275 return nValueTranslated
;
1278 sal_Int32 SAL_CALL
ODatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeException
, std::exception
)
1281 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_DRIVER_VER
,aValue
,*this,m_pConnection
->getTextEncoding());
1282 return aValue
.copy(0,aValue
.lastIndexOf('.')).toInt32();
1285 OUString SAL_CALL
ODatabaseMetaData::getSQLKeywords( ) throw(SQLException
, RuntimeException
, std::exception
)
1288 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_KEYWORDS
,aValue
,*this,m_pConnection
->getTextEncoding());
1292 OUString SAL_CALL
ODatabaseMetaData::getSearchStringEscape( ) throw(SQLException
, RuntimeException
, std::exception
)
1295 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_SEARCH_PATTERN_ESCAPE
,aValue
,*this,m_pConnection
->getTextEncoding());
1299 OUString SAL_CALL
ODatabaseMetaData::getStringFunctions( ) throw(SQLException
, RuntimeException
, std::exception
)
1302 OUStringBuffer aValue
;
1303 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_STRING_FUNCTIONS
,nValue
,*this);
1304 if(nValue
& SQL_FN_STR_ASCII
)
1305 aValue
.appendAscii("ASCII,");
1306 if(nValue
& SQL_FN_STR_BIT_LENGTH
)
1307 aValue
.appendAscii("BIT_LENGTH,");
1308 if(nValue
& SQL_FN_STR_CHAR
)
1309 aValue
.appendAscii("CHAR,");
1310 if(nValue
& SQL_FN_STR_CHAR_LENGTH
)
1311 aValue
.appendAscii("CHAR_LENGTH,");
1312 if(nValue
& SQL_FN_STR_CHARACTER_LENGTH
)
1313 aValue
.appendAscii("CHARACTER_LENGTH,");
1314 if(nValue
& SQL_FN_STR_CONCAT
)
1315 aValue
.appendAscii("CONCAT,");
1316 if(nValue
& SQL_FN_STR_DIFFERENCE
)
1317 aValue
.appendAscii("DIFFERENCE,");
1318 if(nValue
& SQL_FN_STR_INSERT
)
1319 aValue
.appendAscii("INSERT,");
1320 if(nValue
& SQL_FN_STR_LCASE
)
1321 aValue
.appendAscii("LCASE,");
1322 if(nValue
& SQL_FN_STR_LEFT
)
1323 aValue
.appendAscii("LEFT,");
1324 if(nValue
& SQL_FN_STR_LENGTH
)
1325 aValue
.appendAscii("LENGTH,");
1326 if(nValue
& SQL_FN_STR_LOCATE
)
1327 aValue
.appendAscii("LOCATE,");
1328 if(nValue
& SQL_FN_STR_LOCATE_2
)
1329 aValue
.appendAscii("LOCATE_2,");
1330 if(nValue
& SQL_FN_STR_LTRIM
)
1331 aValue
.appendAscii("LTRIM,");
1332 if(nValue
& SQL_FN_STR_OCTET_LENGTH
)
1333 aValue
.appendAscii("OCTET_LENGTH,");
1334 if(nValue
& SQL_FN_STR_POSITION
)
1335 aValue
.appendAscii("POSITION,");
1336 if(nValue
& SQL_FN_STR_REPEAT
)
1337 aValue
.appendAscii("REPEAT,");
1338 if(nValue
& SQL_FN_STR_REPLACE
)
1339 aValue
.appendAscii("REPLACE,");
1340 if(nValue
& SQL_FN_STR_RIGHT
)
1341 aValue
.appendAscii("RIGHT,");
1342 if(nValue
& SQL_FN_STR_RTRIM
)
1343 aValue
.appendAscii("RTRIM,");
1344 if(nValue
& SQL_FN_STR_SOUNDEX
)
1345 aValue
.appendAscii("SOUNDEX,");
1346 if(nValue
& SQL_FN_STR_SPACE
)
1347 aValue
.appendAscii("SPACE,");
1348 if(nValue
& SQL_FN_STR_SUBSTRING
)
1349 aValue
.appendAscii("SUBSTRING,");
1350 if(nValue
& SQL_FN_STR_UCASE
)
1351 aValue
.appendAscii("UCASE,");
1354 if ( !aValue
.isEmpty() )
1355 aValue
.setLength(aValue
.getLength()-1);
1357 return aValue
.makeStringAndClear();
1360 OUString SAL_CALL
ODatabaseMetaData::getTimeDateFunctions( ) throw(SQLException
, RuntimeException
, std::exception
)
1363 OUStringBuffer aValue
;
1364 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_TIMEDATE_FUNCTIONS
,nValue
,*this);
1366 if(nValue
& SQL_FN_TD_CURRENT_DATE
)
1367 aValue
.appendAscii("CURRENT_DATE,");
1368 if(nValue
& SQL_FN_TD_CURRENT_TIME
)
1369 aValue
.appendAscii("CURRENT_TIME,");
1370 if(nValue
& SQL_FN_TD_CURRENT_TIMESTAMP
)
1371 aValue
.appendAscii("CURRENT_TIMESTAMP,");
1372 if(nValue
& SQL_FN_TD_CURDATE
)
1373 aValue
.appendAscii("CURDATE,");
1374 if(nValue
& SQL_FN_TD_CURTIME
)
1375 aValue
.appendAscii("CURTIME,");
1376 if(nValue
& SQL_FN_TD_DAYNAME
)
1377 aValue
.appendAscii("DAYNAME,");
1378 if(nValue
& SQL_FN_TD_DAYOFMONTH
)
1379 aValue
.appendAscii("DAYOFMONTH,");
1380 if(nValue
& SQL_FN_TD_DAYOFWEEK
)
1381 aValue
.appendAscii("DAYOFWEEK,");
1382 if(nValue
& SQL_FN_TD_DAYOFYEAR
)
1383 aValue
.appendAscii("DAYOFYEAR,");
1384 if(nValue
& SQL_FN_TD_EXTRACT
)
1385 aValue
.appendAscii("EXTRACT,");
1386 if(nValue
& SQL_FN_TD_HOUR
)
1387 aValue
.appendAscii("HOUR,");
1388 if(nValue
& SQL_FN_TD_MINUTE
)
1389 aValue
.appendAscii("MINUTE,");
1390 if(nValue
& SQL_FN_TD_MONTH
)
1391 aValue
.appendAscii("MONTH,");
1392 if(nValue
& SQL_FN_TD_MONTHNAME
)
1393 aValue
.appendAscii("MONTHNAME,");
1394 if(nValue
& SQL_FN_TD_NOW
)
1395 aValue
.appendAscii("NOW,");
1396 if(nValue
& SQL_FN_TD_QUARTER
)
1397 aValue
.appendAscii("QUARTER,");
1398 if(nValue
& SQL_FN_TD_SECOND
)
1399 aValue
.appendAscii("SECOND,");
1400 if(nValue
& SQL_FN_TD_TIMESTAMPADD
)
1401 aValue
.appendAscii("TIMESTAMPADD,");
1402 if(nValue
& SQL_FN_TD_TIMESTAMPDIFF
)
1403 aValue
.appendAscii("TIMESTAMPDIFF,");
1404 if(nValue
& SQL_FN_TD_WEEK
)
1405 aValue
.appendAscii("WEEK,");
1406 if(nValue
& SQL_FN_TD_YEAR
)
1407 aValue
.appendAscii("YEAR,");
1409 if ( !aValue
.isEmpty() )
1410 aValue
.setLength(aValue
.getLength()-1);
1412 return aValue
.makeStringAndClear();
1415 OUString SAL_CALL
ODatabaseMetaData::getSystemFunctions( ) throw(SQLException
, RuntimeException
, std::exception
)
1418 OUStringBuffer aValue
;
1419 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_SYSTEM_FUNCTIONS
,nValue
,*this);
1421 if(nValue
& SQL_FN_SYS_DBNAME
)
1422 aValue
.appendAscii("DBNAME,");
1423 if(nValue
& SQL_FN_SYS_IFNULL
)
1424 aValue
.appendAscii("IFNULL,");
1425 if(nValue
& SQL_FN_SYS_USERNAME
)
1426 aValue
.appendAscii("USERNAME,");
1428 if ( !aValue
.isEmpty() )
1429 aValue
.setLength(aValue
.getLength()-1);
1431 return aValue
.makeStringAndClear();
1434 OUString SAL_CALL
ODatabaseMetaData::getNumericFunctions( ) throw(SQLException
, RuntimeException
, std::exception
)
1437 OUStringBuffer aValue
;
1438 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_NUMERIC_FUNCTIONS
,nValue
,*this);
1440 if(nValue
& SQL_FN_NUM_ABS
)
1441 aValue
.appendAscii("ABS,");
1442 if(nValue
& SQL_FN_NUM_ACOS
)
1443 aValue
.appendAscii("ACOS,");
1444 if(nValue
& SQL_FN_NUM_ASIN
)
1445 aValue
.appendAscii("ASIN,");
1446 if(nValue
& SQL_FN_NUM_ATAN
)
1447 aValue
.appendAscii("ATAN,");
1448 if(nValue
& SQL_FN_NUM_ATAN2
)
1449 aValue
.appendAscii("ATAN2,");
1450 if(nValue
& SQL_FN_NUM_CEILING
)
1451 aValue
.appendAscii("CEILING,");
1452 if(nValue
& SQL_FN_NUM_COS
)
1453 aValue
.appendAscii("COS,");
1454 if(nValue
& SQL_FN_NUM_COT
)
1455 aValue
.appendAscii("COT,");
1456 if(nValue
& SQL_FN_NUM_DEGREES
)
1457 aValue
.appendAscii("DEGREES,");
1458 if(nValue
& SQL_FN_NUM_EXP
)
1459 aValue
.appendAscii("EXP,");
1460 if(nValue
& SQL_FN_NUM_FLOOR
)
1461 aValue
.appendAscii("FLOOR,");
1462 if(nValue
& SQL_FN_NUM_LOG
)
1463 aValue
.appendAscii("LOGF,");
1464 if(nValue
& SQL_FN_NUM_LOG10
)
1465 aValue
.appendAscii("LOG10,");
1466 if(nValue
& SQL_FN_NUM_MOD
)
1467 aValue
.appendAscii("MOD,");
1468 if(nValue
& SQL_FN_NUM_PI
)
1469 aValue
.appendAscii("PI,");
1470 if(nValue
& SQL_FN_NUM_POWER
)
1471 aValue
.appendAscii("POWER,");
1472 if(nValue
& SQL_FN_NUM_RADIANS
)
1473 aValue
.appendAscii("RADIANS,");
1474 if(nValue
& SQL_FN_NUM_RAND
)
1475 aValue
.appendAscii("RAND,");
1476 if(nValue
& SQL_FN_NUM_ROUND
)
1477 aValue
.appendAscii("ROUND,");
1478 if(nValue
& SQL_FN_NUM_SIGN
)
1479 aValue
.appendAscii("SIGN,");
1480 if(nValue
& SQL_FN_NUM_SIN
)
1481 aValue
.appendAscii("SIN,");
1482 if(nValue
& SQL_FN_NUM_SQRT
)
1483 aValue
.appendAscii("SQRT,");
1484 if(nValue
& SQL_FN_NUM_TAN
)
1485 aValue
.appendAscii("TAN,");
1486 if(nValue
& SQL_FN_NUM_TRUNCATE
)
1487 aValue
.appendAscii("TRUNCATE,");
1489 if ( !aValue
.isEmpty() )
1490 aValue
.setLength(aValue
.getLength()-1);
1492 return aValue
.makeStringAndClear();
1495 sal_Bool SAL_CALL
ODatabaseMetaData::supportsExtendedSQLGrammar( ) throw(SQLException
, RuntimeException
, std::exception
)
1498 // SQL_ODBC_SQL_CONFORMANCE is deprecated in ODBC 3.x, but there does not seem te be any equivalent.
1499 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_ODBC_SQL_CONFORMANCE
,nValue
,*this);
1500 SAL_WARN_IF(! (nValue
== SQL_OSC_MINIMUM
|| nValue
== SQL_OSC_CORE
|| nValue
== SQL_OSC_EXTENDED
),
1501 "connectivity.odbc",
1502 "SQL_ODBC_SQL_CONFORMANCE is neither MINIMAL nor CORE nor EXTENDED");
1503 return nValue
== SQL_OSC_EXTENDED
;
1506 sal_Bool SAL_CALL
ODatabaseMetaData::supportsCoreSQLGrammar( ) throw(SQLException
, RuntimeException
, std::exception
)
1509 // SQL_ODBC_SQL_CONFORMANCE is deprecated in ODBC 3.x, but there does not seem te be any equivalent.
1510 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_ODBC_SQL_CONFORMANCE
,nValue
,*this);
1511 SAL_WARN_IF(! (nValue
== SQL_OSC_MINIMUM
|| nValue
== SQL_OSC_CORE
|| nValue
== SQL_OSC_EXTENDED
),
1512 "connectivity.odbc",
1513 "SQL_ODBC_SQL_CONFORMANCE is neither MINIMAL nor CORE nor EXTENDED");
1514 return nValue
== SQL_OSC_CORE
|| nValue
== SQL_OSC_EXTENDED
;
1517 sal_Bool SAL_CALL
ODatabaseMetaData::supportsMinimumSQLGrammar( ) throw(SQLException
, RuntimeException
, std::exception
)
1520 // SQL_ODBC_SQL_CONFORMANCE is deprecated in ODBC 3.x, but there does not seem te be any equivalent.
1521 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_ODBC_SQL_CONFORMANCE
,nValue
,*this);
1522 SAL_WARN_IF(! (nValue
== SQL_OSC_MINIMUM
|| nValue
== SQL_OSC_CORE
|| nValue
== SQL_OSC_EXTENDED
),
1523 "connectivity.odbc",
1524 "SQL_ODBC_SQL_CONFORMANCE is neither MINIMAL nor CORE nor EXTENDED");
1525 return nValue
== SQL_OSC_MINIMUM
|| nValue
== SQL_OSC_CORE
|| nValue
== SQL_OSC_EXTENDED
;
1528 sal_Bool SAL_CALL
ODatabaseMetaData::supportsFullOuterJoins( ) throw(SQLException
, RuntimeException
, std::exception
)
1531 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_OJ_CAPABILITIES
,nValue
,*this);
1532 return (nValue
& SQL_OJ_FULL
) == SQL_OJ_FULL
;
1535 sal_Bool SAL_CALL
ODatabaseMetaData::supportsLimitedOuterJoins( ) throw(SQLException
, RuntimeException
, std::exception
)
1537 return supportsFullOuterJoins( );
1540 sal_Int32 SAL_CALL
ODatabaseMetaData::getMaxColumnsInGroupBy( ) throw(SQLException
, RuntimeException
, std::exception
)
1542 SQLUSMALLINT nValue
;
1543 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_MAX_COLUMNS_IN_GROUP_BY
,nValue
,*this);
1547 sal_Int32 SAL_CALL
ODatabaseMetaData::getMaxColumnsInOrderBy( ) throw(SQLException
, RuntimeException
, std::exception
)
1549 SQLUSMALLINT nValue
;
1550 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_MAX_COLUMNS_IN_ORDER_BY
,nValue
,*this);
1554 sal_Int32 SAL_CALL
ODatabaseMetaData::getMaxColumnsInSelect( ) throw(SQLException
, RuntimeException
, std::exception
)
1556 SQLUSMALLINT nValue
;
1557 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_MAX_COLUMNS_IN_SELECT
,nValue
,*this);
1561 sal_Int32 SAL_CALL
ODatabaseMetaData::getMaxUserNameLength( ) throw(SQLException
, RuntimeException
, std::exception
)
1563 SQLUSMALLINT nValue
;
1564 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_MAX_USER_NAME_LEN
,nValue
,*this);
1568 sal_Bool SAL_CALL
ODatabaseMetaData::supportsResultSetType( sal_Int32 setType
) throw(SQLException
, RuntimeException
, std::exception
)
1571 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,SQL_CURSOR_SENSITIVITY
,nValue
,*this);
1572 return (nValue
& static_cast<SQLUINTEGER
>(setType
)) == static_cast<SQLUINTEGER
>(setType
);
1575 sal_Bool SAL_CALL
ODatabaseMetaData::supportsResultSetConcurrency( sal_Int32 setType
, sal_Int32 concurrency
) throw(SQLException
, RuntimeException
, std::exception
)
1578 SQLUSMALLINT
nAskFor( SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2
);
1582 case ResultSetType::FORWARD_ONLY
:
1583 nAskFor
= SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2
;
1585 case ResultSetType::SCROLL_INSENSITIVE
:
1586 nAskFor
= SQL_STATIC_CURSOR_ATTRIBUTES2
;
1588 case ResultSetType::SCROLL_SENSITIVE
:
1589 nAskFor
= SQL_DYNAMIC_CURSOR_ATTRIBUTES2
;
1593 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,nAskFor
,nValue
,*this);
1597 case ResultSetConcurrency::READ_ONLY
:
1598 bRet
= (nValue
& SQL_CA2_READ_ONLY_CONCURRENCY
) == SQL_CA2_READ_ONLY_CONCURRENCY
;
1600 case ResultSetConcurrency::UPDATABLE
:
1601 bRet
= (nValue
& SQL_CA2_OPT_VALUES_CONCURRENCY
) == SQL_CA2_OPT_VALUES_CONCURRENCY
;
1607 sal_Bool SAL_CALL
ODatabaseMetaData::ownUpdatesAreVisible( sal_Int32 setType
) throw(SQLException
, RuntimeException
, std::exception
)
1610 SQLUSMALLINT
nAskFor( SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2
);
1614 case ResultSetType::FORWARD_ONLY
:
1615 nAskFor
= SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2
;
1617 case ResultSetType::SCROLL_INSENSITIVE
:
1618 nAskFor
= SQL_STATIC_CURSOR_ATTRIBUTES2
;
1620 case ResultSetType::SCROLL_SENSITIVE
:
1621 nAskFor
= SQL_DYNAMIC_CURSOR_ATTRIBUTES2
;
1625 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,nAskFor
,nValue
,*this);
1626 return (nValue
& SQL_CA2_SENSITIVITY_UPDATES
) == SQL_CA2_SENSITIVITY_UPDATES
;
1629 sal_Bool SAL_CALL
ODatabaseMetaData::ownDeletesAreVisible( sal_Int32 setType
) throw(SQLException
, RuntimeException
, std::exception
)
1632 SQLUSMALLINT
nAskFor( SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2
);
1636 case ResultSetType::FORWARD_ONLY
:
1637 nAskFor
= SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2
;
1639 case ResultSetType::SCROLL_INSENSITIVE
:
1640 nAskFor
= SQL_STATIC_CURSOR_ATTRIBUTES2
;
1642 case ResultSetType::SCROLL_SENSITIVE
:
1643 nAskFor
= SQL_DYNAMIC_CURSOR_ATTRIBUTES2
;
1647 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,nAskFor
,nValue
,*this);
1648 return (nValue
& SQL_CA2_SENSITIVITY_DELETIONS
) != SQL_CA2_SENSITIVITY_DELETIONS
;
1651 sal_Bool SAL_CALL
ODatabaseMetaData::ownInsertsAreVisible( sal_Int32 setType
) throw(SQLException
, RuntimeException
, std::exception
)
1654 SQLUSMALLINT
nAskFor( SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2
);
1658 case ResultSetType::FORWARD_ONLY
:
1659 nAskFor
= SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2
;
1661 case ResultSetType::SCROLL_INSENSITIVE
:
1662 nAskFor
= SQL_STATIC_CURSOR_ATTRIBUTES2
;
1664 case ResultSetType::SCROLL_SENSITIVE
:
1665 nAskFor
= SQL_DYNAMIC_CURSOR_ATTRIBUTES2
;
1669 OTools::GetInfo(m_pConnection
,m_aConnectionHandle
,nAskFor
,nValue
,*this);
1670 return (nValue
& SQL_CA2_SENSITIVITY_ADDITIONS
) == SQL_CA2_SENSITIVITY_ADDITIONS
;
1673 sal_Bool SAL_CALL
ODatabaseMetaData::othersUpdatesAreVisible( sal_Int32 setType
) throw(SQLException
, RuntimeException
, std::exception
)
1675 return ownUpdatesAreVisible(setType
);
1678 sal_Bool SAL_CALL
ODatabaseMetaData::othersDeletesAreVisible( sal_Int32 setType
) throw(SQLException
, RuntimeException
, std::exception
)
1680 return ownDeletesAreVisible(setType
);
1683 sal_Bool SAL_CALL
ODatabaseMetaData::othersInsertsAreVisible( sal_Int32 setType
) throw(SQLException
, RuntimeException
, std::exception
)
1685 return ownInsertsAreVisible(setType
);
1688 sal_Bool SAL_CALL
ODatabaseMetaData::updatesAreDetected( sal_Int32
/*setType*/ ) throw(SQLException
, RuntimeException
, std::exception
)
1693 sal_Bool SAL_CALL
ODatabaseMetaData::deletesAreDetected( sal_Int32
/*setType*/ ) throw(SQLException
, RuntimeException
, std::exception
)
1698 sal_Bool SAL_CALL
ODatabaseMetaData::insertsAreDetected( sal_Int32
/*setType*/ ) throw(SQLException
, RuntimeException
, std::exception
)
1703 sal_Bool SAL_CALL
ODatabaseMetaData::supportsBatchUpdates( ) throw(SQLException
, RuntimeException
, std::exception
)
1708 Reference
< XResultSet
> SAL_CALL
ODatabaseMetaData::getUDTs( const Any
& /*catalog*/, const OUString
& /*schemaPattern*/, const OUString
& /*typeNamePattern*/, const Sequence
< sal_Int32
>& /*types*/ ) throw(SQLException
, RuntimeException
, std::exception
)
1714 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */