build fix
[LibreOffice.git] / connectivity / source / drivers / file / FDatabaseMetaData.cxx
blob65f492392bfc85eacbfc2f4f43ebab93157cb221
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "file/FDatabaseMetaData.hxx"
21 #include "FDatabaseMetaDataResultSet.hxx"
22 #include <com/sun/star/sdbc/DataType.hpp>
23 #include <com/sun/star/sdbc/ResultSetType.hpp>
24 #include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
25 #include <com/sun/star/ucb/SearchRecursion.hpp>
26 #include <com/sun/star/ucb/SearchCommandArgument.hpp>
27 #include <com/sun/star/ucb/UniversalContentBroker.hpp>
28 #include <com/sun/star/ucb/SortedDynamicResultSetFactory.hpp>
29 #include <com/sun/star/lang/XUnoTunnel.hpp>
30 #include <tools/urlobj.hxx>
31 #include "file/FDriver.hxx"
32 #include "file/FTable.hxx"
33 #include <comphelper/processfactory.hxx>
34 #include <ucbhelper/content.hxx>
36 using namespace com::sun::star::ucb;
37 using namespace connectivity::file;
38 using namespace connectivity;
39 using namespace com::sun::star::uno;
40 using namespace com::sun::star::lang;
41 using namespace com::sun::star::beans;
42 using namespace com::sun::star::sdbc;
43 using namespace com::sun::star::sdbcx;
44 using namespace com::sun::star::container;
46 ODatabaseMetaData::ODatabaseMetaData(OConnection* _pCon) : ::connectivity::ODatabaseMetaDataBase(_pCon,_pCon->getConnectionInfo())
47 ,m_pConnection(_pCon)
51 ODatabaseMetaData::~ODatabaseMetaData()
55 Reference< XResultSet > ODatabaseMetaData::impl_getTypeInfo_throw( )
57 return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eTypeInfo );
60 OUString ODatabaseMetaData::impl_getCatalogSeparator_throw( )
62 return OUString();
65 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns(
66 const Any& /*catalog*/, const OUString& /*schemaPattern*/, const OUString& /*tableNamePattern*/,
67 const OUString& /*columnNamePattern*/ ) throw(SQLException, RuntimeException, std::exception)
69 SAL_WARN("connectivity.drivers", "ODatabaseMetaData::getColumns() should be overridden!");
70 return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eColumns );
74 namespace
76 sal_Int16 isCaseSensitiveParentFolder( const OUString& _rFolderOrDoc, const OUString& _rDocName )
78 sal_Int16 nIsCS = 1;
79 try
81 // first get the real content for the URL
82 INetURLObject aContentURL( _rFolderOrDoc );
83 ::ucbhelper::Content aContent1;
85 ::ucbhelper::Content aFolderOrDoc( _rFolderOrDoc, Reference< XCommandEnvironment >(), comphelper::getProcessComponentContext() );
86 if ( aFolderOrDoc.isDocument() )
87 aContent1 = aFolderOrDoc;
88 else
90 aContentURL = INetURLObject( _rFolderOrDoc, INetURLObject::EncodeMechanism::WasEncoded );
91 aContentURL.Append( _rDocName );
92 aContent1 = ::ucbhelper::Content( aContentURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), Reference< XCommandEnvironment >(), comphelper::getProcessComponentContext() );
96 // get two extensions which differ by case only
97 OUString sExtension1(aContentURL.getExtension());
98 OUString sExtension2(sExtension1.toAsciiLowerCase());
99 if (sExtension2 == sExtension1)
101 // the extension was already in lower case
102 sExtension2 = sExtension2.toAsciiUpperCase();
105 // the complete URL for the second extension
106 INetURLObject aURL2( aContentURL );
107 if (!sExtension2.isEmpty())
108 aURL2.SetExtension( sExtension2 );
109 if ( aURL2.GetMainURL(INetURLObject::DecodeMechanism::NONE) == aContentURL.GetMainURL(INetURLObject::DecodeMechanism::NONE) )
110 return -1;
112 // the second context
113 bool bCanAccess = false;
114 ::ucbhelper::Content aContent2;
117 aContent2 = ::ucbhelper::Content( aURL2.GetMainURL( INetURLObject::DecodeMechanism::NONE ), Reference< XCommandEnvironment >(), comphelper::getProcessComponentContext() );
118 bCanAccess = aContent2.isDocument();
120 catch( const Exception& )
124 if ( bCanAccess )
126 // here we have two contents whose URLs differ by case only.
127 // Now let's check if both really refer to the same object ....
128 Reference< XContent > xContent1 = aContent1.get();
129 Reference< XContent > xContent2 = aContent2.get();
130 OSL_ENSURE( xContent1.is() && xContent2.is(), "isCaseSensitiveParentFolder: invalid content interfaces!" );
131 if ( xContent1.is() && xContent2.is() )
133 Reference< XContentIdentifier > xID1 = xContent1->getIdentifier();
134 Reference< XContentIdentifier > xID2 = xContent2->getIdentifier();
135 OSL_ENSURE( xID1.is() && xID2.is(), "isCaseSensitiveParentFolder: invalid ID interfaces!" );
136 if ( xID1.is() && xID2.is()
137 && ( UniversalContentBroker::create(
138 comphelper::getProcessComponentContext() )->
139 compareContentIds( xID1, xID2 ) == 0 ) )
141 // finally, we know that the folder is not case-sensitive ....
142 nIsCS = 0;
147 catch( const Exception& )
149 SAL_WARN( "connectivity.drivers", "isCaseSensitiveParentFolder: caught an unexpected exception!" );
152 return nIsCS;
157 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
158 const Any& /*catalog*/, const OUString& /*schemaPattern*/,
159 const OUString& tableNamePattern, const Sequence< OUString >& types ) throw(SQLException, RuntimeException, std::exception)
161 ::osl::MutexGuard aGuard( m_aMutex );
164 ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eTables );
165 Reference< XResultSet > xRef = pResult;
167 // check if any type is given
168 // when no types are given then we have to return all tables e.g. TABLE
170 static const char aTable[] = "TABLE";
172 bool bTableFound = true;
173 sal_Int32 nLength = types.getLength();
174 if(nLength)
176 bTableFound = false;
178 const OUString* pBegin = types.getConstArray();
179 const OUString* pEnd = pBegin + nLength;
180 for(;pBegin != pEnd;++pBegin)
182 if(*pBegin == aTable)
184 bTableFound = true;
185 break;
189 if(!bTableFound)
190 return xRef;
192 Reference<XDynamicResultSet> xContent = m_pConnection->getDir();
193 Reference < XSortedDynamicResultSetFactory > xSRSFac =
194 SortedDynamicResultSetFactory::create( m_pConnection->getDriver()->getComponentContext() );
196 Sequence< NumberedSortingInfo > aSortInfo( 1 );
197 NumberedSortingInfo* pInfo = aSortInfo.getArray();
198 pInfo[ 0 ].ColumnIndex = 1;
199 pInfo[ 0 ].Ascending = true;
201 Reference < XAnyCompareFactory > xFactory;
202 Reference< XDynamicResultSet > xDynamicResultSet;
203 xDynamicResultSet = xSRSFac->createSortedDynamicResultSet( xContent, aSortInfo, xFactory );
204 Reference<XResultSet> xResultSet = xDynamicResultSet->getStaticResultSet();
206 Reference<XRow> xRow(xResultSet,UNO_QUERY);
208 OUString aFilenameExtension = m_pConnection->getExtension();
209 OUString sThisContentExtension;
210 ODatabaseMetaDataResultSet::ORows aRows;
211 // scan the directory for tables
212 OUString aName;
213 INetURLObject aURL;
214 xResultSet->beforeFirst();
216 bool bKnowCaseSensivity = false;
217 bool bCaseSensitiveDir = true;
218 bool bCheckEnabled = m_pConnection->isCheckEnabled();
220 while(xResultSet->next())
222 aName = xRow->getString(1);
223 aURL.SetSmartProtocol(INetProtocol::File);
224 OUString sUrl = m_pConnection->getURL() + "/" + aName;
225 aURL.SetSmartURL( sUrl );
226 sThisContentExtension = aURL.getExtension();
228 ODatabaseMetaDataResultSet::ORow aRow { nullptr, nullptr, nullptr };
229 aRow.reserve(6);
230 bool bNewRow = false;
232 if ( !bKnowCaseSensivity )
234 bKnowCaseSensivity = true;
235 sal_Int16 nCase = isCaseSensitiveParentFolder( m_pConnection->getURL(), aURL.getName() );
236 switch( nCase )
238 case 1:
239 bCaseSensitiveDir = true;
240 break;
241 case -1:
242 bKnowCaseSensivity = false;
243 SAL_FALLTHROUGH;
244 case 0:
245 bCaseSensitiveDir = false;
247 if ( bKnowCaseSensivity )
249 m_pConnection->setCaseSensitiveExtension( bCaseSensitiveDir, OConnection::GrantAccess() );
250 if ( !bCaseSensitiveDir )
252 aFilenameExtension = aFilenameExtension.toAsciiLowerCase();
257 if (!aFilenameExtension.isEmpty())
259 if ( !bCaseSensitiveDir )
261 sThisContentExtension = sThisContentExtension.toAsciiLowerCase();
264 if ( sThisContentExtension == aFilenameExtension )
266 aName = aName.copy(0, (aName.getLength()-(aFilenameExtension.getLength()+1)));
267 sal_Unicode nChar = aName.toChar();
268 if ( match(tableNamePattern,aName,'\0') && ( !bCheckEnabled || (nChar < '0' || nChar > '9')) )
270 aRow.push_back(new ORowSetValueDecorator(aName));
271 bNewRow = true;
275 else // no extension, filter myself
277 bool bErg = false;
280 if (aURL.getExtension().isEmpty())
282 sal_Unicode nChar = aURL.getBase()[0];
283 if( match(tableNamePattern,aURL.getBase(),'\0') && ( !bCheckEnabled || nChar < '0' || nChar > '9' ) )
285 aRow.push_back(new ORowSetValueDecorator(OUString(aURL.getBase())));
286 bNewRow = true;
288 break;
290 else if ( ( bErg = xResultSet->next() ) )
292 aName = xRow->getString(1);
293 aURL.SetSmartURL(aName);
295 } while (bErg);
297 if(bNewRow)
299 aRow.push_back(new ORowSetValueDecorator(OUString(aTable)));
300 aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
302 aRows.push_back(aRow);
306 pResult->setRows(aRows);
308 return xRef;
311 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxBinaryLiteralLength( ) throw(SQLException, RuntimeException, std::exception)
313 return 0;
316 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxRowSize( ) throw(SQLException, RuntimeException, std::exception)
318 return 0;
321 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCatalogNameLength( ) throw(SQLException, RuntimeException, std::exception)
323 return 0;
326 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCharLiteralLength( ) throw(SQLException, RuntimeException, std::exception)
328 return SAL_MAX_INT32;
331 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnNameLength( ) throw(SQLException, RuntimeException, std::exception)
333 return 0;
336 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInIndex( ) throw(SQLException, RuntimeException, std::exception)
338 return 0;
341 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCursorNameLength( ) throw(SQLException, RuntimeException, std::exception)
343 return 0;
346 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxConnections( ) throw(SQLException, RuntimeException, std::exception)
348 return 0;
351 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInTable( ) throw(SQLException, RuntimeException, std::exception)
353 return 0;
356 sal_Int32 ODatabaseMetaData::impl_getMaxStatements_throw( )
358 return 0;
361 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxTableNameLength( ) throw(SQLException, RuntimeException, std::exception)
363 return 0;
366 sal_Int32 ODatabaseMetaData::impl_getMaxTablesInSelect_throw( )
368 return 1;
371 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges(
372 const Any& /*catalog*/, const OUString& /*schemaPattern*/, const OUString& tableNamePattern ) throw(SQLException, RuntimeException, std::exception)
374 ::osl::MutexGuard aGuard( m_aMutex );
376 ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eTablePrivileges );
377 Reference< XResultSet > xRef = pResult;
378 ODatabaseMetaDataResultSet::ORows aRows;
381 Reference< XTablesSupplier > xTabSup = m_pConnection->createCatalog();
382 if( xTabSup.is())
384 Reference< XNameAccess> xNames = xTabSup->getTables();
385 Sequence< OUString > aNames = xNames->getElementNames();
386 const OUString* pBegin = aNames.getConstArray();
387 const OUString* pEnd = pBegin + aNames.getLength();
388 for(;pBegin != pEnd;++pBegin)
390 if(match(tableNamePattern,*pBegin,'\0'))
392 static ODatabaseMetaDataResultSet::ORow aRow(8);
394 aRow[2] = new ORowSetValueDecorator(*pBegin);
395 aRow[6] = ODatabaseMetaDataResultSet::getSelectValue();
396 aRow[7] = new ORowSetValueDecorator(OUString("NO"));
397 aRows.push_back(aRow);
399 Reference< XPropertySet> xTable(
400 xNames->getByName(*pBegin), css::uno::UNO_QUERY);
401 if(xTable.is())
403 Reference<XUnoTunnel> xTunnel(xTable,UNO_QUERY);
404 if(xTunnel.is())
406 OFileTable* pTable = reinterpret_cast< OFileTable* >( xTunnel->getSomething(OFileTable::getUnoTunnelImplementationId()) );
407 if(pTable)
409 if(!pTable->isReadOnly())
411 aRow[6] = ODatabaseMetaDataResultSet::getInsertValue();
412 aRows.push_back(aRow);
413 if(!m_pConnection->showDeleted())
415 aRow[6] = ODatabaseMetaDataResultSet::getDeleteValue();
416 aRows.push_back(aRow);
418 aRow[6] = ODatabaseMetaDataResultSet::getUpdateValue();
419 aRows.push_back(aRow);
420 aRow[6] = ODatabaseMetaDataResultSet::getCreateValue();
421 aRows.push_back(aRow);
422 aRow[6] = ODatabaseMetaDataResultSet::getReadValue();
423 aRows.push_back(aRow);
424 aRow[6] = ODatabaseMetaDataResultSet::getAlterValue();
425 aRows.push_back(aRow);
426 aRow[6] = ODatabaseMetaDataResultSet::getDropValue();
427 aRows.push_back(aRow);
436 pResult->setRows(aRows);
437 return xRef;
440 sal_Bool SAL_CALL ODatabaseMetaData::doesMaxRowSizeIncludeBlobs( ) throw(SQLException, RuntimeException, std::exception)
442 return true;
445 sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException, std::exception)
447 return false;
450 sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseIdentifiers( ) throw(SQLException, RuntimeException, std::exception)
452 return false;
455 bool ODatabaseMetaData::impl_storesMixedCaseQuotedIdentifiers_throw( )
457 return false;
460 sal_Bool SAL_CALL ODatabaseMetaData::storesMixedCaseIdentifiers( ) throw(SQLException, RuntimeException, std::exception)
462 return false;
465 sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException, std::exception)
467 return false;
470 sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseIdentifiers( ) throw(SQLException, RuntimeException, std::exception)
472 return false;
475 bool ODatabaseMetaData::impl_supportsAlterTableWithAddColumn_throw( )
477 return false;
480 bool ODatabaseMetaData::impl_supportsAlterTableWithDropColumn_throw( )
482 return false;
485 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxIndexLength( ) throw(SQLException, RuntimeException, std::exception)
487 return 0;
490 sal_Bool SAL_CALL ODatabaseMetaData::supportsNonNullableColumns( ) throw(SQLException, RuntimeException, std::exception)
492 return false;
495 OUString SAL_CALL ODatabaseMetaData::getCatalogTerm( ) throw(SQLException, RuntimeException, std::exception)
497 return OUString();
500 OUString ODatabaseMetaData::impl_getIdentifierQuoteString_throw( )
502 return OUString("\"");
505 OUString SAL_CALL ODatabaseMetaData::getExtraNameCharacters( ) throw(SQLException, RuntimeException, std::exception)
507 return OUString();
510 sal_Bool SAL_CALL ODatabaseMetaData::supportsDifferentTableCorrelationNames( ) throw(SQLException, RuntimeException, std::exception)
512 return true;
515 bool ODatabaseMetaData::impl_isCatalogAtStart_throw( )
517 return true;
520 sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionIgnoredInTransactions( ) throw(SQLException, RuntimeException, std::exception)
522 return true;
525 sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionCausesTransactionCommit( ) throw(SQLException, RuntimeException, std::exception)
527 return true;
530 sal_Bool SAL_CALL ODatabaseMetaData::supportsDataManipulationTransactionsOnly( ) throw(SQLException, RuntimeException, std::exception)
532 return false;
535 sal_Bool SAL_CALL ODatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions( ) throw(SQLException, RuntimeException, std::exception)
537 return false;
540 sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedDelete( ) throw(SQLException, RuntimeException, std::exception)
542 return false;
545 sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedUpdate( ) throw(SQLException, RuntimeException, std::exception)
547 return false;
550 sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossRollback( ) throw(SQLException, RuntimeException, std::exception)
552 return false;
555 sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossCommit( ) throw(SQLException, RuntimeException, std::exception)
557 return false;
560 sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossCommit( ) throw(SQLException, RuntimeException, std::exception)
562 return false;
565 sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossRollback( ) throw(SQLException, RuntimeException, std::exception)
567 return false;
570 sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactionIsolationLevel( sal_Int32 /*level*/ ) throw(SQLException, RuntimeException, std::exception)
572 return false;
575 bool ODatabaseMetaData::impl_supportsSchemasInDataManipulation_throw( )
577 return false;
580 sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92FullSQL( ) throw(SQLException, RuntimeException, std::exception)
582 return false;
585 sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92EntryLevelSQL( ) throw(SQLException, RuntimeException, std::exception)
587 return false;
590 sal_Bool SAL_CALL ODatabaseMetaData::supportsIntegrityEnhancementFacility( ) throw(SQLException, RuntimeException, std::exception)
592 return false;
595 sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInIndexDefinitions( ) throw(SQLException, RuntimeException, std::exception)
597 return false;
600 bool ODatabaseMetaData::impl_supportsSchemasInTableDefinitions_throw( )
602 return false;
605 bool ODatabaseMetaData::impl_supportsCatalogsInTableDefinitions_throw( )
607 return false;
610 sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInIndexDefinitions( ) throw(SQLException, RuntimeException, std::exception)
612 return false;
615 bool ODatabaseMetaData::impl_supportsCatalogsInDataManipulation_throw( )
617 return false;
620 sal_Bool SAL_CALL ODatabaseMetaData::supportsOuterJoins( ) throw(SQLException, RuntimeException, std::exception)
622 return false;
625 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTableTypes( ) throw(SQLException, RuntimeException, std::exception)
627 ::osl::MutexGuard aGuard( m_aMutex );
629 ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eTableTypes );
630 Reference< XResultSet > xRef = pResult;
631 static ODatabaseMetaDataResultSet::ORows aRows;
632 if(aRows.empty())
634 ODatabaseMetaDataResultSet::ORow aRow;
635 aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
636 aRow.push_back(new ORowSetValueDecorator(OUString("TABLE")));
637 aRows.push_back(aRow);
639 pResult->setRows(aRows);
640 return xRef;
643 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxStatementLength( ) throw(SQLException, RuntimeException, std::exception)
645 return 0;
648 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxProcedureNameLength( ) throw(SQLException, RuntimeException, std::exception)
650 return 0;
653 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxSchemaNameLength( ) throw(SQLException, RuntimeException, std::exception)
655 return 0;
658 sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactions( ) throw(SQLException, RuntimeException, std::exception)
660 return false;
663 sal_Bool SAL_CALL ODatabaseMetaData::allProceduresAreCallable( ) throw(SQLException, RuntimeException, std::exception)
665 return false;
668 sal_Bool SAL_CALL ODatabaseMetaData::supportsStoredProcedures( ) throw(SQLException, RuntimeException, std::exception)
670 return false;
673 sal_Bool SAL_CALL ODatabaseMetaData::supportsSelectForUpdate( ) throw(SQLException, RuntimeException, std::exception)
675 return false;
678 sal_Bool SAL_CALL ODatabaseMetaData::allTablesAreSelectable( ) throw(SQLException, RuntimeException, std::exception)
680 return true;
683 sal_Bool SAL_CALL ODatabaseMetaData::isReadOnly( ) throw(SQLException, RuntimeException, std::exception)
685 return true;
688 sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFiles( ) throw(SQLException, RuntimeException, std::exception)
690 return true;
693 sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFilePerTable( ) throw(SQLException, RuntimeException, std::exception)
695 return true;
698 sal_Bool SAL_CALL ODatabaseMetaData::supportsTypeConversion( ) throw(SQLException, RuntimeException, std::exception)
700 return false;
703 sal_Bool SAL_CALL ODatabaseMetaData::nullPlusNonNullIsNull( ) throw(SQLException, RuntimeException, std::exception)
705 return true;
708 sal_Bool SAL_CALL ODatabaseMetaData::supportsColumnAliasing( ) throw(SQLException, RuntimeException, std::exception)
710 return true;
713 sal_Bool SAL_CALL ODatabaseMetaData::supportsTableCorrelationNames( ) throw(SQLException, RuntimeException, std::exception)
715 return true;
718 sal_Bool SAL_CALL ODatabaseMetaData::supportsConvert( sal_Int32 /*fromType*/, sal_Int32 /*toType*/ ) throw(SQLException, RuntimeException, std::exception)
720 return false;
723 sal_Bool SAL_CALL ODatabaseMetaData::supportsExpressionsInOrderBy( ) throw(SQLException, RuntimeException, std::exception)
725 return false;
728 sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupBy( ) throw(SQLException, RuntimeException, std::exception)
730 return false;
733 sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByBeyondSelect( ) throw(SQLException, RuntimeException, std::exception)
735 return false;
738 sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByUnrelated( ) throw(SQLException, RuntimeException, std::exception)
740 return false;
743 sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleTransactions( ) throw(SQLException, RuntimeException, std::exception)
745 return false;
748 sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleResultSets( ) throw(SQLException, RuntimeException, std::exception)
750 return false;
753 sal_Bool SAL_CALL ODatabaseMetaData::supportsLikeEscapeClause( ) throw(SQLException, RuntimeException, std::exception)
755 return false;
758 sal_Bool SAL_CALL ODatabaseMetaData::supportsOrderByUnrelated( ) throw(SQLException, RuntimeException, std::exception)
760 return true;
763 sal_Bool SAL_CALL ODatabaseMetaData::supportsUnion( ) throw(SQLException, RuntimeException, std::exception)
765 return false;
768 sal_Bool SAL_CALL ODatabaseMetaData::supportsUnionAll( ) throw(SQLException, RuntimeException, std::exception)
770 return false;
773 sal_Bool SAL_CALL ODatabaseMetaData::supportsMixedCaseIdentifiers( ) throw(SQLException, RuntimeException, std::exception)
775 return true;
778 bool ODatabaseMetaData::impl_supportsMixedCaseQuotedIdentifiers_throw( )
780 return false;
783 sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtEnd( ) throw(SQLException, RuntimeException, std::exception)
785 return false;
788 sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtStart( ) throw(SQLException, RuntimeException, std::exception)
790 return true;
793 sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedHigh( ) throw(SQLException, RuntimeException, std::exception)
795 return false;
798 sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedLow( ) throw(SQLException, RuntimeException, std::exception)
800 return true;
803 sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInProcedureCalls( ) throw(SQLException, RuntimeException, std::exception)
805 return false;
808 sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInPrivilegeDefinitions( ) throw(SQLException, RuntimeException, std::exception)
810 return false;
813 sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInProcedureCalls( ) throw(SQLException, RuntimeException, std::exception)
815 return false;
818 sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInPrivilegeDefinitions( ) throw(SQLException, RuntimeException, std::exception)
820 return false;
823 sal_Bool SAL_CALL ODatabaseMetaData::supportsCorrelatedSubqueries( ) throw(SQLException, RuntimeException, std::exception)
825 return false;
828 sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInComparisons( ) throw(SQLException, RuntimeException, std::exception)
830 return false;
833 sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInExists( ) throw(SQLException, RuntimeException, std::exception)
835 return false;
838 sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInIns( ) throw(SQLException, RuntimeException, std::exception)
840 return false;
843 sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInQuantifieds( ) throw(SQLException, RuntimeException, std::exception)
845 return false;
848 sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92IntermediateSQL( ) throw(SQLException, RuntimeException, std::exception)
850 return false;
853 OUString SAL_CALL ODatabaseMetaData::getURL( ) throw(SQLException, RuntimeException, std::exception)
855 return OUString( "sdbc:file:" );
858 OUString SAL_CALL ODatabaseMetaData::getUserName( ) throw(SQLException, RuntimeException, std::exception)
860 return OUString();
863 OUString SAL_CALL ODatabaseMetaData::getDriverName( ) throw(SQLException, RuntimeException, std::exception)
865 return OUString();
868 OUString SAL_CALL ODatabaseMetaData::getDriverVersion( ) throw(SQLException, RuntimeException, std::exception)
870 return OUString::number(1);
873 OUString SAL_CALL ODatabaseMetaData::getDatabaseProductVersion( ) throw(SQLException, RuntimeException, std::exception)
875 return OUString::number(0);
878 OUString SAL_CALL ODatabaseMetaData::getDatabaseProductName( ) throw(SQLException, RuntimeException, std::exception)
880 return OUString();
883 OUString SAL_CALL ODatabaseMetaData::getProcedureTerm( ) throw(SQLException, RuntimeException, std::exception)
885 return OUString();
888 OUString SAL_CALL ODatabaseMetaData::getSchemaTerm( ) throw(SQLException, RuntimeException, std::exception)
890 return OUString();
893 sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMajorVersion( ) throw(RuntimeException, std::exception)
895 return 0;
898 sal_Int32 SAL_CALL ODatabaseMetaData::getDefaultTransactionIsolation( ) throw(SQLException, RuntimeException, std::exception)
900 return 0;
903 sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeException, std::exception)
905 return 0;
908 OUString SAL_CALL ODatabaseMetaData::getSQLKeywords( ) throw(SQLException, RuntimeException, std::exception)
910 return OUString();
913 OUString SAL_CALL ODatabaseMetaData::getSearchStringEscape( ) throw(SQLException, RuntimeException, std::exception)
915 return OUString();
918 OUString SAL_CALL ODatabaseMetaData::getStringFunctions( ) throw(SQLException, RuntimeException, std::exception)
920 return OUString("UCASE,LCASE,ASCII,LENGTH,OCTET_LENGTH,CHAR_LENGTH,CHARACTER_LENGTH,CHAR,CONCAT,LOCATE,SUBSTRING,LTRIM,RTRIM,SPACE,REPLACE,REPEAT,INSERT,LEFT,RIGHT");
923 OUString SAL_CALL ODatabaseMetaData::getTimeDateFunctions( ) throw(SQLException, RuntimeException, std::exception)
925 return OUString("DAYOFWEEK,DAYOFMONTH,DAYOFYEAR,MONTH,DAYNAME,MONTHNAME,QUARTER,WEEK,YEAR,HOUR,MINUTE,SECOND,CURDATE,CURTIME,NOW");
928 OUString SAL_CALL ODatabaseMetaData::getSystemFunctions( ) throw(SQLException, RuntimeException, std::exception)
930 return OUString();
933 OUString SAL_CALL ODatabaseMetaData::getNumericFunctions( ) throw(SQLException, RuntimeException, std::exception)
935 return OUString("ABS,SIGN,MOD,FLOOR,CEILING,ROUND,EXP,LN,LOG,LOG10,POWER,SQRT,PI,COS,SIN,TAN,ACOS,ASIN,ATAN,ATAN2,DEGREES,RADIANS");
938 sal_Bool SAL_CALL ODatabaseMetaData::supportsExtendedSQLGrammar( ) throw(SQLException, RuntimeException, std::exception)
940 return false;
943 sal_Bool SAL_CALL ODatabaseMetaData::supportsCoreSQLGrammar( ) throw(SQLException, RuntimeException, std::exception)
945 return false;
948 sal_Bool SAL_CALL ODatabaseMetaData::supportsMinimumSQLGrammar( ) throw(SQLException, RuntimeException, std::exception)
950 return true;
953 sal_Bool SAL_CALL ODatabaseMetaData::supportsFullOuterJoins( ) throw(SQLException, RuntimeException, std::exception)
955 return false;
958 sal_Bool SAL_CALL ODatabaseMetaData::supportsLimitedOuterJoins( ) throw(SQLException, RuntimeException, std::exception)
960 return false;
963 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInGroupBy( ) throw(SQLException, RuntimeException, std::exception)
965 return 0;
968 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInOrderBy( ) throw(SQLException, RuntimeException, std::exception)
970 return 0;
973 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInSelect( ) throw(SQLException, RuntimeException, std::exception)
975 return 0;
978 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxUserNameLength( ) throw(SQLException, RuntimeException, std::exception)
980 return 0;
983 sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetType( sal_Int32 setType ) throw(SQLException, RuntimeException, std::exception)
985 switch(setType)
987 case ResultSetType::FORWARD_ONLY:
988 return true;
989 case ResultSetType::SCROLL_INSENSITIVE:
990 case ResultSetType::SCROLL_SENSITIVE:
991 break;
993 return false;
996 sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 /*concurrency*/ ) throw(SQLException, RuntimeException, std::exception)
998 switch(setType)
1000 case ResultSetType::FORWARD_ONLY:
1001 return true;
1002 case ResultSetType::SCROLL_INSENSITIVE:
1003 case ResultSetType::SCROLL_SENSITIVE:
1004 break;
1006 return false;
1009 sal_Bool SAL_CALL ODatabaseMetaData::ownUpdatesAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException, std::exception)
1011 return true;
1014 sal_Bool SAL_CALL ODatabaseMetaData::ownDeletesAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException, std::exception)
1016 return true;
1019 sal_Bool SAL_CALL ODatabaseMetaData::ownInsertsAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException, std::exception)
1021 return true;
1024 sal_Bool SAL_CALL ODatabaseMetaData::othersUpdatesAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException, std::exception)
1026 return true;
1029 sal_Bool SAL_CALL ODatabaseMetaData::othersDeletesAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException, std::exception)
1031 return true;
1034 sal_Bool SAL_CALL ODatabaseMetaData::othersInsertsAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException, std::exception)
1036 return true;
1039 sal_Bool SAL_CALL ODatabaseMetaData::updatesAreDetected( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException, std::exception)
1041 return false;
1044 sal_Bool SAL_CALL ODatabaseMetaData::deletesAreDetected( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException, std::exception)
1046 return false;
1049 sal_Bool SAL_CALL ODatabaseMetaData::insertsAreDetected( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException, std::exception)
1051 return false;
1054 sal_Bool SAL_CALL ODatabaseMetaData::supportsBatchUpdates( ) throw(SQLException, RuntimeException, std::exception)
1056 return false;
1059 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getUDTs( const Any& /*catalog*/, const OUString& /*schemaPattern*/, const OUString& /*typeNamePattern*/, const Sequence< sal_Int32 >& /*types*/ ) throw(SQLException, RuntimeException, std::exception)
1061 return nullptr;
1065 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */