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