1*9b5730f6SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*9b5730f6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*9b5730f6SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*9b5730f6SAndrew Rist * distributed with this work for additional information 6*9b5730f6SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*9b5730f6SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*9b5730f6SAndrew Rist * "License"); you may not use this file except in compliance 9*9b5730f6SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*9b5730f6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*9b5730f6SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*9b5730f6SAndrew Rist * software distributed under the License is distributed on an 15*9b5730f6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*9b5730f6SAndrew Rist * KIND, either express or implied. See the License for the 17*9b5730f6SAndrew Rist * specific language governing permissions and limitations 18*9b5730f6SAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*9b5730f6SAndrew Rist *************************************************************/ 21*9b5730f6SAndrew Rist 22*9b5730f6SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 25cdf0e10cSrcweir #include "precompiled_connectivity.hxx" 26cdf0e10cSrcweir #include "ado/ADatabaseMetaData.hxx" 27cdf0e10cSrcweir #include "ado/ADatabaseMetaDataResultSet.hxx" 28cdf0e10cSrcweir #include <com/sun/star/sdbc/DataType.hpp> 29cdf0e10cSrcweir #include <com/sun/star/sdbc/ResultSetType.hpp> 30cdf0e10cSrcweir #include <com/sun/star/sdbc/ResultSetConcurrency.hpp> 31cdf0e10cSrcweir #include <com/sun/star/sdbc/TransactionIsolation.hpp> 32cdf0e10cSrcweir #include "ado/AConnection.hxx" 33cdf0e10cSrcweir #include "ado/adoimp.hxx" 34cdf0e10cSrcweir #include "FDatabaseMetaDataResultSet.hxx" 35cdf0e10cSrcweir #include <comphelper/types.hxx> 36cdf0e10cSrcweir #include <connectivity/dbexception.hxx> 37cdf0e10cSrcweir 38cdf0e10cSrcweir using namespace ::comphelper; 39cdf0e10cSrcweir 40cdf0e10cSrcweir using namespace connectivity; 41cdf0e10cSrcweir using namespace connectivity::ado; 42cdf0e10cSrcweir using namespace com::sun::star::uno; 43cdf0e10cSrcweir using namespace com::sun::star::lang; 44cdf0e10cSrcweir using namespace com::sun::star::beans; 45cdf0e10cSrcweir using namespace com::sun::star::sdbc; 46cdf0e10cSrcweir 47cdf0e10cSrcweir 48cdf0e10cSrcweir // using namespace connectivity; 49cdf0e10cSrcweir 50cdf0e10cSrcweir ODatabaseMetaData::ODatabaseMetaData(OConnection* _pCon) 51cdf0e10cSrcweir : ::connectivity::ODatabaseMetaDataBase(_pCon,_pCon->getConnectionInfo()) 52cdf0e10cSrcweir ,m_pADOConnection(_pCon->getConnection()) 53cdf0e10cSrcweir ,m_pConnection(_pCon) 54cdf0e10cSrcweir { 55cdf0e10cSrcweir } 56cdf0e10cSrcweir // ------------------------------------------------------------------------- 57cdf0e10cSrcweir sal_Int32 ODatabaseMetaData::getInt32Property(const ::rtl::OUString& _aProperty) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) 58cdf0e10cSrcweir { 59cdf0e10cSrcweir connectivity::ado::WpADOProperties aProps(m_pADOConnection->get_Properties()); 60cdf0e10cSrcweir // ADOS::ThrowException(*m_pADOConnection,*this); 61cdf0e10cSrcweir OSL_ENSURE(aProps.IsValid(),"There are no properties at the connection"); 62cdf0e10cSrcweir ADO_PROP(_aProperty); 63cdf0e10cSrcweir sal_Int32 nValue(0); 64cdf0e10cSrcweir if(!aVar.isNull() && !aVar.isEmpty()) 65cdf0e10cSrcweir nValue = aVar; 66cdf0e10cSrcweir return nValue; 67cdf0e10cSrcweir } 68cdf0e10cSrcweir 69cdf0e10cSrcweir // ------------------------------------------------------------------------- 70cdf0e10cSrcweir sal_Bool ODatabaseMetaData::getBoolProperty(const ::rtl::OUString& _aProperty) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) 71cdf0e10cSrcweir { 72cdf0e10cSrcweir connectivity::ado::WpADOProperties aProps(m_pADOConnection->get_Properties()); 73cdf0e10cSrcweir ADOS::ThrowException(*m_pADOConnection,*this); 74cdf0e10cSrcweir OSL_ENSURE(aProps.IsValid(),"There are no properties at the connection"); 75cdf0e10cSrcweir ADO_PROP(_aProperty); 76cdf0e10cSrcweir return (!aVar.isNull() && !aVar.isEmpty() ? aVar.getBool() : sal_False); 77cdf0e10cSrcweir } 78cdf0e10cSrcweir // ------------------------------------------------------------------------- 79cdf0e10cSrcweir ::rtl::OUString ODatabaseMetaData::getStringProperty(const ::rtl::OUString& _aProperty) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) 80cdf0e10cSrcweir { 81cdf0e10cSrcweir connectivity::ado::WpADOProperties aProps(m_pADOConnection->get_Properties()); 82cdf0e10cSrcweir ADOS::ThrowException(*m_pADOConnection,*this); 83cdf0e10cSrcweir OSL_ENSURE(aProps.IsValid(),"There are no properties at the connection"); 84cdf0e10cSrcweir 85cdf0e10cSrcweir ADO_PROP(_aProperty); 86cdf0e10cSrcweir ::rtl::OUString aValue; 87cdf0e10cSrcweir if(!aVar.isNull() && !aVar.isEmpty() && aVar.getType() == VT_BSTR) 88cdf0e10cSrcweir aValue = aVar; 89cdf0e10cSrcweir 90cdf0e10cSrcweir return aValue; 91cdf0e10cSrcweir } 92cdf0e10cSrcweir // ------------------------------------------------------------------------- 93cdf0e10cSrcweir Reference< XResultSet > ODatabaseMetaData::impl_getTypeInfo_throw( ) 94cdf0e10cSrcweir { 95cdf0e10cSrcweir ADORecordset *pRecordset = m_pADOConnection->getTypeInfo(); 96cdf0e10cSrcweir // ADOS::ThrowException(*m_pADOConnection,*this); 97cdf0e10cSrcweir 98cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset); 99cdf0e10cSrcweir pResult->setTypeInfoMap(ADOS::isJetEngine(m_pConnection->getEngineType())); 100cdf0e10cSrcweir Reference< XResultSet > xRef = pResult; 101cdf0e10cSrcweir return xRef; 102cdf0e10cSrcweir } 103cdf0e10cSrcweir // ------------------------------------------------------------------------- 104cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCatalogs( ) throw(SQLException, RuntimeException) 105cdf0e10cSrcweir { 106cdf0e10cSrcweir OLEVariant vtEmpty; 107cdf0e10cSrcweir vtEmpty.setNoArg(); 108cdf0e10cSrcweir 109cdf0e10cSrcweir ADORecordset *pRecordset = NULL; 110cdf0e10cSrcweir m_pADOConnection->OpenSchema(adSchemaCatalogs,vtEmpty,vtEmpty,&pRecordset); 111cdf0e10cSrcweir ADOS::ThrowException(*m_pADOConnection,*this); 112cdf0e10cSrcweir 113cdf0e10cSrcweir Reference< XResultSet > xRef; 114cdf0e10cSrcweir 115cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset); 116cdf0e10cSrcweir pResult->setCatalogsMap(); 117cdf0e10cSrcweir xRef = pResult; 118cdf0e10cSrcweir 119cdf0e10cSrcweir return xRef; 120cdf0e10cSrcweir } 121cdf0e10cSrcweir // ------------------------------------------------------------------------- 122cdf0e10cSrcweir ::rtl::OUString ODatabaseMetaData::impl_getCatalogSeparator_throw( ) 123cdf0e10cSrcweir { 124cdf0e10cSrcweir return getLiteral(DBLITERAL_CATALOG_SEPARATOR); 125cdf0e10cSrcweir } 126cdf0e10cSrcweir // ------------------------------------------------------------------------- 127cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getSchemas( ) throw(SQLException, RuntimeException) 128cdf0e10cSrcweir { 129cdf0e10cSrcweir OLEVariant vtEmpty; 130cdf0e10cSrcweir vtEmpty.setNoArg(); 131cdf0e10cSrcweir 132cdf0e10cSrcweir ADORecordset *pRecordset = NULL; 133cdf0e10cSrcweir m_pADOConnection->OpenSchema(adSchemaSchemata,vtEmpty,vtEmpty,&pRecordset); 134cdf0e10cSrcweir ADOS::ThrowException(*m_pADOConnection,*this); 135cdf0e10cSrcweir 136cdf0e10cSrcweir Reference< XResultSet > xRef; 137cdf0e10cSrcweir 138cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset); 139cdf0e10cSrcweir pResult->setSchemasMap(); 140cdf0e10cSrcweir xRef = pResult; 141cdf0e10cSrcweir return xRef; 142cdf0e10cSrcweir } 143cdf0e10cSrcweir // ------------------------------------------------------------------------- 144cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumnPrivileges( 145cdf0e10cSrcweir const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, 146cdf0e10cSrcweir const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException) 147cdf0e10cSrcweir { 148cdf0e10cSrcweir ADORecordset *pRecordset = m_pADOConnection->getColumnPrivileges(catalog,schema,table,columnNamePattern); 149cdf0e10cSrcweir ADOS::ThrowException(*m_pADOConnection,*this); 150cdf0e10cSrcweir 151cdf0e10cSrcweir Reference< XResultSet > xRef; 152cdf0e10cSrcweir 153cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset); 154cdf0e10cSrcweir pResult->setColumnPrivilegesMap(); 155cdf0e10cSrcweir xRef = pResult; 156cdf0e10cSrcweir return xRef; 157cdf0e10cSrcweir } 158cdf0e10cSrcweir // ------------------------------------------------------------------------- 159cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns( 160cdf0e10cSrcweir const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, 161cdf0e10cSrcweir const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException) 162cdf0e10cSrcweir { 163cdf0e10cSrcweir ADORecordset *pRecordset = m_pADOConnection->getColumns(catalog,schemaPattern,tableNamePattern,columnNamePattern); 164cdf0e10cSrcweir ADOS::ThrowException(*m_pADOConnection,*this); 165cdf0e10cSrcweir 166cdf0e10cSrcweir Reference< XResultSet > xRef; 167cdf0e10cSrcweir 168cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset); 169cdf0e10cSrcweir pResult->setColumnsMap(); 170cdf0e10cSrcweir xRef = pResult; 171cdf0e10cSrcweir 172cdf0e10cSrcweir return xRef; 173cdf0e10cSrcweir } 174cdf0e10cSrcweir // ------------------------------------------------------------------------- 175cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables( 176cdf0e10cSrcweir const Any& catalog, const ::rtl::OUString& schemaPattern, 177cdf0e10cSrcweir const ::rtl::OUString& tableNamePattern, const Sequence< ::rtl::OUString >& types ) throw(SQLException, RuntimeException) 178cdf0e10cSrcweir { 179cdf0e10cSrcweir ADORecordset *pRecordset = m_pADOConnection->getTables(catalog,schemaPattern,tableNamePattern,types); 180cdf0e10cSrcweir ADOS::ThrowException(*m_pADOConnection,*this); 181cdf0e10cSrcweir 182cdf0e10cSrcweir Reference< XResultSet > xRef; 183cdf0e10cSrcweir 184cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset); 185cdf0e10cSrcweir pResult->setTablesMap(); 186cdf0e10cSrcweir xRef = pResult; 187cdf0e10cSrcweir 188cdf0e10cSrcweir return xRef; 189cdf0e10cSrcweir } 190cdf0e10cSrcweir // ------------------------------------------------------------------------- 191cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedureColumns( 192cdf0e10cSrcweir const Any& catalog, const ::rtl::OUString& schemaPattern, 193cdf0e10cSrcweir const ::rtl::OUString& procedureNamePattern, const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException) 194cdf0e10cSrcweir { 195cdf0e10cSrcweir ADORecordset *pRecordset = m_pADOConnection->getProcedureColumns(catalog,schemaPattern,procedureNamePattern,columnNamePattern); 196cdf0e10cSrcweir ADOS::ThrowException(*m_pADOConnection,*this); 197cdf0e10cSrcweir 198cdf0e10cSrcweir Reference< XResultSet > xRef; 199cdf0e10cSrcweir 200cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset); 201cdf0e10cSrcweir pResult->setProcedureColumnsMap(); 202cdf0e10cSrcweir xRef = pResult; 203cdf0e10cSrcweir 204cdf0e10cSrcweir return xRef; 205cdf0e10cSrcweir } 206cdf0e10cSrcweir // ------------------------------------------------------------------------- 207cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedures( 208cdf0e10cSrcweir const Any& catalog, const ::rtl::OUString& schemaPattern, 209cdf0e10cSrcweir const ::rtl::OUString& procedureNamePattern ) throw(SQLException, RuntimeException) 210cdf0e10cSrcweir { 211cdf0e10cSrcweir // Create elements used in the array 212cdf0e10cSrcweir ADORecordset *pRecordset = m_pADOConnection->getProcedures(catalog,schemaPattern,procedureNamePattern); 213cdf0e10cSrcweir ADOS::ThrowException(*m_pADOConnection,*this); 214cdf0e10cSrcweir 215cdf0e10cSrcweir Reference< XResultSet > xRef; 216cdf0e10cSrcweir 217cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset); 218cdf0e10cSrcweir pResult->setProceduresMap(); 219cdf0e10cSrcweir xRef = pResult; 220cdf0e10cSrcweir 221cdf0e10cSrcweir return xRef; 222cdf0e10cSrcweir } 223cdf0e10cSrcweir // ------------------------------------------------------------------------- 224cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxBinaryLiteralLength( ) throw(SQLException, RuntimeException) 225cdf0e10cSrcweir { 226cdf0e10cSrcweir return getMaxSize(DBLITERAL_BINARY_LITERAL); 227cdf0e10cSrcweir } 228cdf0e10cSrcweir // ------------------------------------------------------------------------- 229cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxRowSize( ) throw(SQLException, RuntimeException) 230cdf0e10cSrcweir { 231cdf0e10cSrcweir return getInt32Property(::rtl::OUString::createFromAscii("Maximum Row Size")); 232cdf0e10cSrcweir } 233cdf0e10cSrcweir // ------------------------------------------------------------------------- 234cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCatalogNameLength( ) throw(SQLException, RuntimeException) 235cdf0e10cSrcweir { 236cdf0e10cSrcweir return getMaxSize(DBLITERAL_CATALOG_NAME); 237cdf0e10cSrcweir } 238cdf0e10cSrcweir // ------------------------------------------------------------------------- 239cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCharLiteralLength( ) throw(SQLException, RuntimeException) 240cdf0e10cSrcweir { 241cdf0e10cSrcweir return getMaxSize(DBLITERAL_CHAR_LITERAL); 242cdf0e10cSrcweir } 243cdf0e10cSrcweir // ------------------------------------------------------------------------- 244cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnNameLength( ) throw(SQLException, RuntimeException) 245cdf0e10cSrcweir { 246cdf0e10cSrcweir return getMaxSize(DBLITERAL_COLUMN_NAME); 247cdf0e10cSrcweir } 248cdf0e10cSrcweir // ------------------------------------------------------------------------- 249cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInIndex( ) throw(SQLException, RuntimeException) 250cdf0e10cSrcweir { 251cdf0e10cSrcweir // return getInt32Property(::rtl::OUString::createFromAscii("Max Columns in Index")); 252cdf0e10cSrcweir return 0; 253cdf0e10cSrcweir } 254cdf0e10cSrcweir // ------------------------------------------------------------------------- 255cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCursorNameLength( ) throw(SQLException, RuntimeException) 256cdf0e10cSrcweir { 257cdf0e10cSrcweir return getMaxSize(DBLITERAL_CURSOR_NAME); 258cdf0e10cSrcweir } 259cdf0e10cSrcweir // ------------------------------------------------------------------------- 260cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxConnections( ) throw(SQLException, RuntimeException) 261cdf0e10cSrcweir { 262cdf0e10cSrcweir return getInt32Property(::rtl::OUString::createFromAscii("Active Sessions")); 263cdf0e10cSrcweir } 264cdf0e10cSrcweir // ------------------------------------------------------------------------- 265cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInTable( ) throw(SQLException, RuntimeException) 266cdf0e10cSrcweir { 267cdf0e10cSrcweir return getInt32Property(::rtl::OUString::createFromAscii("Max Columns in Table")); 268cdf0e10cSrcweir } 269cdf0e10cSrcweir // ------------------------------------------------------------------------- 270cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxStatementLength( ) throw(SQLException, RuntimeException) 271cdf0e10cSrcweir { 272cdf0e10cSrcweir return getMaxSize(DBLITERAL_TEXT_COMMAND); 273cdf0e10cSrcweir } 274cdf0e10cSrcweir // ------------------------------------------------------------------------- 275cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxTableNameLength( ) throw(SQLException, RuntimeException) 276cdf0e10cSrcweir { 277cdf0e10cSrcweir return getMaxSize(DBLITERAL_TABLE_NAME); 278cdf0e10cSrcweir } 279cdf0e10cSrcweir // ------------------------------------------------------------------------- 280cdf0e10cSrcweir sal_Int32 ODatabaseMetaData::impl_getMaxTablesInSelect_throw( ) 281cdf0e10cSrcweir { 282cdf0e10cSrcweir return getInt32Property(::rtl::OUString::createFromAscii("Maximum Tables in SELECT")); 283cdf0e10cSrcweir } 284cdf0e10cSrcweir // ------------------------------------------------------------------------- 285cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getExportedKeys( 286cdf0e10cSrcweir const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException) 287cdf0e10cSrcweir { 288cdf0e10cSrcweir ADORecordset *pRecordset = m_pADOConnection->getExportedKeys(catalog,schema,table); 289cdf0e10cSrcweir ADOS::ThrowException(*m_pADOConnection,*this); 290cdf0e10cSrcweir 291cdf0e10cSrcweir Reference< XResultSet > xRef; 292cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset); 293cdf0e10cSrcweir pResult->setCrossReferenceMap(); 294cdf0e10cSrcweir xRef = pResult; 295cdf0e10cSrcweir 296cdf0e10cSrcweir return xRef; 297cdf0e10cSrcweir } 298cdf0e10cSrcweir // ------------------------------------------------------------------------- 299cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getImportedKeys( 300cdf0e10cSrcweir const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException) 301cdf0e10cSrcweir { 302cdf0e10cSrcweir ADORecordset *pRecordset = m_pADOConnection->getImportedKeys(catalog,schema,table); 303cdf0e10cSrcweir ADOS::ThrowException(*m_pADOConnection,*this); 304cdf0e10cSrcweir 305cdf0e10cSrcweir Reference< XResultSet > xRef; 306cdf0e10cSrcweir 307cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset); 308cdf0e10cSrcweir pResult->setCrossReferenceMap(); 309cdf0e10cSrcweir xRef = pResult; 310cdf0e10cSrcweir 311cdf0e10cSrcweir return xRef; 312cdf0e10cSrcweir } 313cdf0e10cSrcweir // ------------------------------------------------------------------------- 314cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getPrimaryKeys( 315cdf0e10cSrcweir const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException) 316cdf0e10cSrcweir { 317cdf0e10cSrcweir ADORecordset *pRecordset = m_pADOConnection->getPrimaryKeys(catalog,schema,table); 318cdf0e10cSrcweir ADOS::ThrowException(*m_pADOConnection,*this); 319cdf0e10cSrcweir 320cdf0e10cSrcweir Reference< XResultSet > xRef; 321cdf0e10cSrcweir 322cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset); 323cdf0e10cSrcweir pResult->setPrimaryKeysMap(); 324cdf0e10cSrcweir xRef = pResult; 325cdf0e10cSrcweir 326cdf0e10cSrcweir return xRef; 327cdf0e10cSrcweir } 328cdf0e10cSrcweir // ------------------------------------------------------------------------- 329cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getIndexInfo( 330cdf0e10cSrcweir const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, 331cdf0e10cSrcweir sal_Bool unique, sal_Bool approximate ) throw(SQLException, RuntimeException) 332cdf0e10cSrcweir { 333cdf0e10cSrcweir ADORecordset *pRecordset = m_pADOConnection->getIndexInfo(catalog,schema,table,unique,approximate); 334cdf0e10cSrcweir ADOS::ThrowException(*m_pADOConnection,*this); 335cdf0e10cSrcweir 336cdf0e10cSrcweir Reference< XResultSet > xRef; 337cdf0e10cSrcweir 338cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset); 339cdf0e10cSrcweir pResult->setIndexInfoMap(); 340cdf0e10cSrcweir xRef = pResult; 341cdf0e10cSrcweir 342cdf0e10cSrcweir return xRef; 343cdf0e10cSrcweir } 344cdf0e10cSrcweir // ------------------------------------------------------------------------- 345cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges( 346cdf0e10cSrcweir const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern ) throw(SQLException, RuntimeException) 347cdf0e10cSrcweir { 348cdf0e10cSrcweir Reference< XResultSet > xRef; 349cdf0e10cSrcweir if(!ADOS::isJetEngine(m_pConnection->getEngineType())) 350cdf0e10cSrcweir { // the jet provider doesn't support this method 351cdf0e10cSrcweir // Create elements used in the array 352cdf0e10cSrcweir 353cdf0e10cSrcweir ADORecordset *pRecordset = m_pADOConnection->getTablePrivileges(catalog,schemaPattern,tableNamePattern); 354cdf0e10cSrcweir ADOS::ThrowException(*m_pADOConnection,*this); 355cdf0e10cSrcweir 356cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset); 357cdf0e10cSrcweir pResult->setTablePrivilegesMap(); 358cdf0e10cSrcweir xRef = pResult; 359cdf0e10cSrcweir } 360cdf0e10cSrcweir else 361cdf0e10cSrcweir { 362cdf0e10cSrcweir ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTablePrivileges); 363cdf0e10cSrcweir xRef = pResult; 364cdf0e10cSrcweir ::connectivity::ODatabaseMetaDataResultSet::ORows aRows; 365cdf0e10cSrcweir ::connectivity::ODatabaseMetaDataResultSet::ORow aRow(8); 366cdf0e10cSrcweir aRows.reserve(8); 367cdf0e10cSrcweir 368cdf0e10cSrcweir aRow[0] = ::connectivity::ODatabaseMetaDataResultSet::getEmptyValue(); 369cdf0e10cSrcweir aRow[1] = ::connectivity::ODatabaseMetaDataResultSet::getEmptyValue(); 370cdf0e10cSrcweir aRow[2] = new ::connectivity::ORowSetValueDecorator(tableNamePattern); 371cdf0e10cSrcweir aRow[3] = ::connectivity::ODatabaseMetaDataResultSet::getEmptyValue(); 372cdf0e10cSrcweir aRow[4] = ::connectivity::ODatabaseMetaDataResultSet::getEmptyValue(); 373cdf0e10cSrcweir aRow[5] = new ::connectivity::ORowSetValueDecorator(getUserName()); 374cdf0e10cSrcweir aRow[6] = ::connectivity::ODatabaseMetaDataResultSet::getSelectValue(); 375cdf0e10cSrcweir aRow[7] = new ::connectivity::ORowSetValueDecorator(::rtl::OUString::createFromAscii("NO")); 376cdf0e10cSrcweir 377cdf0e10cSrcweir aRows.push_back(aRow); 378cdf0e10cSrcweir aRow[6] = ::connectivity::ODatabaseMetaDataResultSet::getInsertValue(); 379cdf0e10cSrcweir aRows.push_back(aRow); 380cdf0e10cSrcweir aRow[6] = ::connectivity::ODatabaseMetaDataResultSet::getDeleteValue(); 381cdf0e10cSrcweir aRows.push_back(aRow); 382cdf0e10cSrcweir aRow[6] = ::connectivity::ODatabaseMetaDataResultSet::getUpdateValue(); 383cdf0e10cSrcweir aRows.push_back(aRow); 384cdf0e10cSrcweir aRow[6] = ::connectivity::ODatabaseMetaDataResultSet::getCreateValue(); 385cdf0e10cSrcweir aRows.push_back(aRow); 386cdf0e10cSrcweir aRow[6] = ::connectivity::ODatabaseMetaDataResultSet::getReadValue(); 387cdf0e10cSrcweir aRows.push_back(aRow); 388cdf0e10cSrcweir aRow[6] = ::connectivity::ODatabaseMetaDataResultSet::getAlterValue(); 389cdf0e10cSrcweir aRows.push_back(aRow); 390cdf0e10cSrcweir aRow[6] = ::connectivity::ODatabaseMetaDataResultSet::getDropValue(); 391cdf0e10cSrcweir aRows.push_back(aRow); 392cdf0e10cSrcweir pResult->setRows(aRows); 393cdf0e10cSrcweir } 394cdf0e10cSrcweir 395cdf0e10cSrcweir return xRef; 396cdf0e10cSrcweir } 397cdf0e10cSrcweir // ------------------------------------------------------------------------- 398cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCrossReference( 399cdf0e10cSrcweir const Any& primaryCatalog, const ::rtl::OUString& primarySchema, 400cdf0e10cSrcweir const ::rtl::OUString& primaryTable, const Any& foreignCatalog, 401cdf0e10cSrcweir const ::rtl::OUString& foreignSchema, const ::rtl::OUString& foreignTable ) throw(SQLException, RuntimeException) 402cdf0e10cSrcweir { 403cdf0e10cSrcweir ADORecordset *pRecordset = m_pADOConnection->getCrossReference(primaryCatalog,primarySchema,primaryTable,foreignCatalog,foreignSchema,foreignTable); 404cdf0e10cSrcweir ADOS::ThrowException(*m_pADOConnection,*this); 405cdf0e10cSrcweir 406cdf0e10cSrcweir Reference< XResultSet > xRef; 407cdf0e10cSrcweir 408cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(pRecordset); 409cdf0e10cSrcweir pResult->setCrossReferenceMap(); 410cdf0e10cSrcweir xRef = pResult; 411cdf0e10cSrcweir 412cdf0e10cSrcweir return xRef; 413cdf0e10cSrcweir } 414cdf0e10cSrcweir // ------------------------------------------------------------------------- 415cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::doesMaxRowSizeIncludeBlobs( ) throw(SQLException, RuntimeException) 416cdf0e10cSrcweir { 417cdf0e10cSrcweir return getBoolProperty(::rtl::OUString::createFromAscii("Maximum Row Size Includes BLOB")); 418cdf0e10cSrcweir } 419cdf0e10cSrcweir // ------------------------------------------------------------------------- 420cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException) 421cdf0e10cSrcweir { 422cdf0e10cSrcweir return (getInt32Property(::rtl::OUString::createFromAscii("Identifier Case Sensitivity")) & DBPROPVAL_IC_LOWER) == DBPROPVAL_IC_LOWER ; 423cdf0e10cSrcweir } 424cdf0e10cSrcweir // ------------------------------------------------------------------------- 425cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseIdentifiers( ) throw(SQLException, RuntimeException) 426cdf0e10cSrcweir { 427cdf0e10cSrcweir return (getInt32Property(::rtl::OUString::createFromAscii("Identifier Case Sensitivity")) & DBPROPVAL_IC_LOWER) == DBPROPVAL_IC_LOWER ; 428cdf0e10cSrcweir } 429cdf0e10cSrcweir // ------------------------------------------------------------------------- 430cdf0e10cSrcweir sal_Bool ODatabaseMetaData::impl_storesMixedCaseQuotedIdentifiers_throw( ) 431cdf0e10cSrcweir { 432cdf0e10cSrcweir return (getInt32Property(::rtl::OUString::createFromAscii("Identifier Case Sensitivity")) & DBPROPVAL_IC_MIXED) == DBPROPVAL_IC_MIXED ; 433cdf0e10cSrcweir } 434cdf0e10cSrcweir // ------------------------------------------------------------------------- 435cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::storesMixedCaseIdentifiers( ) throw(SQLException, RuntimeException) 436cdf0e10cSrcweir { 437cdf0e10cSrcweir return (getInt32Property(::rtl::OUString::createFromAscii("Identifier Case Sensitivity")) & DBPROPVAL_IC_MIXED) == DBPROPVAL_IC_MIXED ; 438cdf0e10cSrcweir } 439cdf0e10cSrcweir // ------------------------------------------------------------------------- 440cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException) 441cdf0e10cSrcweir { 442cdf0e10cSrcweir return (getInt32Property(::rtl::OUString::createFromAscii("Identifier Case Sensitivity")) & DBPROPVAL_IC_UPPER) == DBPROPVAL_IC_UPPER ; 443cdf0e10cSrcweir } 444cdf0e10cSrcweir // ------------------------------------------------------------------------- 445cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseIdentifiers( ) throw(SQLException, RuntimeException) 446cdf0e10cSrcweir { 447cdf0e10cSrcweir return (getInt32Property(::rtl::OUString::createFromAscii("Identifier Case Sensitivity")) & DBPROPVAL_IC_UPPER) == DBPROPVAL_IC_UPPER ; 448cdf0e10cSrcweir } 449cdf0e10cSrcweir // ------------------------------------------------------------------------- 450cdf0e10cSrcweir sal_Bool ODatabaseMetaData::impl_supportsAlterTableWithAddColumn_throw( ) 451cdf0e10cSrcweir { 452cdf0e10cSrcweir return sal_True; 453cdf0e10cSrcweir } 454cdf0e10cSrcweir // ------------------------------------------------------------------------- 455cdf0e10cSrcweir sal_Bool ODatabaseMetaData::impl_supportsAlterTableWithDropColumn_throw( ) 456cdf0e10cSrcweir { 457cdf0e10cSrcweir return sal_True; 458cdf0e10cSrcweir } 459cdf0e10cSrcweir // ------------------------------------------------------------------------- 460cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxIndexLength( ) throw(SQLException, RuntimeException) 461cdf0e10cSrcweir { 462cdf0e10cSrcweir return getInt32Property(::rtl::OUString::createFromAscii("Maximum Index Size")); 463cdf0e10cSrcweir } 464cdf0e10cSrcweir // ------------------------------------------------------------------------- 465cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsNonNullableColumns( ) throw(SQLException, RuntimeException) 466cdf0e10cSrcweir { 467cdf0e10cSrcweir return getInt32Property(::rtl::OUString::createFromAscii("NULL Concatenation Behavior")) == DBPROPVAL_CB_NON_NULL; 468cdf0e10cSrcweir } 469cdf0e10cSrcweir // ------------------------------------------------------------------------- 470cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getCatalogTerm( ) throw(SQLException, RuntimeException) 471cdf0e10cSrcweir { 472cdf0e10cSrcweir return getStringProperty(::rtl::OUString::createFromAscii("Catalog Term")); 473cdf0e10cSrcweir } 474cdf0e10cSrcweir // ------------------------------------------------------------------------- 475cdf0e10cSrcweir ::rtl::OUString ODatabaseMetaData::impl_getIdentifierQuoteString_throw( ) 476cdf0e10cSrcweir { 477cdf0e10cSrcweir return getLiteral(DBLITERAL_QUOTE_PREFIX); 478cdf0e10cSrcweir 479cdf0e10cSrcweir } 480cdf0e10cSrcweir // ------------------------------------------------------------------------- 481cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getExtraNameCharacters( ) throw(SQLException, RuntimeException) 482cdf0e10cSrcweir { 483cdf0e10cSrcweir // return getStringProperty(::rtl::OUString::createFromAscii("Special Characters")); 484cdf0e10cSrcweir return ::rtl::OUString(); 485cdf0e10cSrcweir } 486cdf0e10cSrcweir // ------------------------------------------------------------------------- 487cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsDifferentTableCorrelationNames( ) throw(SQLException, RuntimeException) 488cdf0e10cSrcweir { 489cdf0e10cSrcweir return isCapable(DBLITERAL_CORRELATION_NAME); 490cdf0e10cSrcweir } 491cdf0e10cSrcweir // ------------------------------------------------------------------------- 492cdf0e10cSrcweir sal_Bool ODatabaseMetaData::impl_isCatalogAtStart_throw( ) 493cdf0e10cSrcweir { 494cdf0e10cSrcweir return getInt32Property(::rtl::OUString::createFromAscii("Catalog Location")) == DBPROPVAL_CL_START; 495cdf0e10cSrcweir } 496cdf0e10cSrcweir // ------------------------------------------------------------------------- 497cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionIgnoredInTransactions( ) throw(SQLException, RuntimeException) 498cdf0e10cSrcweir { 499cdf0e10cSrcweir return getInt32Property(::rtl::OUString::createFromAscii("Transaction DDL")) == DBPROPVAL_TC_DDL_IGNORE; 500cdf0e10cSrcweir } 501cdf0e10cSrcweir // ------------------------------------------------------------------------- 502cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionCausesTransactionCommit( ) throw(SQLException, RuntimeException) 503cdf0e10cSrcweir { 504cdf0e10cSrcweir return getInt32Property(::rtl::OUString::createFromAscii("Transaction DDL")) == DBPROPVAL_TC_DDL_COMMIT; 505cdf0e10cSrcweir } 506cdf0e10cSrcweir // ------------------------------------------------------------------------- 507cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsDataManipulationTransactionsOnly( ) throw(SQLException, RuntimeException) 508cdf0e10cSrcweir { 509cdf0e10cSrcweir return getInt32Property(::rtl::OUString::createFromAscii("Transaction DDL")) == DBPROPVAL_TC_DML; 510cdf0e10cSrcweir } 511cdf0e10cSrcweir // ------------------------------------------------------------------------- 512cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions( ) throw(SQLException, RuntimeException) 513cdf0e10cSrcweir { 514cdf0e10cSrcweir return getInt32Property(::rtl::OUString::createFromAscii("Transaction DDL")) == DBPROPVAL_TC_ALL; 515cdf0e10cSrcweir } 516cdf0e10cSrcweir // ------------------------------------------------------------------------- 517cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedDelete( ) throw(SQLException, RuntimeException) 518cdf0e10cSrcweir { 519cdf0e10cSrcweir return sal_True; 520cdf0e10cSrcweir } 521cdf0e10cSrcweir // ------------------------------------------------------------------------- 522cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedUpdate( ) throw(SQLException, RuntimeException) 523cdf0e10cSrcweir { 524cdf0e10cSrcweir return sal_True; 525cdf0e10cSrcweir } 526cdf0e10cSrcweir // ------------------------------------------------------------------------- 527cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossRollback( ) throw(SQLException, RuntimeException) 528cdf0e10cSrcweir { 529cdf0e10cSrcweir return getInt32Property(::rtl::OUString::createFromAscii("Prepare Abort Behavior")) == DBPROPVAL_CB_PRESERVE; 530cdf0e10cSrcweir } 531cdf0e10cSrcweir // ------------------------------------------------------------------------- 532cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossCommit( ) throw(SQLException, RuntimeException) 533cdf0e10cSrcweir { 534cdf0e10cSrcweir return getInt32Property(::rtl::OUString::createFromAscii("Prepare Commit Behavior")) == DBPROPVAL_CB_PRESERVE; 535cdf0e10cSrcweir } 536cdf0e10cSrcweir // ------------------------------------------------------------------------- 537cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossCommit( ) throw(SQLException, RuntimeException) 538cdf0e10cSrcweir { 539cdf0e10cSrcweir return (getInt32Property(::rtl::OUString::createFromAscii("Isolation Retention")) & DBPROPVAL_TR_COMMIT) == DBPROPVAL_TR_COMMIT; 540cdf0e10cSrcweir } 541cdf0e10cSrcweir // ------------------------------------------------------------------------- 542cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossRollback( ) throw(SQLException, RuntimeException) 543cdf0e10cSrcweir { 544cdf0e10cSrcweir return (getInt32Property(::rtl::OUString::createFromAscii("Isolation Retention")) & DBPROPVAL_TR_ABORT) == DBPROPVAL_TR_ABORT; 545cdf0e10cSrcweir } 546cdf0e10cSrcweir // ------------------------------------------------------------------------- 547cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactionIsolationLevel( sal_Int32 level ) throw(SQLException, RuntimeException) 548cdf0e10cSrcweir { 549cdf0e10cSrcweir sal_Bool bValue(sal_False); 550cdf0e10cSrcweir 551cdf0e10cSrcweir sal_Int32 nTxn = getInt32Property(::rtl::OUString::createFromAscii("Isolation Levels")); 552cdf0e10cSrcweir if(level == TransactionIsolation::NONE) 553cdf0e10cSrcweir bValue = sal_True; 554cdf0e10cSrcweir else if(level == TransactionIsolation::READ_UNCOMMITTED) 555cdf0e10cSrcweir bValue = (nTxn & DBPROPVAL_TI_READUNCOMMITTED) == DBPROPVAL_TI_READUNCOMMITTED; 556cdf0e10cSrcweir else if(level == TransactionIsolation::READ_COMMITTED) 557cdf0e10cSrcweir bValue = (nTxn & DBPROPVAL_TI_READCOMMITTED) == DBPROPVAL_TI_READCOMMITTED; 558cdf0e10cSrcweir else if(level == TransactionIsolation::REPEATABLE_READ) 559cdf0e10cSrcweir bValue = (nTxn & DBPROPVAL_TI_REPEATABLEREAD) == DBPROPVAL_TI_REPEATABLEREAD; 560cdf0e10cSrcweir else if(level == TransactionIsolation::SERIALIZABLE) 561cdf0e10cSrcweir bValue = (nTxn & DBPROPVAL_TI_SERIALIZABLE) == DBPROPVAL_TI_SERIALIZABLE; 562cdf0e10cSrcweir 563cdf0e10cSrcweir return bValue; 564cdf0e10cSrcweir } 565cdf0e10cSrcweir // ------------------------------------------------------------------------- 566cdf0e10cSrcweir sal_Bool ODatabaseMetaData::impl_supportsSchemasInDataManipulation_throw( ) 567cdf0e10cSrcweir { 568cdf0e10cSrcweir return (getInt32Property(::rtl::OUString::createFromAscii("Schema Usage")) & DBPROPVAL_SU_DML_STATEMENTS) == DBPROPVAL_SU_DML_STATEMENTS; 569cdf0e10cSrcweir } 570cdf0e10cSrcweir // ------------------------------------------------------------------------- 571cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92FullSQL( ) throw(SQLException, RuntimeException) 572cdf0e10cSrcweir { 573cdf0e10cSrcweir sal_Int32 nProp = getInt32Property(::rtl::OUString::createFromAscii("SQL Support")); 574cdf0e10cSrcweir return (nProp == 512) || ((nProp & DBPROPVAL_SQL_ANSI92_FULL) == DBPROPVAL_SQL_ANSI92_FULL); 575cdf0e10cSrcweir } 576cdf0e10cSrcweir // ------------------------------------------------------------------------- 577cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92EntryLevelSQL( ) throw(SQLException, RuntimeException) 578cdf0e10cSrcweir { 579cdf0e10cSrcweir sal_Int32 nProp = getInt32Property(::rtl::OUString::createFromAscii("SQL Support")); 580cdf0e10cSrcweir return (nProp == 512) || ((nProp & DBPROPVAL_SQL_ANSI92_ENTRY) == DBPROPVAL_SQL_ANSI92_ENTRY); 581cdf0e10cSrcweir } 582cdf0e10cSrcweir // ------------------------------------------------------------------------- 583cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsIntegrityEnhancementFacility( ) throw(SQLException, RuntimeException) 584cdf0e10cSrcweir { 585cdf0e10cSrcweir sal_Int32 nProp = getInt32Property(::rtl::OUString::createFromAscii("SQL Support")); 586cdf0e10cSrcweir return (nProp == 512) || ((nProp & DBPROPVAL_SQL_ANSI89_IEF) == DBPROPVAL_SQL_ANSI89_IEF); 587cdf0e10cSrcweir } 588cdf0e10cSrcweir // ------------------------------------------------------------------------- 589cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInIndexDefinitions( ) throw(SQLException, RuntimeException) 590cdf0e10cSrcweir { 591cdf0e10cSrcweir return (getInt32Property(::rtl::OUString::createFromAscii("Schema Usage")) & DBPROPVAL_SU_INDEX_DEFINITION) == DBPROPVAL_SU_INDEX_DEFINITION; 592cdf0e10cSrcweir } 593cdf0e10cSrcweir // ------------------------------------------------------------------------- 594cdf0e10cSrcweir sal_Bool ODatabaseMetaData::impl_supportsSchemasInTableDefinitions_throw( ) 595cdf0e10cSrcweir { 596cdf0e10cSrcweir return (getInt32Property(::rtl::OUString::createFromAscii("Schema Usage")) & DBPROPVAL_SU_TABLE_DEFINITION) == DBPROPVAL_SU_TABLE_DEFINITION; 597cdf0e10cSrcweir } 598cdf0e10cSrcweir // ------------------------------------------------------------------------- 599cdf0e10cSrcweir sal_Bool ODatabaseMetaData::impl_supportsCatalogsInTableDefinitions_throw( ) 600cdf0e10cSrcweir { 601cdf0e10cSrcweir // return (getInt32Property(::rtl::OUString::createFromAscii("Catalog Usage")) & DBPROPVAL_CU_TABLE_DEFINITION) == DBPROPVAL_CU_TABLE_DEFINITION; 602cdf0e10cSrcweir return sal_False; 603cdf0e10cSrcweir } 604cdf0e10cSrcweir // ------------------------------------------------------------------------- 605cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInIndexDefinitions( ) throw(SQLException, RuntimeException) 606cdf0e10cSrcweir { 607cdf0e10cSrcweir // return (getInt32Property(::rtl::OUString::createFromAscii("Catalog Usage")) & DBPROPVAL_CU_INDEX_DEFINITION) == DBPROPVAL_CU_INDEX_DEFINITION; 608cdf0e10cSrcweir return sal_False; 609cdf0e10cSrcweir } 610cdf0e10cSrcweir // ------------------------------------------------------------------------- 611cdf0e10cSrcweir sal_Bool ODatabaseMetaData::impl_supportsCatalogsInDataManipulation_throw( ) 612cdf0e10cSrcweir { 613cdf0e10cSrcweir // return (getInt32Property(::rtl::OUString::createFromAscii("Catalog Usage")) & DBPROPVAL_CU_DML_STATEMENTS) == DBPROPVAL_CU_DML_STATEMENTS; 614cdf0e10cSrcweir return sal_False; 615cdf0e10cSrcweir } 616cdf0e10cSrcweir // ------------------------------------------------------------------------- 617cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsOuterJoins( ) throw(SQLException, RuntimeException) 618cdf0e10cSrcweir { 619cdf0e10cSrcweir if ( ADOS::isJetEngine(m_pConnection->getEngineType()) ) 620cdf0e10cSrcweir return sal_True; 621cdf0e10cSrcweir return getBoolProperty(::rtl::OUString::createFromAscii("Outer Join Capabilities")); 622cdf0e10cSrcweir } 623cdf0e10cSrcweir // ------------------------------------------------------------------------- 624cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTableTypes( ) throw(SQLException, RuntimeException) 625cdf0e10cSrcweir { 626cdf0e10cSrcweir return new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTableTypes); 627cdf0e10cSrcweir } 628cdf0e10cSrcweir // ------------------------------------------------------------------------- 629cdf0e10cSrcweir sal_Int32 ODatabaseMetaData::impl_getMaxStatements_throw( ) 630cdf0e10cSrcweir { 631cdf0e10cSrcweir return 0; 632cdf0e10cSrcweir } 633cdf0e10cSrcweir // ------------------------------------------------------------------------- 634cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxProcedureNameLength( ) throw(SQLException, RuntimeException) 635cdf0e10cSrcweir { 636cdf0e10cSrcweir return getMaxSize(DBLITERAL_PROCEDURE_NAME); 637cdf0e10cSrcweir } 638cdf0e10cSrcweir // ------------------------------------------------------------------------- 639cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxSchemaNameLength( ) throw(SQLException, RuntimeException) 640cdf0e10cSrcweir { 641cdf0e10cSrcweir return getMaxSize(DBLITERAL_SCHEMA_NAME); 642cdf0e10cSrcweir } 643cdf0e10cSrcweir // ------------------------------------------------------------------------- 644cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactions( ) throw(SQLException, RuntimeException) 645cdf0e10cSrcweir { 646cdf0e10cSrcweir return getInt32Property(::rtl::OUString::createFromAscii("Transaction DDL")) == DBPROPVAL_TC_NONE; 647cdf0e10cSrcweir } 648cdf0e10cSrcweir // ------------------------------------------------------------------------- 649cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::allProceduresAreCallable( ) throw(SQLException, RuntimeException) 650cdf0e10cSrcweir { 651cdf0e10cSrcweir return sal_True; 652cdf0e10cSrcweir } 653cdf0e10cSrcweir // ------------------------------------------------------------------------- 654cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsStoredProcedures( ) throw(SQLException, RuntimeException) 655cdf0e10cSrcweir { 656cdf0e10cSrcweir return sal_True; 657cdf0e10cSrcweir } 658cdf0e10cSrcweir // ------------------------------------------------------------------------- 659cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsSelectForUpdate( ) throw(SQLException, RuntimeException) 660cdf0e10cSrcweir { 661cdf0e10cSrcweir return sal_True; 662cdf0e10cSrcweir } 663cdf0e10cSrcweir // ------------------------------------------------------------------------- 664cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::allTablesAreSelectable( ) throw(SQLException, RuntimeException) 665cdf0e10cSrcweir { 666cdf0e10cSrcweir return sal_True; 667cdf0e10cSrcweir } 668cdf0e10cSrcweir // ------------------------------------------------------------------------- 669cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::isReadOnly( ) throw(SQLException, RuntimeException) 670cdf0e10cSrcweir { 671cdf0e10cSrcweir return getBoolProperty(::rtl::OUString::createFromAscii("Read-Only Data Source")); 672cdf0e10cSrcweir } 673cdf0e10cSrcweir // ------------------------------------------------------------------------- 674cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFiles( ) throw(SQLException, RuntimeException) 675cdf0e10cSrcweir { 676cdf0e10cSrcweir return sal_False; 677cdf0e10cSrcweir } 678cdf0e10cSrcweir // ------------------------------------------------------------------------- 679cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFilePerTable( ) throw(SQLException, RuntimeException) 680cdf0e10cSrcweir { 681cdf0e10cSrcweir return sal_False; 682cdf0e10cSrcweir } 683cdf0e10cSrcweir // ------------------------------------------------------------------------- 684cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsTypeConversion( ) throw(SQLException, RuntimeException) 685cdf0e10cSrcweir { 686cdf0e10cSrcweir return sal_True; 687cdf0e10cSrcweir } 688cdf0e10cSrcweir // ------------------------------------------------------------------------- 689cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::nullPlusNonNullIsNull( ) throw(SQLException, RuntimeException) 690cdf0e10cSrcweir { 691cdf0e10cSrcweir return getInt32Property(::rtl::OUString::createFromAscii("NULL Concatenation Behavior")) == DBPROPVAL_CB_NULL; 692cdf0e10cSrcweir } 693cdf0e10cSrcweir // ------------------------------------------------------------------------- 694cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsColumnAliasing( ) throw(SQLException, RuntimeException) 695cdf0e10cSrcweir { 696cdf0e10cSrcweir return isCapable(DBLITERAL_COLUMN_ALIAS); 697cdf0e10cSrcweir } 698cdf0e10cSrcweir // ------------------------------------------------------------------------- 699cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsTableCorrelationNames( ) throw(SQLException, RuntimeException) 700cdf0e10cSrcweir { 701cdf0e10cSrcweir return isCapable(DBLITERAL_CORRELATION_NAME); 702cdf0e10cSrcweir } 703cdf0e10cSrcweir // ------------------------------------------------------------------------- 704cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsConvert( sal_Int32 /*fromType*/, sal_Int32 /*toType*/ ) throw(SQLException, RuntimeException) 705cdf0e10cSrcweir { 706cdf0e10cSrcweir return getBoolProperty(::rtl::OUString::createFromAscii("Rowset Conversions on Command")); 707cdf0e10cSrcweir } 708cdf0e10cSrcweir // ------------------------------------------------------------------------- 709cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsExpressionsInOrderBy( ) throw(SQLException, RuntimeException) 710cdf0e10cSrcweir { 711cdf0e10cSrcweir return getBoolProperty(::rtl::OUString::createFromAscii("ORDER BY Columns in Select List")); 712cdf0e10cSrcweir } 713cdf0e10cSrcweir // ------------------------------------------------------------------------- 714cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupBy( ) throw(SQLException, RuntimeException) 715cdf0e10cSrcweir { 716cdf0e10cSrcweir return getInt32Property(::rtl::OUString::createFromAscii("GROUP BY Support")) != DBPROPVAL_GB_NOT_SUPPORTED; 717cdf0e10cSrcweir } 718cdf0e10cSrcweir // ------------------------------------------------------------------------- 719cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByBeyondSelect( ) throw(SQLException, RuntimeException) 720cdf0e10cSrcweir { 721cdf0e10cSrcweir return getInt32Property(::rtl::OUString::createFromAscii("GROUP BY Support")) != DBPROPVAL_GB_CONTAINS_SELECT; 722cdf0e10cSrcweir } 723cdf0e10cSrcweir // ------------------------------------------------------------------------- 724cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByUnrelated( ) throw(SQLException, RuntimeException) 725cdf0e10cSrcweir { 726cdf0e10cSrcweir return getInt32Property(::rtl::OUString::createFromAscii("GROUP BY Support")) == DBPROPVAL_GB_NO_RELATION; 727cdf0e10cSrcweir } 728cdf0e10cSrcweir // ------------------------------------------------------------------------- 729cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleTransactions( ) throw(SQLException, RuntimeException) 730cdf0e10cSrcweir { 731cdf0e10cSrcweir return sal_True; 732cdf0e10cSrcweir } 733cdf0e10cSrcweir // ------------------------------------------------------------------------- 734cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleResultSets( ) throw(SQLException, RuntimeException) 735cdf0e10cSrcweir { 736cdf0e10cSrcweir return sal_False; 737cdf0e10cSrcweir } 738cdf0e10cSrcweir // ------------------------------------------------------------------------- 739cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsLikeEscapeClause( ) throw(SQLException, RuntimeException) 740cdf0e10cSrcweir { 741cdf0e10cSrcweir return isCapable(DBLITERAL_ESCAPE_PERCENT); 742cdf0e10cSrcweir } 743cdf0e10cSrcweir // ------------------------------------------------------------------------- 744cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsOrderByUnrelated( ) throw(SQLException, RuntimeException) 745cdf0e10cSrcweir { 746cdf0e10cSrcweir return getBoolProperty(::rtl::OUString::createFromAscii("ORDER BY Columns in Select List")); 747cdf0e10cSrcweir } 748cdf0e10cSrcweir // ------------------------------------------------------------------------- 749cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsUnion( ) throw(SQLException, RuntimeException) 750cdf0e10cSrcweir { 751cdf0e10cSrcweir return sal_True; 752cdf0e10cSrcweir } 753cdf0e10cSrcweir // ------------------------------------------------------------------------- 754cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsUnionAll( ) throw(SQLException, RuntimeException) 755cdf0e10cSrcweir { 756cdf0e10cSrcweir return sal_True; 757cdf0e10cSrcweir } 758cdf0e10cSrcweir // ------------------------------------------------------------------------- 759cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsMixedCaseIdentifiers( ) throw(SQLException, RuntimeException) 760cdf0e10cSrcweir { 761cdf0e10cSrcweir return (getInt32Property(::rtl::OUString::createFromAscii("Identifier Case Sensitivity")) & DBPROPVAL_IC_MIXED) == DBPROPVAL_IC_MIXED; 762cdf0e10cSrcweir } 763cdf0e10cSrcweir // ------------------------------------------------------------------------- 764cdf0e10cSrcweir sal_Bool ODatabaseMetaData::impl_supportsMixedCaseQuotedIdentifiers_throw( ) 765cdf0e10cSrcweir { 766cdf0e10cSrcweir return (getInt32Property(::rtl::OUString::createFromAscii("Identifier Case Sensitivity")) & DBPROPVAL_IC_MIXED) == DBPROPVAL_IC_MIXED; 767cdf0e10cSrcweir } 768cdf0e10cSrcweir // ------------------------------------------------------------------------- 769cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtEnd( ) throw(SQLException, RuntimeException) 770cdf0e10cSrcweir { 771cdf0e10cSrcweir return (getInt32Property(::rtl::OUString::createFromAscii("NULL Collation Order")) & DBPROPVAL_NC_END) == DBPROPVAL_NC_END; 772cdf0e10cSrcweir } 773cdf0e10cSrcweir // ------------------------------------------------------------------------- 774cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtStart( ) throw(SQLException, RuntimeException) 775cdf0e10cSrcweir { 776cdf0e10cSrcweir return (getInt32Property(::rtl::OUString::createFromAscii("NULL Collation Order")) & DBPROPVAL_NC_START) == DBPROPVAL_NC_START; 777cdf0e10cSrcweir } 778cdf0e10cSrcweir // ------------------------------------------------------------------------- 779cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedHigh( ) throw(SQLException, RuntimeException) 780cdf0e10cSrcweir { 781cdf0e10cSrcweir return (getInt32Property(::rtl::OUString::createFromAscii("NULL Collation Order")) & DBPROPVAL_NC_HIGH) == DBPROPVAL_NC_HIGH; 782cdf0e10cSrcweir } 783cdf0e10cSrcweir // ------------------------------------------------------------------------- 784cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedLow( ) throw(SQLException, RuntimeException) 785cdf0e10cSrcweir { 786cdf0e10cSrcweir return (getInt32Property(::rtl::OUString::createFromAscii("NULL Collation Order")) & DBPROPVAL_NC_LOW) == DBPROPVAL_NC_LOW; 787cdf0e10cSrcweir } 788cdf0e10cSrcweir // ------------------------------------------------------------------------- 789cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInProcedureCalls( ) throw(SQLException, RuntimeException) 790cdf0e10cSrcweir { 791cdf0e10cSrcweir return sal_False; 792cdf0e10cSrcweir } 793cdf0e10cSrcweir // ------------------------------------------------------------------------- 794cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInPrivilegeDefinitions( ) throw(SQLException, RuntimeException) 795cdf0e10cSrcweir { 796cdf0e10cSrcweir return (getInt32Property(::rtl::OUString::createFromAscii("Schema Usage")) & DBPROPVAL_SU_PRIVILEGE_DEFINITION) == DBPROPVAL_SU_PRIVILEGE_DEFINITION; 797cdf0e10cSrcweir } 798cdf0e10cSrcweir // ------------------------------------------------------------------------- 799cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInProcedureCalls( ) throw(SQLException, RuntimeException) 800cdf0e10cSrcweir { 801cdf0e10cSrcweir return sal_False; 802cdf0e10cSrcweir } 803cdf0e10cSrcweir // ------------------------------------------------------------------------- 804cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInPrivilegeDefinitions( ) throw(SQLException, RuntimeException) 805cdf0e10cSrcweir { 806cdf0e10cSrcweir // return (getInt32Property(::rtl::OUString::createFromAscii("Catalog Usage")) & DBPROPVAL_CU_PRIVILEGE_DEFINITION) == DBPROPVAL_CU_PRIVILEGE_DEFINITION; 807cdf0e10cSrcweir return sal_False; 808cdf0e10cSrcweir } 809cdf0e10cSrcweir // ------------------------------------------------------------------------- 810cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsCorrelatedSubqueries( ) throw(SQLException, RuntimeException) 811cdf0e10cSrcweir { 812cdf0e10cSrcweir return (getInt32Property(::rtl::OUString::createFromAscii("Subquery Support")) & DBPROPVAL_SQ_CORRELATEDSUBQUERIES) == DBPROPVAL_SQ_CORRELATEDSUBQUERIES; 813cdf0e10cSrcweir } 814cdf0e10cSrcweir // ------------------------------------------------------------------------- 815cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInComparisons( ) throw(SQLException, RuntimeException) 816cdf0e10cSrcweir { 817cdf0e10cSrcweir return (getInt32Property(::rtl::OUString::createFromAscii("Subquery Support")) & DBPROPVAL_SQ_COMPARISON) == DBPROPVAL_SQ_COMPARISON; 818cdf0e10cSrcweir } 819cdf0e10cSrcweir // ------------------------------------------------------------------------- 820cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInExists( ) throw(SQLException, RuntimeException) 821cdf0e10cSrcweir { 822cdf0e10cSrcweir return (getInt32Property(::rtl::OUString::createFromAscii("Subquery Support")) & DBPROPVAL_SQ_EXISTS) == DBPROPVAL_SQ_EXISTS; 823cdf0e10cSrcweir } 824cdf0e10cSrcweir // ------------------------------------------------------------------------- 825cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInIns( ) throw(SQLException, RuntimeException) 826cdf0e10cSrcweir { 827cdf0e10cSrcweir return (getInt32Property(::rtl::OUString::createFromAscii("Subquery Support")) & DBPROPVAL_SQ_IN) == DBPROPVAL_SQ_IN; 828cdf0e10cSrcweir } 829cdf0e10cSrcweir // ------------------------------------------------------------------------- 830cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInQuantifieds( ) throw(SQLException, RuntimeException) 831cdf0e10cSrcweir { 832cdf0e10cSrcweir return (getInt32Property(::rtl::OUString::createFromAscii("Subquery Support")) & DBPROPVAL_SQ_QUANTIFIED) == DBPROPVAL_SQ_QUANTIFIED; 833cdf0e10cSrcweir } 834cdf0e10cSrcweir // ------------------------------------------------------------------------- 835cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92IntermediateSQL( ) throw(SQLException, RuntimeException) 836cdf0e10cSrcweir { 837cdf0e10cSrcweir sal_Int32 nProp = getInt32Property(::rtl::OUString::createFromAscii("SQL Support")); 838cdf0e10cSrcweir return (nProp == 512) || ((nProp & DBPROPVAL_SQL_ANSI92_INTERMEDIATE) == DBPROPVAL_SQL_ANSI92_INTERMEDIATE); 839cdf0e10cSrcweir } 840cdf0e10cSrcweir // ------------------------------------------------------------------------- 841cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getURL( ) throw(SQLException, RuntimeException) 842cdf0e10cSrcweir { 843cdf0e10cSrcweir return ::rtl::OUString::createFromAscii("sdbc:ado:")+ m_pADOConnection->GetConnectionString(); 844cdf0e10cSrcweir } 845cdf0e10cSrcweir // ------------------------------------------------------------------------- 846cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getUserName( ) throw(SQLException, RuntimeException) 847cdf0e10cSrcweir { 848cdf0e10cSrcweir return getStringProperty(::rtl::OUString::createFromAscii("User Name")); 849cdf0e10cSrcweir } 850cdf0e10cSrcweir // ------------------------------------------------------------------------- 851cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getDriverName( ) throw(SQLException, RuntimeException) 852cdf0e10cSrcweir { 853cdf0e10cSrcweir return getStringProperty(::rtl::OUString::createFromAscii("Provider Friendly Name")); 854cdf0e10cSrcweir } 855cdf0e10cSrcweir // ------------------------------------------------------------------------- 856cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getDriverVersion( ) throw(SQLException, RuntimeException) 857cdf0e10cSrcweir { 858cdf0e10cSrcweir return getStringProperty(::rtl::OUString::createFromAscii("Provider Version")); 859cdf0e10cSrcweir } 860cdf0e10cSrcweir // ------------------------------------------------------------------------- 861cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getDatabaseProductVersion( ) throw(SQLException, RuntimeException) 862cdf0e10cSrcweir { 863cdf0e10cSrcweir return getStringProperty(::rtl::OUString::createFromAscii("DBMS Version")); 864cdf0e10cSrcweir } 865cdf0e10cSrcweir // ------------------------------------------------------------------------- 866cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getDatabaseProductName( ) throw(SQLException, RuntimeException) 867cdf0e10cSrcweir { 868cdf0e10cSrcweir return getStringProperty(::rtl::OUString::createFromAscii("DBMS Name")); 869cdf0e10cSrcweir } 870cdf0e10cSrcweir // ------------------------------------------------------------------------- 871cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getProcedureTerm( ) throw(SQLException, RuntimeException) 872cdf0e10cSrcweir { 873cdf0e10cSrcweir return getStringProperty(::rtl::OUString::createFromAscii("Procedure Term")); 874cdf0e10cSrcweir } 875cdf0e10cSrcweir // ------------------------------------------------------------------------- 876cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getSchemaTerm( ) throw(SQLException, RuntimeException) 877cdf0e10cSrcweir { 878cdf0e10cSrcweir return getStringProperty(::rtl::OUString::createFromAscii("Schema Term")); 879cdf0e10cSrcweir } 880cdf0e10cSrcweir // ------------------------------------------------------------------------- 881cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMajorVersion( ) throw(RuntimeException) 882cdf0e10cSrcweir { 883cdf0e10cSrcweir return 1; 884cdf0e10cSrcweir } 885cdf0e10cSrcweir // ------------------------------------------------------------------------- 886cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getDefaultTransactionIsolation( ) throw(SQLException, RuntimeException) 887cdf0e10cSrcweir { 888cdf0e10cSrcweir sal_Int32 nRet = TransactionIsolation::NONE; 889cdf0e10cSrcweir switch(m_pADOConnection->get_IsolationLevel()) 890cdf0e10cSrcweir { 891cdf0e10cSrcweir case adXactReadCommitted: 892cdf0e10cSrcweir nRet = TransactionIsolation::READ_COMMITTED; 893cdf0e10cSrcweir break; 894cdf0e10cSrcweir case adXactRepeatableRead: 895cdf0e10cSrcweir nRet = TransactionIsolation::REPEATABLE_READ; 896cdf0e10cSrcweir break; 897cdf0e10cSrcweir case adXactSerializable: 898cdf0e10cSrcweir nRet = TransactionIsolation::SERIALIZABLE; 899cdf0e10cSrcweir break; 900cdf0e10cSrcweir case adXactReadUncommitted: 901cdf0e10cSrcweir nRet = TransactionIsolation::READ_UNCOMMITTED; 902cdf0e10cSrcweir break; 903cdf0e10cSrcweir default: 904cdf0e10cSrcweir ; 905cdf0e10cSrcweir } 906cdf0e10cSrcweir return nRet; 907cdf0e10cSrcweir } 908cdf0e10cSrcweir // ------------------------------------------------------------------------- 909cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeException) 910cdf0e10cSrcweir { 911cdf0e10cSrcweir return 0; 912cdf0e10cSrcweir } 913cdf0e10cSrcweir // ------------------------------------------------------------------------- 914cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getSQLKeywords( ) throw(SQLException, RuntimeException) 915cdf0e10cSrcweir { 916cdf0e10cSrcweir ADORecordset *pRecordset = NULL; 917cdf0e10cSrcweir OLEVariant vtEmpty; 918cdf0e10cSrcweir vtEmpty.setNoArg(); 919cdf0e10cSrcweir m_pADOConnection->OpenSchema(adSchemaDBInfoKeywords,vtEmpty,vtEmpty,&pRecordset); 920cdf0e10cSrcweir OSL_ENSURE(pRecordset,"getSQLKeywords: no resultset!"); 921cdf0e10cSrcweir ADOS::ThrowException(*m_pADOConnection,*this); 922cdf0e10cSrcweir if ( pRecordset ) 923cdf0e10cSrcweir { 924cdf0e10cSrcweir WpADORecordset aRecordset(pRecordset); 925cdf0e10cSrcweir 926cdf0e10cSrcweir aRecordset.MoveFirst(); 927cdf0e10cSrcweir OLEVariant aValue; 928cdf0e10cSrcweir ::rtl::OUString aRet,aComma = ::rtl::OUString::createFromAscii(","); 929cdf0e10cSrcweir while(!aRecordset.IsAtEOF()) 930cdf0e10cSrcweir { 931cdf0e10cSrcweir WpOLEAppendCollection<ADOFields, ADOField, WpADOField> aFields(aRecordset.GetFields()); 932cdf0e10cSrcweir WpADOField aField(aFields.GetItem(0)); 933cdf0e10cSrcweir aField.get_Value(aValue); 934cdf0e10cSrcweir aRet = aRet + aValue + aComma; 935cdf0e10cSrcweir aRecordset.MoveNext(); 936cdf0e10cSrcweir } 937cdf0e10cSrcweir aRecordset.Close(); 938cdf0e10cSrcweir if ( aRet.getLength() ) 939cdf0e10cSrcweir return aRet.copy(0,aRet.lastIndexOf(',')); 940cdf0e10cSrcweir } 941cdf0e10cSrcweir return ::rtl::OUString(); 942cdf0e10cSrcweir } 943cdf0e10cSrcweir // ------------------------------------------------------------------------- 944cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getSearchStringEscape( ) throw(SQLException, RuntimeException) 945cdf0e10cSrcweir { 946cdf0e10cSrcweir return getLiteral(DBLITERAL_ESCAPE_PERCENT); 947cdf0e10cSrcweir } 948cdf0e10cSrcweir // ------------------------------------------------------------------------- 949cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getStringFunctions( ) throw(SQLException, RuntimeException) 950cdf0e10cSrcweir { 951cdf0e10cSrcweir ::rtl::OUString aValue; 952cdf0e10cSrcweir return aValue.copy(0,aValue.lastIndexOf(',')); 953cdf0e10cSrcweir } 954cdf0e10cSrcweir // ------------------------------------------------------------------------- 955cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getTimeDateFunctions( ) throw(SQLException, RuntimeException) 956cdf0e10cSrcweir { 957cdf0e10cSrcweir ::rtl::OUString aValue; 958cdf0e10cSrcweir return aValue; 959cdf0e10cSrcweir } 960cdf0e10cSrcweir // ------------------------------------------------------------------------- 961cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getSystemFunctions( ) throw(SQLException, RuntimeException) 962cdf0e10cSrcweir { 963cdf0e10cSrcweir ::rtl::OUString aValue; 964cdf0e10cSrcweir return aValue.copy(0,aValue.lastIndexOf(',')); 965cdf0e10cSrcweir } 966cdf0e10cSrcweir // ------------------------------------------------------------------------- 967cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getNumericFunctions( ) throw(SQLException, RuntimeException) 968cdf0e10cSrcweir { 969cdf0e10cSrcweir ::rtl::OUString aValue; 970cdf0e10cSrcweir return aValue; 971cdf0e10cSrcweir } 972cdf0e10cSrcweir // ------------------------------------------------------------------------- 973cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsExtendedSQLGrammar( ) throw(SQLException, RuntimeException) 974cdf0e10cSrcweir { 975cdf0e10cSrcweir sal_Int32 nProp = getInt32Property(::rtl::OUString::createFromAscii("SQL Support")); 976cdf0e10cSrcweir return (nProp == 512) || ((nProp & DBPROPVAL_SQL_ODBC_EXTENDED) == DBPROPVAL_SQL_ODBC_EXTENDED); 977cdf0e10cSrcweir } 978cdf0e10cSrcweir // ------------------------------------------------------------------------- 979cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsCoreSQLGrammar( ) throw(SQLException, RuntimeException) 980cdf0e10cSrcweir { 981cdf0e10cSrcweir sal_Int32 nProp = getInt32Property(::rtl::OUString::createFromAscii("SQL Support")); 982cdf0e10cSrcweir return (nProp == 512) || ((nProp & DBPROPVAL_SQL_ODBC_CORE) == DBPROPVAL_SQL_ODBC_CORE); 983cdf0e10cSrcweir } 984cdf0e10cSrcweir // ------------------------------------------------------------------------- 985cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsMinimumSQLGrammar( ) throw(SQLException, RuntimeException) 986cdf0e10cSrcweir { 987cdf0e10cSrcweir sal_Int32 nProp = getInt32Property(::rtl::OUString::createFromAscii("SQL Support")); 988cdf0e10cSrcweir return (nProp == 512) || ((nProp & DBPROPVAL_SQL_ODBC_MINIMUM) == DBPROPVAL_SQL_ODBC_MINIMUM); 989cdf0e10cSrcweir } 990cdf0e10cSrcweir // ------------------------------------------------------------------------- 991cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsFullOuterJoins( ) throw(SQLException, RuntimeException) 992cdf0e10cSrcweir { 993cdf0e10cSrcweir if ( ADOS::isJetEngine(m_pConnection->getEngineType()) ) 994cdf0e10cSrcweir return sal_True; 995cdf0e10cSrcweir return (getInt32Property(::rtl::OUString::createFromAscii("Outer Join Capabilities")) & 0x00000004L) == 0x00000004L; 996cdf0e10cSrcweir } 997cdf0e10cSrcweir // ------------------------------------------------------------------------- 998cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsLimitedOuterJoins( ) throw(SQLException, RuntimeException) 999cdf0e10cSrcweir { 1000cdf0e10cSrcweir return supportsFullOuterJoins( ); 1001cdf0e10cSrcweir } 1002cdf0e10cSrcweir // ------------------------------------------------------------------------- 1003cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInGroupBy( ) throw(SQLException, RuntimeException) 1004cdf0e10cSrcweir { 1005cdf0e10cSrcweir return getInt32Property(::rtl::OUString::createFromAscii("Max Columns in GROUP BY")); 1006cdf0e10cSrcweir } 1007cdf0e10cSrcweir // ------------------------------------------------------------------------- 1008cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInOrderBy( ) throw(SQLException, RuntimeException) 1009cdf0e10cSrcweir { 1010cdf0e10cSrcweir return getInt32Property(::rtl::OUString::createFromAscii("Max Columns in ORDER BY")); 1011cdf0e10cSrcweir } 1012cdf0e10cSrcweir // ------------------------------------------------------------------------- 1013cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInSelect( ) throw(SQLException, RuntimeException) 1014cdf0e10cSrcweir { 1015cdf0e10cSrcweir return 0; // getInt32Property(::rtl::OUString::createFromAscii("Max Columns in Select")); 1016cdf0e10cSrcweir } 1017cdf0e10cSrcweir // ------------------------------------------------------------------------- 1018cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxUserNameLength( ) throw(SQLException, RuntimeException) 1019cdf0e10cSrcweir { 1020cdf0e10cSrcweir return getMaxSize(DBLITERAL_USER_NAME); 1021cdf0e10cSrcweir } 1022cdf0e10cSrcweir // ------------------------------------------------------------------------- 1023cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetType( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException) 1024cdf0e10cSrcweir { 1025cdf0e10cSrcweir return sal_True; 1026cdf0e10cSrcweir } 1027cdf0e10cSrcweir // ------------------------------------------------------------------------- 1028cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetConcurrency( sal_Int32 /*setType*/, sal_Int32 /*concurrency*/ ) throw(SQLException, RuntimeException) 1029cdf0e10cSrcweir { 1030cdf0e10cSrcweir return sal_True; 1031cdf0e10cSrcweir } 1032cdf0e10cSrcweir // ------------------------------------------------------------------------- 1033cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::ownUpdatesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException) 1034cdf0e10cSrcweir { 1035cdf0e10cSrcweir return ResultSetType::FORWARD_ONLY != setType; 1036cdf0e10cSrcweir } 1037cdf0e10cSrcweir // ------------------------------------------------------------------------- 1038cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::ownDeletesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException) 1039cdf0e10cSrcweir { 1040cdf0e10cSrcweir return ResultSetType::FORWARD_ONLY != setType; 1041cdf0e10cSrcweir } 1042cdf0e10cSrcweir // ------------------------------------------------------------------------- 1043cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::ownInsertsAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException) 1044cdf0e10cSrcweir { 1045cdf0e10cSrcweir return ResultSetType::FORWARD_ONLY != setType; 1046cdf0e10cSrcweir } 1047cdf0e10cSrcweir // ------------------------------------------------------------------------- 1048cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::othersUpdatesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException) 1049cdf0e10cSrcweir { 1050cdf0e10cSrcweir return ResultSetType::FORWARD_ONLY != setType; 1051cdf0e10cSrcweir } 1052cdf0e10cSrcweir // ------------------------------------------------------------------------- 1053cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::othersDeletesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException) 1054cdf0e10cSrcweir { 1055cdf0e10cSrcweir return ResultSetType::FORWARD_ONLY != setType; 1056cdf0e10cSrcweir } 1057cdf0e10cSrcweir // ------------------------------------------------------------------------- 1058cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::othersInsertsAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException) 1059cdf0e10cSrcweir { 1060cdf0e10cSrcweir return ResultSetType::FORWARD_ONLY != setType; 1061cdf0e10cSrcweir } 1062cdf0e10cSrcweir // ------------------------------------------------------------------------- 1063cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::updatesAreDetected( sal_Int32 setType ) throw(SQLException, RuntimeException) 1064cdf0e10cSrcweir { 1065cdf0e10cSrcweir return ResultSetType::FORWARD_ONLY != setType; 1066cdf0e10cSrcweir } 1067cdf0e10cSrcweir // ------------------------------------------------------------------------- 1068cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::deletesAreDetected( sal_Int32 setType ) throw(SQLException, RuntimeException) 1069cdf0e10cSrcweir { 1070cdf0e10cSrcweir return ResultSetType::FORWARD_ONLY != setType; 1071cdf0e10cSrcweir } 1072cdf0e10cSrcweir // ------------------------------------------------------------------------- 1073cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::insertsAreDetected( sal_Int32 setType ) throw(SQLException, RuntimeException) 1074cdf0e10cSrcweir { 1075cdf0e10cSrcweir return ResultSetType::FORWARD_ONLY != setType; 1076cdf0e10cSrcweir } 1077cdf0e10cSrcweir // ------------------------------------------------------------------------- 1078cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsBatchUpdates( ) throw(SQLException, RuntimeException) 1079cdf0e10cSrcweir { 1080cdf0e10cSrcweir return sal_True; 1081cdf0e10cSrcweir } 1082cdf0e10cSrcweir // ------------------------------------------------------------------------- 1083cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getUDTs( const Any& /*catalog*/, const ::rtl::OUString& /*schemaPattern*/, const ::rtl::OUString& /*typeNamePattern*/, const Sequence< sal_Int32 >& /*types*/ ) throw(SQLException, RuntimeException) 1084cdf0e10cSrcweir { 1085cdf0e10cSrcweir ::dbtools::throwFeatureNotImplementedException( "XDatabaseMetaData::getUDTs", *this ); 1086cdf0e10cSrcweir return Reference< XResultSet >(); 1087cdf0e10cSrcweir } 1088cdf0e10cSrcweir // ------------------------------------------------------------------------- 1089cdf0e10cSrcweir 1090