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 "odbc/ODatabaseMetaData.hxx" 27cdf0e10cSrcweir #include "odbc/OTools.hxx" 28cdf0e10cSrcweir #ifndef _CONNECTIVITY_ODBC_ORESULTSET_HXX_ 29cdf0e10cSrcweir #include "odbc/ODatabaseMetaDataResultSet.hxx" 30cdf0e10cSrcweir #endif 31cdf0e10cSrcweir #include "FDatabaseMetaDataResultSet.hxx" 32cdf0e10cSrcweir #include <com/sun/star/sdbc/DataType.hpp> 33cdf0e10cSrcweir #include <com/sun/star/sdbc/ResultSetType.hpp> 34cdf0e10cSrcweir #include <com/sun/star/sdbc/ResultSetConcurrency.hpp> 35cdf0e10cSrcweir #include "odbc/OFunctiondefs.hxx" 36cdf0e10cSrcweir #include "stdio.h" 37cdf0e10cSrcweir #include "TPrivilegesResultSet.hxx" 38cdf0e10cSrcweir #include <connectivity/dbexception.hxx> 39cdf0e10cSrcweir #include <rtl/ustrbuf.hxx> 40cdf0e10cSrcweir 41cdf0e10cSrcweir using namespace connectivity::odbc; 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 ODatabaseMetaData::ODatabaseMetaData(const SQLHANDLE _pHandle,OConnection* _pCon) 48cdf0e10cSrcweir : ::connectivity::ODatabaseMetaDataBase(_pCon,_pCon->getConnectionInfo()) 49cdf0e10cSrcweir ,m_aConnectionHandle(_pHandle) 50cdf0e10cSrcweir ,m_pConnection(_pCon) 51cdf0e10cSrcweir ,m_bUseCatalog(sal_True) 52cdf0e10cSrcweir ,m_bOdbc3(sal_True) 53cdf0e10cSrcweir { 54cdf0e10cSrcweir OSL_ENSURE(m_pConnection,"ODatabaseMetaData::ODatabaseMetaData: No connection set!"); 55cdf0e10cSrcweir if(!m_pConnection->isCatalogUsed()) 56cdf0e10cSrcweir { 57cdf0e10cSrcweir osl_incrementInterlockedCount( &m_refCount ); 58cdf0e10cSrcweir try 59cdf0e10cSrcweir { 60cdf0e10cSrcweir m_bUseCatalog = !(usesLocalFiles() || usesLocalFilePerTable()); 61cdf0e10cSrcweir ::rtl::OUString sVersion = getDriverVersion(); 62cdf0e10cSrcweir m_bOdbc3 = sVersion != ::rtl::OUString::createFromAscii("02.50") && sVersion != ::rtl::OUString::createFromAscii("02.00"); 63cdf0e10cSrcweir } 64cdf0e10cSrcweir catch(SQLException& ) 65cdf0e10cSrcweir { // doesn't matter here 66cdf0e10cSrcweir } 67cdf0e10cSrcweir osl_decrementInterlockedCount( &m_refCount ); 68cdf0e10cSrcweir } 69cdf0e10cSrcweir } 70cdf0e10cSrcweir // ------------------------------------------------------------------------- 71cdf0e10cSrcweir ODatabaseMetaData::~ODatabaseMetaData() 72cdf0e10cSrcweir { 73cdf0e10cSrcweir } 74cdf0e10cSrcweir // ------------------------------------------------------------------------- 75cdf0e10cSrcweir Reference< XResultSet > ODatabaseMetaData::impl_getTypeInfo_throw( ) 76cdf0e10cSrcweir { 77cdf0e10cSrcweir Reference< XResultSet > xRef; 78cdf0e10cSrcweir try 79cdf0e10cSrcweir { 80cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection); 81cdf0e10cSrcweir xRef = pResult; 82cdf0e10cSrcweir pResult->openTypeInfo(); 83cdf0e10cSrcweir } 84cdf0e10cSrcweir catch(SQLException&) 85cdf0e10cSrcweir { 86cdf0e10cSrcweir xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTypeInfo); 87cdf0e10cSrcweir } 88cdf0e10cSrcweir 89cdf0e10cSrcweir return xRef; 90cdf0e10cSrcweir } 91cdf0e10cSrcweir // ------------------------------------------------------------------------- 92cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCatalogs( ) throw(SQLException, RuntimeException) 93cdf0e10cSrcweir { 94cdf0e10cSrcweir Reference< XResultSet > xRef; 95cdf0e10cSrcweir if(!m_bUseCatalog) 96cdf0e10cSrcweir { 97cdf0e10cSrcweir xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eCatalogs); 98cdf0e10cSrcweir } 99cdf0e10cSrcweir else 100cdf0e10cSrcweir { 101cdf0e10cSrcweir try 102cdf0e10cSrcweir { 103cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection); 104cdf0e10cSrcweir xRef = pResult; 105cdf0e10cSrcweir pResult->openCatalogs(); 106cdf0e10cSrcweir } 107cdf0e10cSrcweir catch(SQLException&) 108cdf0e10cSrcweir { 109cdf0e10cSrcweir xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eCatalogs); 110cdf0e10cSrcweir } 111cdf0e10cSrcweir } 112cdf0e10cSrcweir 113cdf0e10cSrcweir return xRef; 114cdf0e10cSrcweir } 115cdf0e10cSrcweir // ------------------------------------------------------------------------- 116cdf0e10cSrcweir ::rtl::OUString ODatabaseMetaData::impl_getCatalogSeparator_throw( ) 117cdf0e10cSrcweir { 118cdf0e10cSrcweir ::rtl::OUString aVal; 119cdf0e10cSrcweir if ( m_bUseCatalog ) 120cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_NAME_SEPARATOR,aVal,*this,m_pConnection->getTextEncoding()); 121cdf0e10cSrcweir 122cdf0e10cSrcweir return aVal; 123cdf0e10cSrcweir } 124cdf0e10cSrcweir // ------------------------------------------------------------------------- 125cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getSchemas( ) throw(SQLException, RuntimeException) 126cdf0e10cSrcweir { 127cdf0e10cSrcweir Reference< XResultSet > xRef; 128cdf0e10cSrcweir try 129cdf0e10cSrcweir { 130cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection); 131cdf0e10cSrcweir xRef = pResult; 132cdf0e10cSrcweir pResult->openSchemas(); 133cdf0e10cSrcweir } 134cdf0e10cSrcweir catch(SQLException&) 135cdf0e10cSrcweir { 136cdf0e10cSrcweir xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eSchemas); 137cdf0e10cSrcweir } 138cdf0e10cSrcweir return xRef; 139cdf0e10cSrcweir } 140cdf0e10cSrcweir // ------------------------------------------------------------------------- 141cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumnPrivileges( 142cdf0e10cSrcweir const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, 143cdf0e10cSrcweir const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException) 144cdf0e10cSrcweir { 145cdf0e10cSrcweir Reference< XResultSet > xRef; 146cdf0e10cSrcweir try 147cdf0e10cSrcweir { 148cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection); 149cdf0e10cSrcweir xRef = pResult; 150cdf0e10cSrcweir pResult->openColumnPrivileges(m_bUseCatalog ? catalog : Any(),schema,table,columnNamePattern); 151cdf0e10cSrcweir } 152cdf0e10cSrcweir catch(SQLException&) 153cdf0e10cSrcweir { 154cdf0e10cSrcweir xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eColumnPrivileges); 155cdf0e10cSrcweir } 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 Reference< XResultSet > xRef; 164cdf0e10cSrcweir try 165cdf0e10cSrcweir { 166cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection); 167cdf0e10cSrcweir xRef = pResult; 168cdf0e10cSrcweir pResult->openColumns(m_bUseCatalog ? catalog : Any(),schemaPattern,tableNamePattern,columnNamePattern); 169cdf0e10cSrcweir } 170cdf0e10cSrcweir catch(SQLException&) 171cdf0e10cSrcweir { 172cdf0e10cSrcweir xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eColumns); 173cdf0e10cSrcweir } 174cdf0e10cSrcweir return xRef; 175cdf0e10cSrcweir } 176cdf0e10cSrcweir // ------------------------------------------------------------------------- 177cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables( 178cdf0e10cSrcweir const Any& catalog, const ::rtl::OUString& schemaPattern, 179cdf0e10cSrcweir const ::rtl::OUString& tableNamePattern, const Sequence< ::rtl::OUString >& types ) throw(SQLException, RuntimeException) 180cdf0e10cSrcweir { 181cdf0e10cSrcweir Reference< XResultSet > xRef; 182cdf0e10cSrcweir try 183cdf0e10cSrcweir { 184cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection); 185cdf0e10cSrcweir xRef = pResult; 186cdf0e10cSrcweir pResult->openTables(m_bUseCatalog ? catalog : Any(),schemaPattern,tableNamePattern,types); 187cdf0e10cSrcweir } 188cdf0e10cSrcweir catch(SQLException&) 189cdf0e10cSrcweir { 190cdf0e10cSrcweir xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTables); 191cdf0e10cSrcweir } 192cdf0e10cSrcweir return xRef; 193cdf0e10cSrcweir } 194cdf0e10cSrcweir // ------------------------------------------------------------------------- 195cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedureColumns( 196cdf0e10cSrcweir const Any& catalog, const ::rtl::OUString& schemaPattern, 197cdf0e10cSrcweir const ::rtl::OUString& procedureNamePattern, const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException) 198cdf0e10cSrcweir { 199cdf0e10cSrcweir Reference< XResultSet > xRef; 200cdf0e10cSrcweir try 201cdf0e10cSrcweir { 202cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection); 203cdf0e10cSrcweir xRef = pResult; 204cdf0e10cSrcweir pResult->openProcedureColumns(m_bUseCatalog ? catalog : Any(),schemaPattern,procedureNamePattern,columnNamePattern); 205cdf0e10cSrcweir } 206cdf0e10cSrcweir catch(SQLException&) 207cdf0e10cSrcweir { 208cdf0e10cSrcweir xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eProcedureColumns); 209cdf0e10cSrcweir } 210cdf0e10cSrcweir return xRef; 211cdf0e10cSrcweir } 212cdf0e10cSrcweir // ------------------------------------------------------------------------- 213cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedures( 214cdf0e10cSrcweir const Any& catalog, const ::rtl::OUString& schemaPattern, 215cdf0e10cSrcweir const ::rtl::OUString& procedureNamePattern ) throw(SQLException, RuntimeException) 216cdf0e10cSrcweir { 217cdf0e10cSrcweir Reference< XResultSet > xRef; 218cdf0e10cSrcweir try 219cdf0e10cSrcweir { 220cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection); 221cdf0e10cSrcweir xRef = pResult; 222cdf0e10cSrcweir pResult->openProcedures(m_bUseCatalog ? catalog : Any(),schemaPattern,procedureNamePattern); 223cdf0e10cSrcweir } 224cdf0e10cSrcweir catch(SQLException&) 225cdf0e10cSrcweir { 226cdf0e10cSrcweir xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eProcedures); 227cdf0e10cSrcweir } 228cdf0e10cSrcweir return xRef; 229cdf0e10cSrcweir } 230cdf0e10cSrcweir // ------------------------------------------------------------------------- 231cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getVersionColumns( 232cdf0e10cSrcweir const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException) 233cdf0e10cSrcweir { 234cdf0e10cSrcweir Reference< XResultSet > xRef; 235cdf0e10cSrcweir bool bSuccess = false; 236cdf0e10cSrcweir try 237cdf0e10cSrcweir { 238cdf0e10cSrcweir if ( !m_pConnection->preventGetVersionColumns() ) 239cdf0e10cSrcweir { 240cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection); 241cdf0e10cSrcweir xRef = pResult; 242cdf0e10cSrcweir pResult->openVersionColumns(m_bUseCatalog ? catalog : Any(),schema,table); 243cdf0e10cSrcweir bSuccess = true; 244cdf0e10cSrcweir } 245cdf0e10cSrcweir } 246cdf0e10cSrcweir catch(SQLException&) 247cdf0e10cSrcweir { 248cdf0e10cSrcweir } 249cdf0e10cSrcweir 250cdf0e10cSrcweir if ( !bSuccess ) 251cdf0e10cSrcweir { 252cdf0e10cSrcweir xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eVersionColumns); 253cdf0e10cSrcweir } 254cdf0e10cSrcweir 255cdf0e10cSrcweir return xRef; 256cdf0e10cSrcweir } 257cdf0e10cSrcweir // ------------------------------------------------------------------------- 258cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxBinaryLiteralLength( ) throw(SQLException, RuntimeException) 259cdf0e10cSrcweir { 260cdf0e10cSrcweir SQLUINTEGER nValue; 261cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_BINARY_LITERAL_LEN,nValue,*this); 262cdf0e10cSrcweir return nValue; 263cdf0e10cSrcweir } 264cdf0e10cSrcweir // ------------------------------------------------------------------------- 265cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxRowSize( ) throw(SQLException, RuntimeException) 266cdf0e10cSrcweir { 267cdf0e10cSrcweir SQLUINTEGER nValue; 268cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_ROW_SIZE,nValue,*this); 269cdf0e10cSrcweir return nValue; 270cdf0e10cSrcweir } 271cdf0e10cSrcweir // ------------------------------------------------------------------------- 272cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCatalogNameLength( ) throw(SQLException, RuntimeException) 273cdf0e10cSrcweir { 274cdf0e10cSrcweir SQLUSMALLINT nValue; 275cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_CATALOG_NAME_LEN,nValue,*this); 276cdf0e10cSrcweir return nValue; 277cdf0e10cSrcweir } 278cdf0e10cSrcweir // ------------------------------------------------------------------------- 279cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCharLiteralLength( ) throw(SQLException, RuntimeException) 280cdf0e10cSrcweir { 281cdf0e10cSrcweir SQLUINTEGER nValue; 282cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_CHAR_LITERAL_LEN,nValue,*this); 283cdf0e10cSrcweir return nValue; 284cdf0e10cSrcweir } 285cdf0e10cSrcweir // ------------------------------------------------------------------------- 286cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnNameLength( ) throw(SQLException, RuntimeException) 287cdf0e10cSrcweir { 288cdf0e10cSrcweir SQLUSMALLINT nValue; 289cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMN_NAME_LEN,nValue,*this); 290cdf0e10cSrcweir return nValue; 291cdf0e10cSrcweir } 292cdf0e10cSrcweir // ------------------------------------------------------------------------- 293cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInIndex( ) throw(SQLException, RuntimeException) 294cdf0e10cSrcweir { 295cdf0e10cSrcweir SQLUSMALLINT nValue; 296cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMNS_IN_INDEX,nValue,*this); 297cdf0e10cSrcweir return nValue; 298cdf0e10cSrcweir } 299cdf0e10cSrcweir // ------------------------------------------------------------------------- 300cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCursorNameLength( ) throw(SQLException, RuntimeException) 301cdf0e10cSrcweir { 302cdf0e10cSrcweir SQLUSMALLINT nValue; 303cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_CURSOR_NAME_LEN,nValue,*this); 304cdf0e10cSrcweir return nValue; 305cdf0e10cSrcweir } 306cdf0e10cSrcweir // ------------------------------------------------------------------------- 307cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxConnections( ) throw(SQLException, RuntimeException) 308cdf0e10cSrcweir { 309cdf0e10cSrcweir SQLUSMALLINT nValue; 310cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_DRIVER_CONNECTIONS/*SQL_ACTIVE_CONNECTIONS*/,nValue,*this); 311cdf0e10cSrcweir return nValue; 312cdf0e10cSrcweir } 313cdf0e10cSrcweir // ------------------------------------------------------------------------- 314cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInTable( ) throw(SQLException, RuntimeException) 315cdf0e10cSrcweir { 316cdf0e10cSrcweir SQLUSMALLINT nValue; 317cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMNS_IN_TABLE,nValue,*this); 318cdf0e10cSrcweir return nValue; 319cdf0e10cSrcweir } 320cdf0e10cSrcweir // ------------------------------------------------------------------------- 321cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxStatementLength( ) throw(SQLException, RuntimeException) 322cdf0e10cSrcweir { 323cdf0e10cSrcweir SQLUINTEGER nValue; 324cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_STATEMENT_LEN,nValue,*this); 325cdf0e10cSrcweir return nValue; 326cdf0e10cSrcweir } 327cdf0e10cSrcweir // ------------------------------------------------------------------------- 328cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxTableNameLength( ) throw(SQLException, RuntimeException) 329cdf0e10cSrcweir { 330cdf0e10cSrcweir SQLUSMALLINT nValue; 331cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_TABLE_NAME_LEN,nValue,*this); 332cdf0e10cSrcweir return nValue; 333cdf0e10cSrcweir } 334cdf0e10cSrcweir // ------------------------------------------------------------------------- 335cdf0e10cSrcweir sal_Int32 ODatabaseMetaData::impl_getMaxTablesInSelect_throw( ) 336cdf0e10cSrcweir { 337cdf0e10cSrcweir SQLUSMALLINT nValue; 338cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_TABLES_IN_SELECT,nValue,*this); 339cdf0e10cSrcweir return nValue; 340cdf0e10cSrcweir } 341cdf0e10cSrcweir // ------------------------------------------------------------------------- 342cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getExportedKeys( 343cdf0e10cSrcweir const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException) 344cdf0e10cSrcweir { 345cdf0e10cSrcweir Reference< XResultSet > xRef; 346cdf0e10cSrcweir try 347cdf0e10cSrcweir { 348cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection); 349cdf0e10cSrcweir xRef = pResult; 350cdf0e10cSrcweir pResult->openExportedKeys(m_bUseCatalog ? catalog : Any(),schema,table); 351cdf0e10cSrcweir } 352cdf0e10cSrcweir catch(SQLException&) 353cdf0e10cSrcweir { 354cdf0e10cSrcweir xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eExportedKeys); 355cdf0e10cSrcweir } 356cdf0e10cSrcweir return xRef; 357cdf0e10cSrcweir } 358cdf0e10cSrcweir // ------------------------------------------------------------------------- 359cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getImportedKeys( 360cdf0e10cSrcweir const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException) 361cdf0e10cSrcweir { 362cdf0e10cSrcweir Reference< XResultSet > xRef; 363cdf0e10cSrcweir try 364cdf0e10cSrcweir { 365cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection); 366cdf0e10cSrcweir xRef = pResult; 367cdf0e10cSrcweir pResult->openImportedKeys(m_bUseCatalog ? catalog : Any(),schema,table); 368cdf0e10cSrcweir } 369cdf0e10cSrcweir catch(SQLException&) 370cdf0e10cSrcweir { 371cdf0e10cSrcweir xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eImportedKeys); 372cdf0e10cSrcweir } 373cdf0e10cSrcweir return xRef; 374cdf0e10cSrcweir } 375cdf0e10cSrcweir // ------------------------------------------------------------------------- 376cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getPrimaryKeys( 377cdf0e10cSrcweir const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException) 378cdf0e10cSrcweir { 379cdf0e10cSrcweir Reference< XResultSet > xRef; 380cdf0e10cSrcweir try 381cdf0e10cSrcweir { 382cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection); 383cdf0e10cSrcweir xRef = pResult; 384cdf0e10cSrcweir pResult->openPrimaryKeys(m_bUseCatalog ? catalog : Any(),schema,table); 385cdf0e10cSrcweir } 386cdf0e10cSrcweir catch(SQLException&) 387cdf0e10cSrcweir { 388cdf0e10cSrcweir xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::ePrimaryKeys); 389cdf0e10cSrcweir } 390cdf0e10cSrcweir return xRef; 391cdf0e10cSrcweir } 392cdf0e10cSrcweir // ------------------------------------------------------------------------- 393cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getIndexInfo( 394cdf0e10cSrcweir const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, 395cdf0e10cSrcweir sal_Bool unique, sal_Bool approximate ) throw(SQLException, RuntimeException) 396cdf0e10cSrcweir { 397cdf0e10cSrcweir Reference< XResultSet > xRef; 398cdf0e10cSrcweir try 399cdf0e10cSrcweir { 400cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection); 401cdf0e10cSrcweir xRef = pResult; 402cdf0e10cSrcweir pResult->openIndexInfo(m_bUseCatalog ? catalog : Any(),schema,table,unique,approximate); 403cdf0e10cSrcweir } 404cdf0e10cSrcweir catch(SQLException&) 405cdf0e10cSrcweir { 406cdf0e10cSrcweir xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eIndexInfo); 407cdf0e10cSrcweir } 408cdf0e10cSrcweir return xRef; 409cdf0e10cSrcweir } 410cdf0e10cSrcweir // ------------------------------------------------------------------------- 411cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getBestRowIdentifier( 412cdf0e10cSrcweir const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, sal_Int32 scope, 413cdf0e10cSrcweir sal_Bool nullable ) throw(SQLException, RuntimeException) 414cdf0e10cSrcweir { 415cdf0e10cSrcweir Reference< XResultSet > xRef; 416cdf0e10cSrcweir try 417cdf0e10cSrcweir { 418cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection); 419cdf0e10cSrcweir xRef = pResult; 420cdf0e10cSrcweir pResult->openBestRowIdentifier(m_bUseCatalog ? catalog : Any(),schema,table,scope,nullable); 421cdf0e10cSrcweir } 422cdf0e10cSrcweir catch(SQLException&) 423cdf0e10cSrcweir { 424cdf0e10cSrcweir xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eBestRowIdentifier); 425cdf0e10cSrcweir } 426cdf0e10cSrcweir return xRef; 427cdf0e10cSrcweir } 428cdf0e10cSrcweir // ------------------------------------------------------------------------- 429cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges( 430cdf0e10cSrcweir const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern ) throw(SQLException, RuntimeException) 431cdf0e10cSrcweir { 432cdf0e10cSrcweir if ( m_pConnection->isIgnoreDriverPrivilegesEnabled() ) 433cdf0e10cSrcweir { 434cdf0e10cSrcweir return new OResultSetPrivileges(this,catalog,schemaPattern,tableNamePattern); 435cdf0e10cSrcweir } 436cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection); 437cdf0e10cSrcweir Reference< XResultSet > xRef = pResult; 438cdf0e10cSrcweir pResult->openTablePrivileges(m_bUseCatalog ? catalog : Any(),schemaPattern,tableNamePattern); 439cdf0e10cSrcweir return xRef; 440cdf0e10cSrcweir } 441cdf0e10cSrcweir // ------------------------------------------------------------------------- 442cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCrossReference( 443cdf0e10cSrcweir const Any& primaryCatalog, const ::rtl::OUString& primarySchema, 444cdf0e10cSrcweir const ::rtl::OUString& primaryTable, const Any& foreignCatalog, 445cdf0e10cSrcweir const ::rtl::OUString& foreignSchema, const ::rtl::OUString& foreignTable ) throw(SQLException, RuntimeException) 446cdf0e10cSrcweir { 447cdf0e10cSrcweir Reference< XResultSet > xRef; 448cdf0e10cSrcweir try 449cdf0e10cSrcweir { 450cdf0e10cSrcweir ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection); 451cdf0e10cSrcweir xRef = pResult; 452cdf0e10cSrcweir pResult->openForeignKeys(m_bUseCatalog ? primaryCatalog : Any(),primarySchema.toChar() == '%' ? &primarySchema : NULL,&primaryTable, 453cdf0e10cSrcweir m_bUseCatalog ? foreignCatalog : Any(), foreignSchema.toChar() == '%' ? &foreignSchema : NULL,&foreignTable); 454cdf0e10cSrcweir } 455cdf0e10cSrcweir catch(SQLException&) 456cdf0e10cSrcweir { 457cdf0e10cSrcweir xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eCrossReference); 458cdf0e10cSrcweir } 459cdf0e10cSrcweir return xRef; 460cdf0e10cSrcweir } 461cdf0e10cSrcweir // ------------------------------------------------------------------------- 462cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::doesMaxRowSizeIncludeBlobs( ) throw(SQLException, RuntimeException) 463cdf0e10cSrcweir { 464cdf0e10cSrcweir ::rtl::OUString aVal; 465cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_ROW_SIZE_INCLUDES_LONG,aVal,*this,m_pConnection->getTextEncoding()); 466cdf0e10cSrcweir return aVal.toChar() == 'Y'; 467cdf0e10cSrcweir } 468cdf0e10cSrcweir // ------------------------------------------------------------------------- 469cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException) 470cdf0e10cSrcweir { 471cdf0e10cSrcweir SQLUSMALLINT nValue; 472cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_QUOTED_IDENTIFIER_CASE,nValue,*this); 473cdf0e10cSrcweir return nValue == SQL_IC_LOWER; 474cdf0e10cSrcweir } 475cdf0e10cSrcweir // ------------------------------------------------------------------------- 476cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseIdentifiers( ) throw(SQLException, RuntimeException) 477cdf0e10cSrcweir { 478cdf0e10cSrcweir SQLUSMALLINT nValue; 479cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_IDENTIFIER_CASE,nValue,*this); 480cdf0e10cSrcweir return nValue == SQL_IC_LOWER; 481cdf0e10cSrcweir } 482cdf0e10cSrcweir // ------------------------------------------------------------------------- 483cdf0e10cSrcweir sal_Bool ODatabaseMetaData::impl_storesMixedCaseQuotedIdentifiers_throw( ) 484cdf0e10cSrcweir { 485cdf0e10cSrcweir SQLUSMALLINT nValue; 486cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_QUOTED_IDENTIFIER_CASE,nValue,*this); 487cdf0e10cSrcweir return nValue == SQL_IC_MIXED; 488cdf0e10cSrcweir } 489cdf0e10cSrcweir // ------------------------------------------------------------------------- 490cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::storesMixedCaseIdentifiers( ) throw(SQLException, RuntimeException) 491cdf0e10cSrcweir { 492cdf0e10cSrcweir SQLUSMALLINT nValue; 493cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_IDENTIFIER_CASE,nValue,*this); 494cdf0e10cSrcweir return nValue == SQL_IC_MIXED; 495cdf0e10cSrcweir } 496cdf0e10cSrcweir // ------------------------------------------------------------------------- 497cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException) 498cdf0e10cSrcweir { 499cdf0e10cSrcweir SQLUSMALLINT nValue; 500cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_QUOTED_IDENTIFIER_CASE,nValue,*this); 501cdf0e10cSrcweir return nValue == SQL_IC_UPPER; 502cdf0e10cSrcweir } 503cdf0e10cSrcweir // ------------------------------------------------------------------------- 504cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseIdentifiers( ) throw(SQLException, RuntimeException) 505cdf0e10cSrcweir { 506cdf0e10cSrcweir SQLUSMALLINT nValue; 507cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_IDENTIFIER_CASE,nValue,*this); 508cdf0e10cSrcweir return nValue == SQL_IC_UPPER; 509cdf0e10cSrcweir } 510cdf0e10cSrcweir // ------------------------------------------------------------------------- 511cdf0e10cSrcweir sal_Bool ODatabaseMetaData::impl_supportsAlterTableWithAddColumn_throw( ) 512cdf0e10cSrcweir { 513cdf0e10cSrcweir SQLUINTEGER nValue; 514cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ALTER_TABLE,nValue,*this); 515cdf0e10cSrcweir return (nValue & SQL_AT_ADD_COLUMN) == SQL_AT_ADD_COLUMN; 516cdf0e10cSrcweir } 517cdf0e10cSrcweir // ------------------------------------------------------------------------- 518cdf0e10cSrcweir sal_Bool ODatabaseMetaData::impl_supportsAlterTableWithDropColumn_throw( ) 519cdf0e10cSrcweir { 520cdf0e10cSrcweir SQLUINTEGER nValue; 521cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ALTER_TABLE,nValue,*this); 522cdf0e10cSrcweir return ((nValue & SQL_AT_DROP_COLUMN) == SQL_AT_DROP_COLUMN) || 523cdf0e10cSrcweir ((nValue & SQL_AT_DROP_COLUMN_CASCADE) == SQL_AT_DROP_COLUMN_CASCADE) || 524cdf0e10cSrcweir ((nValue & SQL_AT_DROP_COLUMN_RESTRICT) == SQL_AT_DROP_COLUMN_RESTRICT); 525cdf0e10cSrcweir } 526cdf0e10cSrcweir // ------------------------------------------------------------------------- 527cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxIndexLength( ) throw(SQLException, RuntimeException) 528cdf0e10cSrcweir { 529cdf0e10cSrcweir SQLUINTEGER nValue; 530cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_INDEX_SIZE,nValue,*this); 531cdf0e10cSrcweir return nValue; 532cdf0e10cSrcweir } 533cdf0e10cSrcweir // ------------------------------------------------------------------------- 534cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsNonNullableColumns( ) throw(SQLException, RuntimeException) 535cdf0e10cSrcweir { 536cdf0e10cSrcweir SQLUSMALLINT nValue; 537cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NON_NULLABLE_COLUMNS,nValue,*this); 538cdf0e10cSrcweir return nValue == SQL_NNC_NON_NULL; 539cdf0e10cSrcweir } 540cdf0e10cSrcweir // ------------------------------------------------------------------------- 541cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getCatalogTerm( ) throw(SQLException, RuntimeException) 542cdf0e10cSrcweir { 543cdf0e10cSrcweir ::rtl::OUString aVal; 544cdf0e10cSrcweir if(m_bUseCatalog) 545cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_TERM,aVal,*this,m_pConnection->getTextEncoding()); 546cdf0e10cSrcweir return aVal; 547cdf0e10cSrcweir } 548cdf0e10cSrcweir // ------------------------------------------------------------------------- 549cdf0e10cSrcweir ::rtl::OUString ODatabaseMetaData::impl_getIdentifierQuoteString_throw( ) 550cdf0e10cSrcweir { 551cdf0e10cSrcweir ::rtl::OUString aVal; 552cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_IDENTIFIER_QUOTE_CHAR,aVal,*this,m_pConnection->getTextEncoding()); 553cdf0e10cSrcweir return aVal; 554cdf0e10cSrcweir } 555cdf0e10cSrcweir // ------------------------------------------------------------------------- 556cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getExtraNameCharacters( ) throw(SQLException, RuntimeException) 557cdf0e10cSrcweir { 558cdf0e10cSrcweir ::rtl::OUString aVal; 559cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SPECIAL_CHARACTERS,aVal,*this,m_pConnection->getTextEncoding()); 560cdf0e10cSrcweir return aVal; 561cdf0e10cSrcweir } 562cdf0e10cSrcweir // ------------------------------------------------------------------------- 563cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsDifferentTableCorrelationNames( ) throw(SQLException, RuntimeException) 564cdf0e10cSrcweir { 565cdf0e10cSrcweir SQLUSMALLINT nValue; 566cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this); 567cdf0e10cSrcweir return nValue != SQL_CN_NONE; 568cdf0e10cSrcweir } 569cdf0e10cSrcweir // ------------------------------------------------------------------------- 570cdf0e10cSrcweir sal_Bool ODatabaseMetaData::impl_isCatalogAtStart_throw( ) 571cdf0e10cSrcweir { 572cdf0e10cSrcweir SQLUSMALLINT nValue=0; 573cdf0e10cSrcweir if ( m_bUseCatalog ) 574cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_LOCATION,nValue,*this); 575cdf0e10cSrcweir return nValue == SQL_CL_START; 576cdf0e10cSrcweir } 577cdf0e10cSrcweir // ------------------------------------------------------------------------- 578cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionIgnoredInTransactions( ) throw(SQLException, RuntimeException) 579cdf0e10cSrcweir { 580cdf0e10cSrcweir SQLUSMALLINT nValue; 581cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this); 582cdf0e10cSrcweir return nValue == SQL_TC_DDL_IGNORE; 583cdf0e10cSrcweir } 584cdf0e10cSrcweir // ------------------------------------------------------------------------- 585cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionCausesTransactionCommit( ) throw(SQLException, RuntimeException) 586cdf0e10cSrcweir { 587cdf0e10cSrcweir SQLUSMALLINT nValue; 588cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this); 589cdf0e10cSrcweir return nValue == SQL_TC_DDL_COMMIT; 590cdf0e10cSrcweir } 591cdf0e10cSrcweir // ------------------------------------------------------------------------- 592cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsDataManipulationTransactionsOnly( ) throw(SQLException, RuntimeException) 593cdf0e10cSrcweir { 594cdf0e10cSrcweir SQLUSMALLINT nValue; 595cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this); 596cdf0e10cSrcweir return nValue == SQL_TC_DML; 597cdf0e10cSrcweir } 598cdf0e10cSrcweir // ------------------------------------------------------------------------- 599cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions( ) throw(SQLException, RuntimeException) 600cdf0e10cSrcweir { 601cdf0e10cSrcweir SQLUSMALLINT nValue; 602cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this); 603cdf0e10cSrcweir return nValue == SQL_TC_ALL; 604cdf0e10cSrcweir } 605cdf0e10cSrcweir // ------------------------------------------------------------------------- 606cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedDelete( ) throw(SQLException, RuntimeException) 607cdf0e10cSrcweir { 608cdf0e10cSrcweir SQLUINTEGER nValue; 609cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DYNAMIC_CURSOR_ATTRIBUTES1,nValue,*this); 610cdf0e10cSrcweir return (nValue & SQL_CA1_POS_DELETE) == SQL_CA1_POS_DELETE; 611cdf0e10cSrcweir } 612cdf0e10cSrcweir // ------------------------------------------------------------------------- 613cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedUpdate( ) throw(SQLException, RuntimeException) 614cdf0e10cSrcweir { 615cdf0e10cSrcweir SQLUINTEGER nValue; 616cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DYNAMIC_CURSOR_ATTRIBUTES1,nValue,*this); 617cdf0e10cSrcweir return (nValue & SQL_CA1_POS_UPDATE) == SQL_CA1_POS_UPDATE; 618cdf0e10cSrcweir } 619cdf0e10cSrcweir // ------------------------------------------------------------------------- 620cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossRollback( ) throw(SQLException, RuntimeException) 621cdf0e10cSrcweir { 622cdf0e10cSrcweir SQLUSMALLINT nValue; 623cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CURSOR_ROLLBACK_BEHAVIOR,nValue,*this); 624cdf0e10cSrcweir return nValue == SQL_CB_PRESERVE || nValue == SQL_CB_CLOSE; 625cdf0e10cSrcweir } 626cdf0e10cSrcweir // ------------------------------------------------------------------------- 627cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossCommit( ) throw(SQLException, RuntimeException) 628cdf0e10cSrcweir { 629cdf0e10cSrcweir SQLUSMALLINT nValue; 630cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CURSOR_COMMIT_BEHAVIOR,nValue,*this); 631cdf0e10cSrcweir return nValue == SQL_CB_PRESERVE || nValue == SQL_CB_CLOSE; 632cdf0e10cSrcweir } 633cdf0e10cSrcweir // ------------------------------------------------------------------------- 634cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossCommit( ) throw(SQLException, RuntimeException) 635cdf0e10cSrcweir { 636cdf0e10cSrcweir SQLUSMALLINT nValue; 637cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CURSOR_COMMIT_BEHAVIOR,nValue,*this); 638cdf0e10cSrcweir return nValue == SQL_CB_PRESERVE; 639cdf0e10cSrcweir } 640cdf0e10cSrcweir // ------------------------------------------------------------------------- 641cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossRollback( ) throw(SQLException, RuntimeException) 642cdf0e10cSrcweir { 643cdf0e10cSrcweir SQLUSMALLINT nValue; 644cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CURSOR_ROLLBACK_BEHAVIOR,nValue,*this); 645cdf0e10cSrcweir return nValue == SQL_CB_PRESERVE; 646cdf0e10cSrcweir } 647cdf0e10cSrcweir // ------------------------------------------------------------------------- 648cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactionIsolationLevel( sal_Int32 level ) throw(SQLException, RuntimeException) 649cdf0e10cSrcweir { 650cdf0e10cSrcweir SQLUINTEGER nValue; 651cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_ISOLATION_OPTION,nValue,*this); 652cdf0e10cSrcweir return (nValue & static_cast<SQLUINTEGER>(level)) == static_cast<SQLUINTEGER>(level); 653cdf0e10cSrcweir } 654cdf0e10cSrcweir // ------------------------------------------------------------------------- 655cdf0e10cSrcweir sal_Bool ODatabaseMetaData::impl_supportsSchemasInDataManipulation_throw( ) 656cdf0e10cSrcweir { 657cdf0e10cSrcweir SQLUINTEGER nValue; 658cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this); 659cdf0e10cSrcweir return (nValue & SQL_SU_DML_STATEMENTS) == SQL_SU_DML_STATEMENTS; 660cdf0e10cSrcweir } 661cdf0e10cSrcweir // ------------------------------------------------------------------------- 662cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92FullSQL( ) throw(SQLException, RuntimeException) 663cdf0e10cSrcweir { 664cdf0e10cSrcweir SQLUINTEGER nValue; 665cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SQL_CONFORMANCE,nValue,*this); 666cdf0e10cSrcweir return nValue == SQL_SC_SQL92_FULL; 667cdf0e10cSrcweir } 668cdf0e10cSrcweir // ------------------------------------------------------------------------- 669cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92EntryLevelSQL( ) throw(SQLException, RuntimeException) 670cdf0e10cSrcweir { 671cdf0e10cSrcweir SQLUINTEGER nValue; 672cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SQL_CONFORMANCE,nValue,*this); 673cdf0e10cSrcweir return nValue == SQL_SC_SQL92_ENTRY; 674cdf0e10cSrcweir } 675cdf0e10cSrcweir // ------------------------------------------------------------------------- 676cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsIntegrityEnhancementFacility( ) throw(SQLException, RuntimeException) 677cdf0e10cSrcweir { 678cdf0e10cSrcweir ::rtl::OUString aStr; 679cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_INTEGRITY,aStr,*this,m_pConnection->getTextEncoding()); 680cdf0e10cSrcweir return aStr.toChar() == 'Y'; 681cdf0e10cSrcweir } 682cdf0e10cSrcweir // ------------------------------------------------------------------------- 683cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInIndexDefinitions( ) throw(SQLException, RuntimeException) 684cdf0e10cSrcweir { 685cdf0e10cSrcweir SQLUINTEGER nValue; 686cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this); 687cdf0e10cSrcweir return (nValue & SQL_SU_INDEX_DEFINITION) == SQL_SU_INDEX_DEFINITION; 688cdf0e10cSrcweir } 689cdf0e10cSrcweir // ------------------------------------------------------------------------- 690cdf0e10cSrcweir sal_Bool ODatabaseMetaData::impl_supportsSchemasInTableDefinitions_throw( ) 691cdf0e10cSrcweir { 692cdf0e10cSrcweir SQLUINTEGER nValue; 693cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this); 694cdf0e10cSrcweir return (nValue & SQL_SU_TABLE_DEFINITION) == SQL_SU_TABLE_DEFINITION; 695cdf0e10cSrcweir } 696cdf0e10cSrcweir // ------------------------------------------------------------------------- 697cdf0e10cSrcweir sal_Bool ODatabaseMetaData::impl_supportsCatalogsInTableDefinitions_throw( ) 698cdf0e10cSrcweir { 699cdf0e10cSrcweir SQLUINTEGER nValue=0; 700cdf0e10cSrcweir if(m_bUseCatalog) 701cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this); 702cdf0e10cSrcweir return (nValue & SQL_CU_TABLE_DEFINITION) == SQL_CU_TABLE_DEFINITION; 703cdf0e10cSrcweir } 704cdf0e10cSrcweir // ------------------------------------------------------------------------- 705cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInIndexDefinitions( ) throw(SQLException, RuntimeException) 706cdf0e10cSrcweir { 707cdf0e10cSrcweir SQLUINTEGER nValue=0; 708cdf0e10cSrcweir if(m_bUseCatalog) 709cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this); 710cdf0e10cSrcweir return (nValue & SQL_CU_INDEX_DEFINITION) == SQL_CU_INDEX_DEFINITION; 711cdf0e10cSrcweir } 712cdf0e10cSrcweir // ------------------------------------------------------------------------- 713cdf0e10cSrcweir sal_Bool ODatabaseMetaData::impl_supportsCatalogsInDataManipulation_throw( ) 714cdf0e10cSrcweir { 715cdf0e10cSrcweir SQLUINTEGER nValue=0; 716cdf0e10cSrcweir if(m_bUseCatalog) 717cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this); 718cdf0e10cSrcweir return (nValue & SQL_CU_DML_STATEMENTS) == SQL_CU_DML_STATEMENTS; 719cdf0e10cSrcweir } 720cdf0e10cSrcweir // ------------------------------------------------------------------------- 721cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsOuterJoins( ) throw(SQLException, RuntimeException) 722cdf0e10cSrcweir { 723cdf0e10cSrcweir SQLUINTEGER nValue; 724cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_OJ_CAPABILITIES,nValue,*this); 725cdf0e10cSrcweir 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); 726cdf0e10cSrcweir } 727cdf0e10cSrcweir // ------------------------------------------------------------------------- 728cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTableTypes( ) throw(SQLException, RuntimeException) 729cdf0e10cSrcweir { 730cdf0e10cSrcweir 731cdf0e10cSrcweir // there exists no possibility to get table types so we have to check 732cdf0e10cSrcweir static ::rtl::OUString sTableTypes[] = 733cdf0e10cSrcweir { 734cdf0e10cSrcweir ::rtl::OUString::createFromAscii("TABLE"), 735cdf0e10cSrcweir ::rtl::OUString::createFromAscii("VIEW"), 736cdf0e10cSrcweir ::rtl::OUString::createFromAscii("SYSTEM TABLE"), 737cdf0e10cSrcweir ::rtl::OUString::createFromAscii("GLOBAL TEMPORARY"), 738cdf0e10cSrcweir ::rtl::OUString::createFromAscii("LOCAL TEMPORARY"), 739cdf0e10cSrcweir ::rtl::OUString::createFromAscii("ALIAS"), 740cdf0e10cSrcweir ::rtl::OUString::createFromAscii("SYNONYM") 741cdf0e10cSrcweir }; 742cdf0e10cSrcweir sal_Int32 nSize = sizeof(sTableTypes) / sizeof(::rtl::OUString); 743cdf0e10cSrcweir ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTableTypes); 744cdf0e10cSrcweir Reference< XResultSet > xRef = pResult; 745cdf0e10cSrcweir SQLUINTEGER nValue = 0; 746cdf0e10cSrcweir try 747cdf0e10cSrcweir { 748cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CREATE_VIEW,nValue,*this); 749cdf0e10cSrcweir } 750cdf0e10cSrcweir catch(const Exception&) 751cdf0e10cSrcweir { 752cdf0e10cSrcweir } 753cdf0e10cSrcweir sal_Bool bViewsSupported = (nValue & SQL_CV_CREATE_VIEW) == SQL_CV_CREATE_VIEW; 754cdf0e10cSrcweir 755cdf0e10cSrcweir ::connectivity::ODatabaseMetaDataResultSet::ORows aRows; 756cdf0e10cSrcweir for(sal_Int32 i=0;i < nSize;++i) 757cdf0e10cSrcweir { 758cdf0e10cSrcweir if( !bViewsSupported && i == 1) 759cdf0e10cSrcweir continue; // no views supported 760cdf0e10cSrcweir ::connectivity::ODatabaseMetaDataResultSet::ORow aRow; 761cdf0e10cSrcweir aRow.push_back(::connectivity::ODatabaseMetaDataResultSet::getEmptyValue()); 762cdf0e10cSrcweir aRow.push_back(new ::connectivity::ORowSetValueDecorator(sTableTypes[i])); 763cdf0e10cSrcweir aRows.push_back(aRow); 764cdf0e10cSrcweir } 765cdf0e10cSrcweir pResult->setRows(aRows); 766cdf0e10cSrcweir return xRef; 767cdf0e10cSrcweir } 768cdf0e10cSrcweir // ------------------------------------------------------------------------- 769cdf0e10cSrcweir sal_Int32 ODatabaseMetaData::impl_getMaxStatements_throw( ) 770cdf0e10cSrcweir { 771cdf0e10cSrcweir SQLUSMALLINT nValue; 772cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_CONCURRENT_ACTIVITIES,nValue,*this); 773cdf0e10cSrcweir return nValue; 774cdf0e10cSrcweir } 775cdf0e10cSrcweir // ------------------------------------------------------------------------- 776cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxProcedureNameLength( ) throw(SQLException, RuntimeException) 777cdf0e10cSrcweir { 778cdf0e10cSrcweir SQLUSMALLINT nValue; 779cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_PROCEDURE_NAME_LEN,nValue,*this); 780cdf0e10cSrcweir return nValue; 781cdf0e10cSrcweir } 782cdf0e10cSrcweir // ------------------------------------------------------------------------- 783cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxSchemaNameLength( ) throw(SQLException, RuntimeException) 784cdf0e10cSrcweir { 785cdf0e10cSrcweir SQLUSMALLINT nValue; 786cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_SCHEMA_NAME_LEN,nValue,*this); 787cdf0e10cSrcweir return nValue; 788cdf0e10cSrcweir } 789cdf0e10cSrcweir // ------------------------------------------------------------------------- 790cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactions( ) throw(SQLException, RuntimeException) 791cdf0e10cSrcweir { 792cdf0e10cSrcweir SQLUSMALLINT nValue; 793cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this); 794cdf0e10cSrcweir return nValue != SQL_TC_NONE; 795cdf0e10cSrcweir } 796cdf0e10cSrcweir // ------------------------------------------------------------------------- 797cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::allProceduresAreCallable( ) throw(SQLException, RuntimeException) 798cdf0e10cSrcweir { 799cdf0e10cSrcweir ::rtl::OUString aValue; 800cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ACCESSIBLE_PROCEDURES,aValue,*this,m_pConnection->getTextEncoding()); 801cdf0e10cSrcweir return aValue.toChar() == 'Y'; 802cdf0e10cSrcweir } 803cdf0e10cSrcweir // ------------------------------------------------------------------------- 804cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsStoredProcedures( ) throw(SQLException, RuntimeException) 805cdf0e10cSrcweir { 806cdf0e10cSrcweir ::rtl::OUString aValue; 807cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_PROCEDURES,aValue,*this,m_pConnection->getTextEncoding()); 808cdf0e10cSrcweir return aValue.toChar() == 'Y'; 809cdf0e10cSrcweir } 810cdf0e10cSrcweir // ------------------------------------------------------------------------- 811cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsSelectForUpdate( ) throw(SQLException, RuntimeException) 812cdf0e10cSrcweir { 813cdf0e10cSrcweir SQLUINTEGER nValue; 814cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DYNAMIC_CURSOR_ATTRIBUTES1,nValue,*this); 815cdf0e10cSrcweir return (nValue & SQL_CA1_POSITIONED_UPDATE) == SQL_CA1_POSITIONED_UPDATE; 816cdf0e10cSrcweir } 817cdf0e10cSrcweir // ------------------------------------------------------------------------- 818cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::allTablesAreSelectable( ) throw(SQLException, RuntimeException) 819cdf0e10cSrcweir { 820cdf0e10cSrcweir ::rtl::OUString aValue; 821cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ACCESSIBLE_TABLES,aValue,*this,m_pConnection->getTextEncoding()); 822cdf0e10cSrcweir return aValue.toChar() == 'Y'; 823cdf0e10cSrcweir } 824cdf0e10cSrcweir // ------------------------------------------------------------------------- 825cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::isReadOnly( ) throw(SQLException, RuntimeException) 826cdf0e10cSrcweir { 827cdf0e10cSrcweir return m_pConnection->isReadOnly(); 828cdf0e10cSrcweir } 829cdf0e10cSrcweir // ------------------------------------------------------------------------- 830cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFiles( ) throw(SQLException, RuntimeException) 831cdf0e10cSrcweir { 832cdf0e10cSrcweir SQLUSMALLINT nValue; 833cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_FILE_USAGE,nValue,*this); 834cdf0e10cSrcweir return nValue == SQL_FILE_CATALOG; 835cdf0e10cSrcweir } 836cdf0e10cSrcweir // ------------------------------------------------------------------------- 837cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFilePerTable( ) throw(SQLException, RuntimeException) 838cdf0e10cSrcweir { 839cdf0e10cSrcweir SQLUSMALLINT nValue; 840cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_FILE_USAGE,nValue,*this); 841cdf0e10cSrcweir return nValue == SQL_FILE_TABLE; 842cdf0e10cSrcweir } 843cdf0e10cSrcweir // ------------------------------------------------------------------------- 844cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsTypeConversion( ) throw(SQLException, RuntimeException) 845cdf0e10cSrcweir { 846cdf0e10cSrcweir SQLUINTEGER nValue; 847cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_FUNCTIONS,nValue,*this); 848cdf0e10cSrcweir return (nValue & SQL_FN_CVT_CONVERT) == SQL_FN_CVT_CONVERT; 849cdf0e10cSrcweir } 850cdf0e10cSrcweir // ------------------------------------------------------------------------- 851cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::nullPlusNonNullIsNull( ) throw(SQLException, RuntimeException) 852cdf0e10cSrcweir { 853cdf0e10cSrcweir SQLUSMALLINT nValue; 854cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONCAT_NULL_BEHAVIOR,nValue,*this); 855cdf0e10cSrcweir return nValue == SQL_CB_NULL; 856cdf0e10cSrcweir } 857cdf0e10cSrcweir // ------------------------------------------------------------------------- 858cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsColumnAliasing( ) throw(SQLException, RuntimeException) 859cdf0e10cSrcweir { 860cdf0e10cSrcweir ::rtl::OUString aValue; 861cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_COLUMN_ALIAS,aValue,*this,m_pConnection->getTextEncoding()); 862cdf0e10cSrcweir return aValue.toChar() == 'Y'; 863cdf0e10cSrcweir } 864cdf0e10cSrcweir // ------------------------------------------------------------------------- 865cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsTableCorrelationNames( ) throw(SQLException, RuntimeException) 866cdf0e10cSrcweir { 867cdf0e10cSrcweir SQLUSMALLINT nValue; 868cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this); 869cdf0e10cSrcweir return nValue != SQL_CN_NONE; 870cdf0e10cSrcweir } 871cdf0e10cSrcweir // ------------------------------------------------------------------------- 872cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsConvert( sal_Int32 fromType, sal_Int32 toType ) throw(SQLException, RuntimeException) 873cdf0e10cSrcweir { 874cdf0e10cSrcweir if(fromType == toType) 875cdf0e10cSrcweir return sal_True; 876cdf0e10cSrcweir 877cdf0e10cSrcweir SQLUINTEGER nValue=0; 878cdf0e10cSrcweir switch(fromType) 879cdf0e10cSrcweir { 880cdf0e10cSrcweir case DataType::BIT: 881cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_BIT,nValue,*this); 882cdf0e10cSrcweir break; 883cdf0e10cSrcweir case DataType::TINYINT: 884cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_TINYINT,nValue,*this); 885cdf0e10cSrcweir break; 886cdf0e10cSrcweir case DataType::SMALLINT: 887cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_SMALLINT,nValue,*this); 888cdf0e10cSrcweir break; 889cdf0e10cSrcweir case DataType::INTEGER: 890cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_INTEGER,nValue,*this); 891cdf0e10cSrcweir break; 892cdf0e10cSrcweir case DataType::BIGINT: 893cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_BIGINT,nValue,*this); 894cdf0e10cSrcweir break; 895cdf0e10cSrcweir case DataType::FLOAT: 896cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_FLOAT,nValue,*this); 897cdf0e10cSrcweir break; 898cdf0e10cSrcweir case DataType::REAL: 899cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_REAL,nValue,*this); 900cdf0e10cSrcweir break; 901cdf0e10cSrcweir case DataType::DOUBLE: 902cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_DOUBLE,nValue,*this); 903cdf0e10cSrcweir break; 904cdf0e10cSrcweir case DataType::NUMERIC: 905cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_NUMERIC,nValue,*this); 906cdf0e10cSrcweir break; 907cdf0e10cSrcweir case DataType::DECIMAL: 908cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_DECIMAL,nValue,*this); 909cdf0e10cSrcweir break; 910cdf0e10cSrcweir case DataType::CHAR: 911cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_CHAR,nValue,*this); 912cdf0e10cSrcweir break; 913cdf0e10cSrcweir case DataType::VARCHAR: 914cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_VARCHAR,nValue,*this); 915cdf0e10cSrcweir break; 916cdf0e10cSrcweir case DataType::LONGVARCHAR: 917cdf0e10cSrcweir case DataType::CLOB: 918cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_LONGVARCHAR,nValue,*this); 919cdf0e10cSrcweir break; 920cdf0e10cSrcweir case DataType::DATE: 921cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_DATE,nValue,*this); 922cdf0e10cSrcweir break; 923cdf0e10cSrcweir case DataType::TIME: 924cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_TIME,nValue,*this); 925cdf0e10cSrcweir break; 926cdf0e10cSrcweir case DataType::TIMESTAMP: 927cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_TIMESTAMP,nValue,*this); 928cdf0e10cSrcweir break; 929cdf0e10cSrcweir case DataType::BINARY: 930cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_BINARY,nValue,*this); 931cdf0e10cSrcweir break; 932cdf0e10cSrcweir case DataType::VARBINARY: 933cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_VARBINARY,nValue,*this); 934cdf0e10cSrcweir break; 935cdf0e10cSrcweir case DataType::LONGVARBINARY: 936cdf0e10cSrcweir case DataType::BLOB: 937cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_LONGVARBINARY,nValue,*this); 938cdf0e10cSrcweir break; 939cdf0e10cSrcweir case DataType::SQLNULL: 940cdf0e10cSrcweir // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this); 941cdf0e10cSrcweir break; 942cdf0e10cSrcweir case DataType::OTHER: 943cdf0e10cSrcweir // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this); 944cdf0e10cSrcweir break; 945cdf0e10cSrcweir case DataType::OBJECT: 946cdf0e10cSrcweir // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this); 947cdf0e10cSrcweir break; 948cdf0e10cSrcweir case DataType::DISTINCT: 949cdf0e10cSrcweir // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this); 950cdf0e10cSrcweir break; 951cdf0e10cSrcweir case DataType::STRUCT: 952cdf0e10cSrcweir // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this); 953cdf0e10cSrcweir break; 954cdf0e10cSrcweir case DataType::ARRAY: 955cdf0e10cSrcweir // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this); 956cdf0e10cSrcweir break; 957cdf0e10cSrcweir case DataType::REF: 958cdf0e10cSrcweir // OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this); 959cdf0e10cSrcweir break; 960cdf0e10cSrcweir } 961cdf0e10cSrcweir sal_Bool bConvert = sal_False; 962cdf0e10cSrcweir switch(toType) 963cdf0e10cSrcweir { 964cdf0e10cSrcweir case DataType::BIT: 965cdf0e10cSrcweir bConvert = (nValue & SQL_CVT_BIT) == SQL_CVT_BIT; 966cdf0e10cSrcweir break; 967cdf0e10cSrcweir case DataType::TINYINT: 968cdf0e10cSrcweir bConvert = (nValue & SQL_CVT_TINYINT) == SQL_CVT_TINYINT; 969cdf0e10cSrcweir break; 970cdf0e10cSrcweir case DataType::SMALLINT: 971cdf0e10cSrcweir bConvert = (nValue & SQL_CVT_SMALLINT) == SQL_CVT_SMALLINT; 972cdf0e10cSrcweir break; 973cdf0e10cSrcweir case DataType::INTEGER: 974cdf0e10cSrcweir bConvert = (nValue & SQL_CVT_INTEGER) == SQL_CVT_INTEGER; 975cdf0e10cSrcweir break; 976cdf0e10cSrcweir case DataType::BIGINT: 977cdf0e10cSrcweir bConvert = (nValue & SQL_CVT_BIGINT) == SQL_CVT_BIGINT; 978cdf0e10cSrcweir break; 979cdf0e10cSrcweir case DataType::FLOAT: 980cdf0e10cSrcweir bConvert = (nValue & SQL_CVT_FLOAT) == SQL_CVT_FLOAT; 981cdf0e10cSrcweir break; 982cdf0e10cSrcweir case DataType::REAL: 983cdf0e10cSrcweir bConvert = (nValue & SQL_CVT_REAL) == SQL_CVT_REAL; 984cdf0e10cSrcweir break; 985cdf0e10cSrcweir case DataType::DOUBLE: 986cdf0e10cSrcweir bConvert = (nValue & SQL_CVT_DOUBLE) == SQL_CVT_DOUBLE; 987cdf0e10cSrcweir break; 988cdf0e10cSrcweir case DataType::NUMERIC: 989cdf0e10cSrcweir bConvert = (nValue & SQL_CVT_NUMERIC) == SQL_CVT_NUMERIC; 990cdf0e10cSrcweir break; 991cdf0e10cSrcweir case DataType::DECIMAL: 992cdf0e10cSrcweir bConvert = (nValue & SQL_CVT_DECIMAL) == SQL_CVT_DECIMAL; 993cdf0e10cSrcweir break; 994cdf0e10cSrcweir case DataType::CHAR: 995cdf0e10cSrcweir bConvert = (nValue & SQL_CVT_CHAR) == SQL_CVT_CHAR; 996cdf0e10cSrcweir break; 997cdf0e10cSrcweir case DataType::VARCHAR: 998cdf0e10cSrcweir bConvert = (nValue & SQL_CVT_VARCHAR) == SQL_CVT_VARCHAR; 999cdf0e10cSrcweir break; 1000cdf0e10cSrcweir case DataType::LONGVARCHAR: 1001cdf0e10cSrcweir case DataType::CLOB: 1002cdf0e10cSrcweir bConvert = (nValue & SQL_CVT_LONGVARCHAR) == SQL_CVT_LONGVARCHAR; 1003cdf0e10cSrcweir break; 1004cdf0e10cSrcweir case DataType::DATE: 1005cdf0e10cSrcweir bConvert = (nValue & SQL_CVT_DATE) == SQL_CVT_DATE; 1006cdf0e10cSrcweir break; 1007cdf0e10cSrcweir case DataType::TIME: 1008cdf0e10cSrcweir bConvert = (nValue & SQL_CVT_TIME) == SQL_CVT_TIME; 1009cdf0e10cSrcweir break; 1010cdf0e10cSrcweir case DataType::TIMESTAMP: 1011cdf0e10cSrcweir bConvert = (nValue & SQL_CVT_TIMESTAMP) == SQL_CVT_TIMESTAMP; 1012cdf0e10cSrcweir break; 1013cdf0e10cSrcweir case DataType::BINARY: 1014cdf0e10cSrcweir bConvert = (nValue & SQL_CVT_BINARY) == SQL_CVT_BINARY; 1015cdf0e10cSrcweir break; 1016cdf0e10cSrcweir case DataType::VARBINARY: 1017cdf0e10cSrcweir bConvert = (nValue & SQL_CVT_VARBINARY) == SQL_CVT_VARBINARY; 1018cdf0e10cSrcweir break; 1019cdf0e10cSrcweir case DataType::LONGVARBINARY: 1020cdf0e10cSrcweir case DataType::BLOB: 1021cdf0e10cSrcweir bConvert = (nValue & SQL_CVT_LONGVARBINARY) == SQL_CVT_LONGVARBINARY; 1022cdf0e10cSrcweir break; 1023cdf0e10cSrcweir } 1024cdf0e10cSrcweir 1025cdf0e10cSrcweir return bConvert; 1026cdf0e10cSrcweir } 1027cdf0e10cSrcweir // ------------------------------------------------------------------------- 1028cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsExpressionsInOrderBy( ) throw(SQLException, RuntimeException) 1029cdf0e10cSrcweir { 1030cdf0e10cSrcweir ::rtl::OUString aValue; 1031cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_EXPRESSIONS_IN_ORDERBY,aValue,*this,m_pConnection->getTextEncoding()); 1032cdf0e10cSrcweir return aValue.toChar() == 'Y'; 1033cdf0e10cSrcweir } 1034cdf0e10cSrcweir // ------------------------------------------------------------------------- 1035cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupBy( ) throw(SQLException, RuntimeException) 1036cdf0e10cSrcweir { 1037cdf0e10cSrcweir SQLUSMALLINT nValue; 1038cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_GROUP_BY,nValue,*this); 1039cdf0e10cSrcweir return nValue != SQL_GB_NOT_SUPPORTED; 1040cdf0e10cSrcweir } 1041cdf0e10cSrcweir // ------------------------------------------------------------------------- 1042cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByBeyondSelect( ) throw(SQLException, RuntimeException) 1043cdf0e10cSrcweir { 1044cdf0e10cSrcweir SQLUSMALLINT nValue; 1045cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_GROUP_BY,nValue,*this); 1046cdf0e10cSrcweir return nValue != SQL_GB_GROUP_BY_CONTAINS_SELECT; 1047cdf0e10cSrcweir } 1048cdf0e10cSrcweir // ------------------------------------------------------------------------- 1049cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByUnrelated( ) throw(SQLException, RuntimeException) 1050cdf0e10cSrcweir { 1051cdf0e10cSrcweir SQLUSMALLINT nValue; 1052cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_GROUP_BY,nValue,*this); 1053cdf0e10cSrcweir return nValue == SQL_GB_NO_RELATION; 1054cdf0e10cSrcweir } 1055cdf0e10cSrcweir // ------------------------------------------------------------------------- 1056cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleTransactions( ) throw(SQLException, RuntimeException) 1057cdf0e10cSrcweir { 1058cdf0e10cSrcweir ::rtl::OUString aValue; 1059cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MULTIPLE_ACTIVE_TXN,aValue,*this,m_pConnection->getTextEncoding()); 1060cdf0e10cSrcweir return aValue.toChar() == 'Y'; 1061cdf0e10cSrcweir } 1062cdf0e10cSrcweir // ------------------------------------------------------------------------- 1063cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleResultSets( ) throw(SQLException, RuntimeException) 1064cdf0e10cSrcweir { 1065cdf0e10cSrcweir ::rtl::OUString aValue; 1066cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MULT_RESULT_SETS,aValue,*this,m_pConnection->getTextEncoding()); 1067cdf0e10cSrcweir return aValue.toChar() == 'Y'; 1068cdf0e10cSrcweir } 1069cdf0e10cSrcweir // ------------------------------------------------------------------------- 1070cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsLikeEscapeClause( ) throw(SQLException, RuntimeException) 1071cdf0e10cSrcweir { 1072cdf0e10cSrcweir ::rtl::OUString aValue; 1073cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_LIKE_ESCAPE_CLAUSE,aValue,*this,m_pConnection->getTextEncoding()); 1074cdf0e10cSrcweir return aValue.toChar() == 'Y'; 1075cdf0e10cSrcweir } 1076cdf0e10cSrcweir // ------------------------------------------------------------------------- 1077cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsOrderByUnrelated( ) throw(SQLException, RuntimeException) 1078cdf0e10cSrcweir { 1079cdf0e10cSrcweir ::rtl::OUString aValue; 1080cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ORDER_BY_COLUMNS_IN_SELECT,aValue,*this,m_pConnection->getTextEncoding()); 1081cdf0e10cSrcweir return aValue.toChar() == 'N'; 1082cdf0e10cSrcweir } 1083cdf0e10cSrcweir // ------------------------------------------------------------------------- 1084cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsUnion( ) throw(SQLException, RuntimeException) 1085cdf0e10cSrcweir { 1086cdf0e10cSrcweir SQLUINTEGER nValue; 1087cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_UNION,nValue,*this); 1088cdf0e10cSrcweir return (nValue & SQL_U_UNION) == SQL_U_UNION; 1089cdf0e10cSrcweir } 1090cdf0e10cSrcweir // ------------------------------------------------------------------------- 1091cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsUnionAll( ) throw(SQLException, RuntimeException) 1092cdf0e10cSrcweir { 1093cdf0e10cSrcweir SQLUINTEGER nValue; 1094cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_UNION,nValue,*this); 1095cdf0e10cSrcweir return (nValue & SQL_U_UNION_ALL) == SQL_U_UNION_ALL; 1096cdf0e10cSrcweir } 1097cdf0e10cSrcweir // ------------------------------------------------------------------------- 1098cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsMixedCaseIdentifiers( ) throw(SQLException, RuntimeException) 1099cdf0e10cSrcweir { 1100cdf0e10cSrcweir SQLUSMALLINT nValue; 1101cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_IDENTIFIER_CASE,nValue,*this); 1102cdf0e10cSrcweir return nValue == SQL_IC_MIXED; 1103cdf0e10cSrcweir } 1104cdf0e10cSrcweir // ------------------------------------------------------------------------- 1105cdf0e10cSrcweir sal_Bool ODatabaseMetaData::impl_supportsMixedCaseQuotedIdentifiers_throw( ) 1106cdf0e10cSrcweir { 1107cdf0e10cSrcweir SQLUSMALLINT nValue; 1108cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_QUOTED_IDENTIFIER_CASE,nValue,*this); 1109cdf0e10cSrcweir return nValue == SQL_IC_MIXED; 1110cdf0e10cSrcweir } 1111cdf0e10cSrcweir // ------------------------------------------------------------------------- 1112cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtEnd( ) throw(SQLException, RuntimeException) 1113cdf0e10cSrcweir { 1114cdf0e10cSrcweir SQLUSMALLINT nValue; 1115cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NULL_COLLATION,nValue,*this); 1116cdf0e10cSrcweir return nValue == SQL_NC_END; 1117cdf0e10cSrcweir } 1118cdf0e10cSrcweir // ------------------------------------------------------------------------- 1119cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtStart( ) throw(SQLException, RuntimeException) 1120cdf0e10cSrcweir { 1121cdf0e10cSrcweir SQLUSMALLINT nValue; 1122cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NULL_COLLATION,nValue,*this); 1123cdf0e10cSrcweir return nValue == SQL_NC_START; 1124cdf0e10cSrcweir } 1125cdf0e10cSrcweir // ------------------------------------------------------------------------- 1126cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedHigh( ) throw(SQLException, RuntimeException) 1127cdf0e10cSrcweir { 1128cdf0e10cSrcweir SQLUSMALLINT nValue; 1129cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NULL_COLLATION,nValue,*this); 1130cdf0e10cSrcweir return nValue == SQL_NC_HIGH; 1131cdf0e10cSrcweir } 1132cdf0e10cSrcweir // ------------------------------------------------------------------------- 1133cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedLow( ) throw(SQLException, RuntimeException) 1134cdf0e10cSrcweir { 1135cdf0e10cSrcweir SQLUSMALLINT nValue; 1136cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NULL_COLLATION,nValue,*this); 1137cdf0e10cSrcweir return nValue == SQL_NC_LOW; 1138cdf0e10cSrcweir } 1139cdf0e10cSrcweir // ------------------------------------------------------------------------- 1140cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInProcedureCalls( ) throw(SQLException, RuntimeException) 1141cdf0e10cSrcweir { 1142cdf0e10cSrcweir SQLUINTEGER nValue; 1143cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this); 1144cdf0e10cSrcweir return (nValue & SQL_SU_PROCEDURE_INVOCATION) == SQL_SU_PROCEDURE_INVOCATION; 1145cdf0e10cSrcweir } 1146cdf0e10cSrcweir // ------------------------------------------------------------------------- 1147cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInPrivilegeDefinitions( ) throw(SQLException, RuntimeException) 1148cdf0e10cSrcweir { 1149cdf0e10cSrcweir SQLUINTEGER nValue; 1150cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this); 1151cdf0e10cSrcweir return (nValue & SQL_SU_PRIVILEGE_DEFINITION) == SQL_SU_PRIVILEGE_DEFINITION; 1152cdf0e10cSrcweir } 1153cdf0e10cSrcweir // ------------------------------------------------------------------------- 1154cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInProcedureCalls( ) throw(SQLException, RuntimeException) 1155cdf0e10cSrcweir { 1156cdf0e10cSrcweir SQLUINTEGER nValue=0; 1157cdf0e10cSrcweir if(m_bUseCatalog) 1158cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this); 1159cdf0e10cSrcweir return (nValue & SQL_CU_PROCEDURE_INVOCATION) == SQL_CU_PROCEDURE_INVOCATION; 1160cdf0e10cSrcweir } 1161cdf0e10cSrcweir // ------------------------------------------------------------------------- 1162cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInPrivilegeDefinitions( ) throw(SQLException, RuntimeException) 1163cdf0e10cSrcweir { 1164cdf0e10cSrcweir SQLUINTEGER nValue=0; 1165cdf0e10cSrcweir if(m_bUseCatalog) 1166cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this); 1167cdf0e10cSrcweir return (nValue & SQL_CU_PRIVILEGE_DEFINITION) == SQL_CU_PRIVILEGE_DEFINITION; 1168cdf0e10cSrcweir } 1169cdf0e10cSrcweir // ------------------------------------------------------------------------- 1170cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsCorrelatedSubqueries( ) throw(SQLException, RuntimeException) 1171cdf0e10cSrcweir { 1172cdf0e10cSrcweir SQLUINTEGER nValue; 1173cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this); 1174cdf0e10cSrcweir return (nValue & SQL_SQ_CORRELATED_SUBQUERIES) == SQL_SQ_CORRELATED_SUBQUERIES; 1175cdf0e10cSrcweir } 1176cdf0e10cSrcweir // ------------------------------------------------------------------------- 1177cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInComparisons( ) throw(SQLException, RuntimeException) 1178cdf0e10cSrcweir { 1179cdf0e10cSrcweir SQLUINTEGER nValue; 1180cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this); 1181cdf0e10cSrcweir return (nValue & SQL_SQ_COMPARISON) == SQL_SQ_COMPARISON; 1182cdf0e10cSrcweir } 1183cdf0e10cSrcweir // ------------------------------------------------------------------------- 1184cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInExists( ) throw(SQLException, RuntimeException) 1185cdf0e10cSrcweir { 1186cdf0e10cSrcweir SQLUINTEGER nValue; 1187cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this); 1188cdf0e10cSrcweir return (nValue & SQL_SQ_EXISTS) == SQL_SQ_EXISTS; 1189cdf0e10cSrcweir } 1190cdf0e10cSrcweir // ------------------------------------------------------------------------- 1191cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInIns( ) throw(SQLException, RuntimeException) 1192cdf0e10cSrcweir { 1193cdf0e10cSrcweir SQLUINTEGER nValue; 1194cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this); 1195cdf0e10cSrcweir return (nValue & SQL_SQ_IN) == SQL_SQ_IN; 1196cdf0e10cSrcweir } 1197cdf0e10cSrcweir // ------------------------------------------------------------------------- 1198cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInQuantifieds( ) throw(SQLException, RuntimeException) 1199cdf0e10cSrcweir { 1200cdf0e10cSrcweir SQLUINTEGER nValue; 1201cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this); 1202cdf0e10cSrcweir return (nValue & SQL_SQ_QUANTIFIED) == SQL_SQ_QUANTIFIED; 1203cdf0e10cSrcweir } 1204cdf0e10cSrcweir // ------------------------------------------------------------------------- 1205cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92IntermediateSQL( ) throw(SQLException, RuntimeException) 1206cdf0e10cSrcweir { 1207cdf0e10cSrcweir SQLUINTEGER nValue; 1208cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SQL_CONFORMANCE,nValue,*this); 1209cdf0e10cSrcweir return nValue == SQL_SC_SQL92_INTERMEDIATE; 1210cdf0e10cSrcweir } 1211cdf0e10cSrcweir // ----------------------------------------------------------------------------- 1212cdf0e10cSrcweir ::rtl::OUString ODatabaseMetaData::getURLImpl() 1213cdf0e10cSrcweir { 1214cdf0e10cSrcweir ::rtl::OUString aValue; 1215cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DATA_SOURCE_NAME,aValue,*this,m_pConnection->getTextEncoding()); 1216cdf0e10cSrcweir return aValue; 1217cdf0e10cSrcweir } 1218cdf0e10cSrcweir // ------------------------------------------------------------------------- 1219cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getURL( ) throw(SQLException, RuntimeException) 1220cdf0e10cSrcweir { 1221cdf0e10cSrcweir ::rtl::OUString aValue = m_pConnection->getURL(); 1222cdf0e10cSrcweir if ( !aValue.getLength() ) 1223cdf0e10cSrcweir { 1224cdf0e10cSrcweir aValue = ::rtl::OUString::createFromAscii("sdbc:odbc:"); 1225cdf0e10cSrcweir aValue += getURLImpl(); 1226cdf0e10cSrcweir } 1227cdf0e10cSrcweir return aValue; 1228cdf0e10cSrcweir } 1229cdf0e10cSrcweir // ------------------------------------------------------------------------- 1230cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getUserName( ) throw(SQLException, RuntimeException) 1231cdf0e10cSrcweir { 1232cdf0e10cSrcweir ::rtl::OUString aValue; 1233cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_USER_NAME,aValue,*this,m_pConnection->getTextEncoding()); 1234cdf0e10cSrcweir return aValue; 1235cdf0e10cSrcweir } 1236cdf0e10cSrcweir // ------------------------------------------------------------------------- 1237cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getDriverName( ) throw(SQLException, RuntimeException) 1238cdf0e10cSrcweir { 1239cdf0e10cSrcweir ::rtl::OUString aValue; 1240cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_NAME,aValue,*this,m_pConnection->getTextEncoding()); 1241cdf0e10cSrcweir return aValue; 1242cdf0e10cSrcweir } 1243cdf0e10cSrcweir // ------------------------------------------------------------------------- 1244cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getDriverVersion() throw(SQLException, RuntimeException) 1245cdf0e10cSrcweir { 1246cdf0e10cSrcweir ::rtl::OUString aValue; 1247cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_ODBC_VER,aValue,*this,m_pConnection->getTextEncoding()); 1248cdf0e10cSrcweir return aValue; 1249cdf0e10cSrcweir } 1250cdf0e10cSrcweir // ------------------------------------------------------------------------- 1251cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getDatabaseProductVersion( ) throw(SQLException, RuntimeException) 1252cdf0e10cSrcweir { 1253cdf0e10cSrcweir ::rtl::OUString aValue; 1254cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_VER,aValue,*this,m_pConnection->getTextEncoding()); 1255cdf0e10cSrcweir return aValue; 1256cdf0e10cSrcweir } 1257cdf0e10cSrcweir // ------------------------------------------------------------------------- 1258cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getDatabaseProductName( ) throw(SQLException, RuntimeException) 1259cdf0e10cSrcweir { 1260cdf0e10cSrcweir ::rtl::OUString aValue; 1261cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DBMS_NAME,aValue,*this,m_pConnection->getTextEncoding()); 1262cdf0e10cSrcweir return aValue; 1263cdf0e10cSrcweir } 1264cdf0e10cSrcweir // ------------------------------------------------------------------------- 1265cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getProcedureTerm( ) throw(SQLException, RuntimeException) 1266cdf0e10cSrcweir { 1267cdf0e10cSrcweir ::rtl::OUString aValue; 1268cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_PROCEDURE_TERM,aValue,*this,m_pConnection->getTextEncoding()); 1269cdf0e10cSrcweir return aValue; 1270cdf0e10cSrcweir } 1271cdf0e10cSrcweir // ------------------------------------------------------------------------- 1272cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getSchemaTerm( ) throw(SQLException, RuntimeException) 1273cdf0e10cSrcweir { 1274cdf0e10cSrcweir ::rtl::OUString aValue; 1275cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_TERM,aValue,*this,m_pConnection->getTextEncoding()); 1276cdf0e10cSrcweir return aValue; 1277cdf0e10cSrcweir } 1278cdf0e10cSrcweir // ------------------------------------------------------------------------- 1279cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMajorVersion( ) throw(RuntimeException) 1280cdf0e10cSrcweir { 1281cdf0e10cSrcweir ::rtl::OUString aValue; 1282cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_VER,aValue,*this,m_pConnection->getTextEncoding()); 1283cdf0e10cSrcweir return aValue.copy(0,aValue.indexOf('.')).toInt32(); 1284cdf0e10cSrcweir } 1285cdf0e10cSrcweir // ------------------------------------------------------------------------- 1286cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getDefaultTransactionIsolation( ) throw(SQLException, RuntimeException) 1287cdf0e10cSrcweir { 1288cdf0e10cSrcweir SQLUINTEGER nValue; 1289cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this); 1290cdf0e10cSrcweir return nValue; 1291cdf0e10cSrcweir } 1292cdf0e10cSrcweir // ------------------------------------------------------------------------- 1293cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeException) 1294cdf0e10cSrcweir { 1295cdf0e10cSrcweir ::rtl::OUString aValue; 1296cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_VER,aValue,*this,m_pConnection->getTextEncoding()); 1297cdf0e10cSrcweir return aValue.copy(0,aValue.lastIndexOf('.')).toInt32(); 1298cdf0e10cSrcweir } 1299cdf0e10cSrcweir // ------------------------------------------------------------------------- 1300cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getSQLKeywords( ) throw(SQLException, RuntimeException) 1301cdf0e10cSrcweir { 1302cdf0e10cSrcweir ::rtl::OUString aValue; 1303cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_KEYWORDS,aValue,*this,m_pConnection->getTextEncoding()); 1304cdf0e10cSrcweir return aValue; 1305cdf0e10cSrcweir } 1306cdf0e10cSrcweir // ------------------------------------------------------------------------- 1307cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getSearchStringEscape( ) throw(SQLException, RuntimeException) 1308cdf0e10cSrcweir { 1309cdf0e10cSrcweir ::rtl::OUString aValue; 1310cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SEARCH_PATTERN_ESCAPE,aValue,*this,m_pConnection->getTextEncoding()); 1311cdf0e10cSrcweir return aValue; 1312cdf0e10cSrcweir } 1313cdf0e10cSrcweir // ------------------------------------------------------------------------- 1314cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getStringFunctions( ) throw(SQLException, RuntimeException) 1315cdf0e10cSrcweir { 1316cdf0e10cSrcweir SQLUINTEGER nValue; 1317cdf0e10cSrcweir ::rtl::OUStringBuffer aValue; 1318cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_STRING_FUNCTIONS,nValue,*this); 1319cdf0e10cSrcweir if(nValue & SQL_FN_STR_ASCII) 1320cdf0e10cSrcweir aValue.appendAscii("ASCII,"); 1321cdf0e10cSrcweir if(nValue & SQL_FN_STR_BIT_LENGTH) 1322cdf0e10cSrcweir aValue.appendAscii("BIT_LENGTH,"); 1323cdf0e10cSrcweir if(nValue & SQL_FN_STR_CHAR) 1324cdf0e10cSrcweir aValue.appendAscii("CHAR,"); 1325cdf0e10cSrcweir if(nValue & SQL_FN_STR_CHAR_LENGTH) 1326cdf0e10cSrcweir aValue.appendAscii("CHAR_LENGTH,"); 1327cdf0e10cSrcweir if(nValue & SQL_FN_STR_CHARACTER_LENGTH) 1328cdf0e10cSrcweir aValue.appendAscii("CHARACTER_LENGTH,"); 1329cdf0e10cSrcweir if(nValue & SQL_FN_STR_CONCAT) 1330cdf0e10cSrcweir aValue.appendAscii("CONCAT,"); 1331cdf0e10cSrcweir if(nValue & SQL_FN_STR_DIFFERENCE) 1332cdf0e10cSrcweir aValue.appendAscii("DIFFERENCE,"); 1333cdf0e10cSrcweir if(nValue & SQL_FN_STR_INSERT) 1334cdf0e10cSrcweir aValue.appendAscii("INSERT,"); 1335cdf0e10cSrcweir if(nValue & SQL_FN_STR_LCASE) 1336cdf0e10cSrcweir aValue.appendAscii("LCASE,"); 1337cdf0e10cSrcweir if(nValue & SQL_FN_STR_LEFT) 1338cdf0e10cSrcweir aValue.appendAscii("LEFT,"); 1339cdf0e10cSrcweir if(nValue & SQL_FN_STR_LENGTH) 1340cdf0e10cSrcweir aValue.appendAscii("LENGTH,"); 1341cdf0e10cSrcweir if(nValue & SQL_FN_STR_LOCATE) 1342cdf0e10cSrcweir aValue.appendAscii("LOCATE,"); 1343cdf0e10cSrcweir if(nValue & SQL_FN_STR_LOCATE_2) 1344cdf0e10cSrcweir aValue.appendAscii("LOCATE_2,"); 1345cdf0e10cSrcweir if(nValue & SQL_FN_STR_LTRIM) 1346cdf0e10cSrcweir aValue.appendAscii("LTRIM,"); 1347cdf0e10cSrcweir if(nValue & SQL_FN_STR_OCTET_LENGTH) 1348cdf0e10cSrcweir aValue.appendAscii("OCTET_LENGTH,"); 1349cdf0e10cSrcweir if(nValue & SQL_FN_STR_POSITION) 1350cdf0e10cSrcweir aValue.appendAscii("POSITION,"); 1351cdf0e10cSrcweir if(nValue & SQL_FN_STR_REPEAT) 1352cdf0e10cSrcweir aValue.appendAscii("REPEAT,"); 1353cdf0e10cSrcweir if(nValue & SQL_FN_STR_REPLACE) 1354cdf0e10cSrcweir aValue.appendAscii("REPLACE,"); 1355cdf0e10cSrcweir if(nValue & SQL_FN_STR_RIGHT) 1356cdf0e10cSrcweir aValue.appendAscii("RIGHT,"); 1357cdf0e10cSrcweir if(nValue & SQL_FN_STR_RTRIM) 1358cdf0e10cSrcweir aValue.appendAscii("RTRIM,"); 1359cdf0e10cSrcweir if(nValue & SQL_FN_STR_SOUNDEX) 1360cdf0e10cSrcweir aValue.appendAscii("SOUNDEX,"); 1361cdf0e10cSrcweir if(nValue & SQL_FN_STR_SPACE) 1362cdf0e10cSrcweir aValue.appendAscii("SPACE,"); 1363cdf0e10cSrcweir if(nValue & SQL_FN_STR_SUBSTRING) 1364cdf0e10cSrcweir aValue.appendAscii("SUBSTRING,"); 1365cdf0e10cSrcweir if(nValue & SQL_FN_STR_UCASE) 1366cdf0e10cSrcweir aValue.appendAscii("UCASE,"); 1367cdf0e10cSrcweir 1368cdf0e10cSrcweir 1369cdf0e10cSrcweir if ( aValue.getLength() ) 1370cdf0e10cSrcweir aValue.setLength(aValue.getLength()-1); 1371cdf0e10cSrcweir 1372cdf0e10cSrcweir return aValue.makeStringAndClear(); 1373cdf0e10cSrcweir } 1374cdf0e10cSrcweir // ------------------------------------------------------------------------- 1375cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getTimeDateFunctions( ) throw(SQLException, RuntimeException) 1376cdf0e10cSrcweir { 1377cdf0e10cSrcweir SQLUINTEGER nValue; 1378cdf0e10cSrcweir ::rtl::OUStringBuffer aValue; 1379cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TIMEDATE_FUNCTIONS,nValue,*this); 1380cdf0e10cSrcweir 1381cdf0e10cSrcweir if(nValue & SQL_FN_TD_CURRENT_DATE) 1382cdf0e10cSrcweir aValue.appendAscii("CURRENT_DATE,"); 1383cdf0e10cSrcweir if(nValue & SQL_FN_TD_CURRENT_TIME) 1384cdf0e10cSrcweir aValue.appendAscii("CURRENT_TIME,"); 1385cdf0e10cSrcweir if(nValue & SQL_FN_TD_CURRENT_TIMESTAMP) 1386cdf0e10cSrcweir aValue.appendAscii("CURRENT_TIMESTAMP,"); 1387cdf0e10cSrcweir if(nValue & SQL_FN_TD_CURDATE) 1388cdf0e10cSrcweir aValue.appendAscii("CURDATE,"); 1389cdf0e10cSrcweir if(nValue & SQL_FN_TD_CURTIME) 1390cdf0e10cSrcweir aValue.appendAscii("CURTIME,"); 1391cdf0e10cSrcweir if(nValue & SQL_FN_TD_DAYNAME) 1392cdf0e10cSrcweir aValue.appendAscii("DAYNAME,"); 1393cdf0e10cSrcweir if(nValue & SQL_FN_TD_DAYOFMONTH) 1394cdf0e10cSrcweir aValue.appendAscii("DAYOFMONTH,"); 1395cdf0e10cSrcweir if(nValue & SQL_FN_TD_DAYOFWEEK) 1396cdf0e10cSrcweir aValue.appendAscii("DAYOFWEEK,"); 1397cdf0e10cSrcweir if(nValue & SQL_FN_TD_DAYOFYEAR) 1398cdf0e10cSrcweir aValue.appendAscii("DAYOFYEAR,"); 1399cdf0e10cSrcweir if(nValue & SQL_FN_TD_EXTRACT) 1400cdf0e10cSrcweir aValue.appendAscii("EXTRACT,"); 1401cdf0e10cSrcweir if(nValue & SQL_FN_TD_HOUR) 1402cdf0e10cSrcweir aValue.appendAscii("HOUR,"); 1403cdf0e10cSrcweir if(nValue & SQL_FN_TD_MINUTE) 1404cdf0e10cSrcweir aValue.appendAscii("MINUTE,"); 1405cdf0e10cSrcweir if(nValue & SQL_FN_TD_MONTH) 1406cdf0e10cSrcweir aValue.appendAscii("MONTH,"); 1407cdf0e10cSrcweir if(nValue & SQL_FN_TD_MONTHNAME) 1408cdf0e10cSrcweir aValue.appendAscii("MONTHNAME,"); 1409cdf0e10cSrcweir if(nValue & SQL_FN_TD_NOW) 1410cdf0e10cSrcweir aValue.appendAscii("NOW,"); 1411cdf0e10cSrcweir if(nValue & SQL_FN_TD_QUARTER) 1412cdf0e10cSrcweir aValue.appendAscii("QUARTER,"); 1413cdf0e10cSrcweir if(nValue & SQL_FN_TD_SECOND) 1414cdf0e10cSrcweir aValue.appendAscii("SECOND,"); 1415cdf0e10cSrcweir if(nValue & SQL_FN_TD_TIMESTAMPADD) 1416cdf0e10cSrcweir aValue.appendAscii("TIMESTAMPADD,"); 1417cdf0e10cSrcweir if(nValue & SQL_FN_TD_TIMESTAMPDIFF) 1418cdf0e10cSrcweir aValue.appendAscii("TIMESTAMPDIFF,"); 1419cdf0e10cSrcweir if(nValue & SQL_FN_TD_WEEK) 1420cdf0e10cSrcweir aValue.appendAscii("WEEK,"); 1421cdf0e10cSrcweir if(nValue & SQL_FN_TD_YEAR) 1422cdf0e10cSrcweir aValue.appendAscii("YEAR,"); 1423cdf0e10cSrcweir 1424cdf0e10cSrcweir if ( aValue.getLength() ) 1425cdf0e10cSrcweir aValue.setLength(aValue.getLength()-1); 1426cdf0e10cSrcweir 1427cdf0e10cSrcweir return aValue.makeStringAndClear(); 1428cdf0e10cSrcweir } 1429cdf0e10cSrcweir // ------------------------------------------------------------------------- 1430cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getSystemFunctions( ) throw(SQLException, RuntimeException) 1431cdf0e10cSrcweir { 1432cdf0e10cSrcweir SQLUINTEGER nValue; 1433cdf0e10cSrcweir ::rtl::OUStringBuffer aValue; 1434cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SYSTEM_FUNCTIONS,nValue,*this); 1435cdf0e10cSrcweir 1436cdf0e10cSrcweir if(nValue & SQL_FN_SYS_DBNAME) 1437cdf0e10cSrcweir aValue.appendAscii("DBNAME,"); 1438cdf0e10cSrcweir if(nValue & SQL_FN_SYS_IFNULL) 1439cdf0e10cSrcweir aValue.appendAscii("IFNULL,"); 1440cdf0e10cSrcweir if(nValue & SQL_FN_SYS_USERNAME) 1441cdf0e10cSrcweir aValue.appendAscii("USERNAME,"); 1442cdf0e10cSrcweir 1443cdf0e10cSrcweir if ( aValue.getLength() ) 1444cdf0e10cSrcweir aValue.setLength(aValue.getLength()-1); 1445cdf0e10cSrcweir 1446cdf0e10cSrcweir return aValue.makeStringAndClear(); 1447cdf0e10cSrcweir } 1448cdf0e10cSrcweir // ------------------------------------------------------------------------- 1449cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getNumericFunctions( ) throw(SQLException, RuntimeException) 1450cdf0e10cSrcweir { 1451cdf0e10cSrcweir SQLUINTEGER nValue; 1452cdf0e10cSrcweir ::rtl::OUStringBuffer aValue; 1453cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NUMERIC_FUNCTIONS,nValue,*this); 1454cdf0e10cSrcweir 1455cdf0e10cSrcweir if(nValue & SQL_FN_NUM_ABS) 1456cdf0e10cSrcweir aValue.appendAscii("ABS,"); 1457cdf0e10cSrcweir if(nValue & SQL_FN_NUM_ACOS) 1458cdf0e10cSrcweir aValue.appendAscii("ACOS,"); 1459cdf0e10cSrcweir if(nValue & SQL_FN_NUM_ASIN) 1460cdf0e10cSrcweir aValue.appendAscii("ASIN,"); 1461cdf0e10cSrcweir if(nValue & SQL_FN_NUM_ATAN) 1462cdf0e10cSrcweir aValue.appendAscii("ATAN,"); 1463cdf0e10cSrcweir if(nValue & SQL_FN_NUM_ATAN2) 1464cdf0e10cSrcweir aValue.appendAscii("ATAN2,"); 1465cdf0e10cSrcweir if(nValue & SQL_FN_NUM_CEILING) 1466cdf0e10cSrcweir aValue.appendAscii("CEILING,"); 1467cdf0e10cSrcweir if(nValue & SQL_FN_NUM_COS) 1468cdf0e10cSrcweir aValue.appendAscii("COS,"); 1469cdf0e10cSrcweir if(nValue & SQL_FN_NUM_COT) 1470cdf0e10cSrcweir aValue.appendAscii("COT,"); 1471cdf0e10cSrcweir if(nValue & SQL_FN_NUM_DEGREES) 1472cdf0e10cSrcweir aValue.appendAscii("DEGREES,"); 1473cdf0e10cSrcweir if(nValue & SQL_FN_NUM_EXP) 1474cdf0e10cSrcweir aValue.appendAscii("EXP,"); 1475cdf0e10cSrcweir if(nValue & SQL_FN_NUM_FLOOR) 1476cdf0e10cSrcweir aValue.appendAscii("FLOOR,"); 1477cdf0e10cSrcweir if(nValue & SQL_FN_NUM_LOG) 1478cdf0e10cSrcweir aValue.appendAscii("LOGF,"); 1479cdf0e10cSrcweir if(nValue & SQL_FN_NUM_LOG10) 1480cdf0e10cSrcweir aValue.appendAscii("LOG10,"); 1481cdf0e10cSrcweir if(nValue & SQL_FN_NUM_MOD) 1482cdf0e10cSrcweir aValue.appendAscii("MOD,"); 1483cdf0e10cSrcweir if(nValue & SQL_FN_NUM_PI) 1484cdf0e10cSrcweir aValue.appendAscii("PI,"); 1485cdf0e10cSrcweir if(nValue & SQL_FN_NUM_POWER) 1486cdf0e10cSrcweir aValue.appendAscii("POWER,"); 1487cdf0e10cSrcweir if(nValue & SQL_FN_NUM_RADIANS) 1488cdf0e10cSrcweir aValue.appendAscii("RADIANS,"); 1489cdf0e10cSrcweir if(nValue & SQL_FN_NUM_RAND) 1490cdf0e10cSrcweir aValue.appendAscii("RAND,"); 1491cdf0e10cSrcweir if(nValue & SQL_FN_NUM_ROUND) 1492cdf0e10cSrcweir aValue.appendAscii("ROUND,"); 1493cdf0e10cSrcweir if(nValue & SQL_FN_NUM_SIGN) 1494cdf0e10cSrcweir aValue.appendAscii("SIGN,"); 1495cdf0e10cSrcweir if(nValue & SQL_FN_NUM_SIN) 1496cdf0e10cSrcweir aValue.appendAscii("SIN,"); 1497cdf0e10cSrcweir if(nValue & SQL_FN_NUM_SQRT) 1498cdf0e10cSrcweir aValue.appendAscii("SQRT,"); 1499cdf0e10cSrcweir if(nValue & SQL_FN_NUM_TAN) 1500cdf0e10cSrcweir aValue.appendAscii("TAN,"); 1501cdf0e10cSrcweir if(nValue & SQL_FN_NUM_TRUNCATE) 1502cdf0e10cSrcweir aValue.appendAscii("TRUNCATE,"); 1503cdf0e10cSrcweir 1504cdf0e10cSrcweir if ( aValue.getLength() ) 1505cdf0e10cSrcweir aValue.setLength(aValue.getLength()-1); 1506cdf0e10cSrcweir 1507cdf0e10cSrcweir return aValue.makeStringAndClear(); 1508cdf0e10cSrcweir } 1509cdf0e10cSrcweir // ------------------------------------------------------------------------- 1510cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsExtendedSQLGrammar( ) throw(SQLException, RuntimeException) 1511cdf0e10cSrcweir { 1512cdf0e10cSrcweir SQLUINTEGER nValue; 1513cdf0e10cSrcweir if(m_bOdbc3) 1514cdf0e10cSrcweir { 1515cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ODBC_INTERFACE_CONFORMANCE,nValue,*this); 1516cdf0e10cSrcweir return nValue == SQL_OIC_LEVEL2; 1517cdf0e10cSrcweir } 1518cdf0e10cSrcweir else 1519cdf0e10cSrcweir { 1520cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ODBC_INTERFACE_CONFORMANCE,nValue,*this); 1521cdf0e10cSrcweir return nValue == SQL_OAC_LEVEL2; 1522cdf0e10cSrcweir } 1523cdf0e10cSrcweir } 1524cdf0e10cSrcweir // ------------------------------------------------------------------------- 1525cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsCoreSQLGrammar( ) throw(SQLException, RuntimeException) 1526cdf0e10cSrcweir { 1527cdf0e10cSrcweir SQLUINTEGER nValue; 1528cdf0e10cSrcweir if(m_bOdbc3) 1529cdf0e10cSrcweir { 1530cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ODBC_INTERFACE_CONFORMANCE,nValue,*this); 1531cdf0e10cSrcweir return nValue == SQL_OIC_CORE || nValue == SQL_OIC_LEVEL2 || nValue == SQL_OIC_LEVEL1; 1532cdf0e10cSrcweir } 1533cdf0e10cSrcweir else 1534cdf0e10cSrcweir { 1535cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ODBC_SQL_CONFORMANCE,nValue,*this); 1536cdf0e10cSrcweir return nValue == SQL_OSC_CORE || nValue == SQL_OAC_LEVEL1 || nValue == SQL_OAC_LEVEL2; 1537cdf0e10cSrcweir } 1538cdf0e10cSrcweir } 1539cdf0e10cSrcweir // ------------------------------------------------------------------------- 1540cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsMinimumSQLGrammar( ) throw(SQLException, RuntimeException) 1541cdf0e10cSrcweir { 1542cdf0e10cSrcweir SQLUINTEGER nValue; 1543cdf0e10cSrcweir if(m_bOdbc3) 1544cdf0e10cSrcweir { 1545cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ODBC_INTERFACE_CONFORMANCE,nValue,*this); 1546cdf0e10cSrcweir return nValue == SQL_OIC_LEVEL1 || nValue == SQL_OIC_LEVEL2; 1547cdf0e10cSrcweir } 1548cdf0e10cSrcweir else 1549cdf0e10cSrcweir { 1550cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ODBC_INTERFACE_CONFORMANCE,nValue,*this); 1551cdf0e10cSrcweir return nValue == SQL_OAC_LEVEL1 || nValue == SQL_OAC_LEVEL2; 1552cdf0e10cSrcweir } 1553cdf0e10cSrcweir } 1554cdf0e10cSrcweir // ------------------------------------------------------------------------- 1555cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsFullOuterJoins( ) throw(SQLException, RuntimeException) 1556cdf0e10cSrcweir { 1557cdf0e10cSrcweir SQLUINTEGER nValue; 1558cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_OJ_CAPABILITIES,nValue,*this); 1559cdf0e10cSrcweir return (nValue & SQL_OJ_FULL) == SQL_OJ_FULL; 1560cdf0e10cSrcweir } 1561cdf0e10cSrcweir // ------------------------------------------------------------------------- 1562cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsLimitedOuterJoins( ) throw(SQLException, RuntimeException) 1563cdf0e10cSrcweir { 1564cdf0e10cSrcweir return supportsFullOuterJoins( ); 1565cdf0e10cSrcweir } 1566cdf0e10cSrcweir // ------------------------------------------------------------------------- 1567cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInGroupBy( ) throw(SQLException, RuntimeException) 1568cdf0e10cSrcweir { 1569cdf0e10cSrcweir SQLUSMALLINT nValue; 1570cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMNS_IN_GROUP_BY,nValue,*this); 1571cdf0e10cSrcweir return nValue; 1572cdf0e10cSrcweir } 1573cdf0e10cSrcweir // ------------------------------------------------------------------------- 1574cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInOrderBy( ) throw(SQLException, RuntimeException) 1575cdf0e10cSrcweir { 1576cdf0e10cSrcweir SQLUSMALLINT nValue; 1577cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMNS_IN_ORDER_BY,nValue,*this); 1578cdf0e10cSrcweir return nValue; 1579cdf0e10cSrcweir } 1580cdf0e10cSrcweir // ------------------------------------------------------------------------- 1581cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInSelect( ) throw(SQLException, RuntimeException) 1582cdf0e10cSrcweir { 1583cdf0e10cSrcweir SQLUSMALLINT nValue; 1584cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMNS_IN_SELECT,nValue,*this); 1585cdf0e10cSrcweir return nValue; 1586cdf0e10cSrcweir } 1587cdf0e10cSrcweir // ------------------------------------------------------------------------- 1588cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxUserNameLength( ) throw(SQLException, RuntimeException) 1589cdf0e10cSrcweir { 1590cdf0e10cSrcweir SQLUSMALLINT nValue; 1591cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_USER_NAME_LEN,nValue,*this); 1592cdf0e10cSrcweir return nValue; 1593cdf0e10cSrcweir } 1594cdf0e10cSrcweir // ------------------------------------------------------------------------- 1595cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetType( sal_Int32 setType ) throw(SQLException, RuntimeException) 1596cdf0e10cSrcweir { 1597cdf0e10cSrcweir SQLUINTEGER nValue; 1598cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CURSOR_SENSITIVITY,nValue,*this); 1599cdf0e10cSrcweir return (nValue & static_cast<SQLUINTEGER>(setType)) == static_cast<SQLUINTEGER>(setType); 1600cdf0e10cSrcweir } 1601cdf0e10cSrcweir // ------------------------------------------------------------------------- 1602cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 concurrency ) throw(SQLException, RuntimeException) 1603cdf0e10cSrcweir { 1604cdf0e10cSrcweir SQLUINTEGER nValue; 1605cdf0e10cSrcweir SQLUSMALLINT nAskFor( SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 ); 1606cdf0e10cSrcweir switch(setType) 1607cdf0e10cSrcweir { 1608cdf0e10cSrcweir default: 1609cdf0e10cSrcweir case ResultSetType::FORWARD_ONLY: 1610cdf0e10cSrcweir nAskFor = SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2; 1611cdf0e10cSrcweir break; 1612cdf0e10cSrcweir case ResultSetType::SCROLL_INSENSITIVE: 1613cdf0e10cSrcweir nAskFor = SQL_STATIC_CURSOR_ATTRIBUTES2; 1614cdf0e10cSrcweir break; 1615cdf0e10cSrcweir case ResultSetType::SCROLL_SENSITIVE: 1616cdf0e10cSrcweir nAskFor = SQL_DYNAMIC_CURSOR_ATTRIBUTES2; 1617cdf0e10cSrcweir break; 1618cdf0e10cSrcweir } 1619cdf0e10cSrcweir 1620cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,nAskFor,nValue,*this); 1621cdf0e10cSrcweir sal_Bool bRet = sal_False; 1622cdf0e10cSrcweir switch(concurrency) 1623cdf0e10cSrcweir { 1624cdf0e10cSrcweir case ResultSetConcurrency::READ_ONLY: 1625cdf0e10cSrcweir bRet = (nValue & SQL_CA2_READ_ONLY_CONCURRENCY) == SQL_CA2_READ_ONLY_CONCURRENCY; 1626cdf0e10cSrcweir break; 1627cdf0e10cSrcweir case ResultSetConcurrency::UPDATABLE: 1628cdf0e10cSrcweir bRet = (nValue & SQL_CA2_OPT_VALUES_CONCURRENCY) == SQL_CA2_OPT_VALUES_CONCURRENCY; 1629cdf0e10cSrcweir break; 1630cdf0e10cSrcweir } 1631cdf0e10cSrcweir return bRet; 1632cdf0e10cSrcweir } 1633cdf0e10cSrcweir // ------------------------------------------------------------------------- 1634cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::ownUpdatesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException) 1635cdf0e10cSrcweir { 1636cdf0e10cSrcweir SQLUINTEGER nValue; 1637cdf0e10cSrcweir SQLUSMALLINT nAskFor( SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 ); 1638cdf0e10cSrcweir switch(setType) 1639cdf0e10cSrcweir { 1640cdf0e10cSrcweir default: 1641cdf0e10cSrcweir case ResultSetType::FORWARD_ONLY: 1642cdf0e10cSrcweir nAskFor = SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2; 1643cdf0e10cSrcweir break; 1644cdf0e10cSrcweir case ResultSetType::SCROLL_INSENSITIVE: 1645cdf0e10cSrcweir nAskFor = SQL_STATIC_CURSOR_ATTRIBUTES2; 1646cdf0e10cSrcweir break; 1647cdf0e10cSrcweir case ResultSetType::SCROLL_SENSITIVE: 1648cdf0e10cSrcweir nAskFor = SQL_DYNAMIC_CURSOR_ATTRIBUTES2; 1649cdf0e10cSrcweir break; 1650cdf0e10cSrcweir } 1651cdf0e10cSrcweir 1652cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,nAskFor,nValue,*this); 1653cdf0e10cSrcweir return (nValue & SQL_CA2_SENSITIVITY_UPDATES) == SQL_CA2_SENSITIVITY_UPDATES; 1654cdf0e10cSrcweir } 1655cdf0e10cSrcweir // ------------------------------------------------------------------------- 1656cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::ownDeletesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException) 1657cdf0e10cSrcweir { 1658cdf0e10cSrcweir SQLUINTEGER nValue; 1659cdf0e10cSrcweir SQLUSMALLINT nAskFor( SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 ); 1660cdf0e10cSrcweir switch(setType) 1661cdf0e10cSrcweir { 1662cdf0e10cSrcweir default: 1663cdf0e10cSrcweir case ResultSetType::FORWARD_ONLY: 1664cdf0e10cSrcweir nAskFor = SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2; 1665cdf0e10cSrcweir break; 1666cdf0e10cSrcweir case ResultSetType::SCROLL_INSENSITIVE: 1667cdf0e10cSrcweir nAskFor = SQL_STATIC_CURSOR_ATTRIBUTES2; 1668cdf0e10cSrcweir break; 1669cdf0e10cSrcweir case ResultSetType::SCROLL_SENSITIVE: 1670cdf0e10cSrcweir nAskFor = SQL_DYNAMIC_CURSOR_ATTRIBUTES2; 1671cdf0e10cSrcweir break; 1672cdf0e10cSrcweir } 1673cdf0e10cSrcweir 1674cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,nAskFor,nValue,*this); 1675cdf0e10cSrcweir return (nValue & SQL_CA2_SENSITIVITY_DELETIONS) != SQL_CA2_SENSITIVITY_DELETIONS; 1676cdf0e10cSrcweir } 1677cdf0e10cSrcweir // ------------------------------------------------------------------------- 1678cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::ownInsertsAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException) 1679cdf0e10cSrcweir { 1680cdf0e10cSrcweir SQLUINTEGER nValue; 1681cdf0e10cSrcweir SQLUSMALLINT nAskFor( SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 ); 1682cdf0e10cSrcweir switch(setType) 1683cdf0e10cSrcweir { 1684cdf0e10cSrcweir default: 1685cdf0e10cSrcweir case ResultSetType::FORWARD_ONLY: 1686cdf0e10cSrcweir nAskFor = SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2; 1687cdf0e10cSrcweir break; 1688cdf0e10cSrcweir case ResultSetType::SCROLL_INSENSITIVE: 1689cdf0e10cSrcweir nAskFor = SQL_STATIC_CURSOR_ATTRIBUTES2; 1690cdf0e10cSrcweir break; 1691cdf0e10cSrcweir case ResultSetType::SCROLL_SENSITIVE: 1692cdf0e10cSrcweir nAskFor = SQL_DYNAMIC_CURSOR_ATTRIBUTES2; 1693cdf0e10cSrcweir break; 1694cdf0e10cSrcweir } 1695cdf0e10cSrcweir 1696cdf0e10cSrcweir OTools::GetInfo(m_pConnection,m_aConnectionHandle,nAskFor,nValue,*this); 1697cdf0e10cSrcweir return (nValue & SQL_CA2_SENSITIVITY_ADDITIONS) == SQL_CA2_SENSITIVITY_ADDITIONS; 1698cdf0e10cSrcweir } 1699cdf0e10cSrcweir // ------------------------------------------------------------------------- 1700cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::othersUpdatesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException) 1701cdf0e10cSrcweir { 1702cdf0e10cSrcweir return ownUpdatesAreVisible(setType); 1703cdf0e10cSrcweir } 1704cdf0e10cSrcweir // ------------------------------------------------------------------------- 1705cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::othersDeletesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException) 1706cdf0e10cSrcweir { 1707cdf0e10cSrcweir return ownDeletesAreVisible(setType); 1708cdf0e10cSrcweir } 1709cdf0e10cSrcweir // ------------------------------------------------------------------------- 1710cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::othersInsertsAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException) 1711cdf0e10cSrcweir { 1712cdf0e10cSrcweir return ownInsertsAreVisible(setType); 1713cdf0e10cSrcweir } 1714cdf0e10cSrcweir // ------------------------------------------------------------------------- 1715cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::updatesAreDetected( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException) 1716cdf0e10cSrcweir { 1717cdf0e10cSrcweir return sal_False; 1718cdf0e10cSrcweir } 1719cdf0e10cSrcweir // ------------------------------------------------------------------------- 1720cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::deletesAreDetected( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException) 1721cdf0e10cSrcweir { 1722cdf0e10cSrcweir return sal_False; 1723cdf0e10cSrcweir } 1724cdf0e10cSrcweir // ------------------------------------------------------------------------- 1725cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::insertsAreDetected( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException) 1726cdf0e10cSrcweir { 1727cdf0e10cSrcweir return sal_False; 1728cdf0e10cSrcweir } 1729cdf0e10cSrcweir // ------------------------------------------------------------------------- 1730cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsBatchUpdates( ) throw(SQLException, RuntimeException) 1731cdf0e10cSrcweir { 1732cdf0e10cSrcweir return sal_False; 1733cdf0e10cSrcweir } 1734cdf0e10cSrcweir // ------------------------------------------------------------------------- 1735cdf0e10cSrcweir 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) 1736cdf0e10cSrcweir { 1737cdf0e10cSrcweir return NULL; 1738cdf0e10cSrcweir } 1739cdf0e10cSrcweir // ----------------------------------------------------------------------------- 1740