Version 4.3.0.0.beta1, tag libreoffice-4.3.0.0.beta1
[LibreOffice.git] / connectivity / source / drivers / file / FDatabaseMetaData.cxx
blobc36c3029d6ea04c17b1a50ec2c4b3ccc722e44de
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 <tools/debug.hxx>
35 #include <ucbhelper/content.hxx>
37 using namespace com::sun::star::ucb;
38 using namespace connectivity::file;
39 using namespace connectivity;
40 using namespace com::sun::star::uno;
41 using namespace com::sun::star::lang;
42 using namespace com::sun::star::beans;
43 using namespace com::sun::star::sdbc;
44 using namespace com::sun::star::sdbcx;
45 using namespace com::sun::star::container;
47 ODatabaseMetaData::ODatabaseMetaData(OConnection* _pCon) : ::connectivity::ODatabaseMetaDataBase(_pCon,_pCon->getConnectionInfo())
48 ,m_pConnection(_pCon)
52 ODatabaseMetaData::~ODatabaseMetaData()
56 Reference< XResultSet > ODatabaseMetaData::impl_getTypeInfo_throw( )
58 return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eTypeInfo );
61 OUString ODatabaseMetaData::impl_getCatalogSeparator_throw( )
63 return OUString();
66 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns(
67 const Any& /*catalog*/, const OUString& /*schemaPattern*/, const OUString& /*tableNamePattern*/,
68 const OUString& /*columnNamePattern*/ ) throw(SQLException, RuntimeException, std::exception)
70 SAL_WARN( "connectivity.drivers","Should be overloaded!");
71 return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eColumns );
75 namespace
77 sal_Int16 isCaseSensitiveParentFolder( const OUString& _rFolderOrDoc, const OUString& _rDocName )
79 sal_Int16 nIsCS = 1;
80 try
82 // first get the real content for the URL
83 INetURLObject aContentURL( _rFolderOrDoc );
84 ::ucbhelper::Content aContent1;
86 ::ucbhelper::Content aFolderOrDoc( _rFolderOrDoc, Reference< XCommandEnvironment >(), comphelper::getProcessComponentContext() );
87 if ( aFolderOrDoc.isDocument() )
88 aContent1 = aFolderOrDoc;
89 else
91 aContentURL = INetURLObject( _rFolderOrDoc, INetURLObject::WAS_ENCODED );
92 aContentURL.Append( _rDocName );
93 aContent1 = ::ucbhelper::Content( aContentURL.GetMainURL( INetURLObject::NO_DECODE ), Reference< XCommandEnvironment >(), comphelper::getProcessComponentContext() );
97 // get two extensions which differ by case only
98 OUString sExtension1(aContentURL.getExtension());
99 OUString sExtension2(sExtension1.toAsciiLowerCase());
100 if (sExtension2 == sExtension1)
102 // the extension was already in lower case
103 sExtension2 = sExtension2.toAsciiUpperCase();
106 // the complete URL for the second extension
107 INetURLObject aURL2( aContentURL );
108 if (!sExtension2.isEmpty())
109 aURL2.SetExtension( sExtension2 );
110 if ( aURL2.GetMainURL(INetURLObject::NO_DECODE) == aContentURL.GetMainURL(INetURLObject::NO_DECODE) )
111 return -1;
113 // the second context
114 bool bCanAccess = false;
115 ::ucbhelper::Content aContent2;
118 aContent2 = ::ucbhelper::Content( aURL2.GetMainURL( INetURLObject::NO_DECODE ), Reference< XCommandEnvironment >(), comphelper::getProcessComponentContext() );
119 bCanAccess = aContent2.isDocument();
121 catch( const Exception& )
125 if ( bCanAccess )
127 // here we have two contents whose URLs differ by case only.
128 // Now let's check if both really refer to the same object ....
129 Reference< XContent > xContent1 = aContent1.get();
130 Reference< XContent > xContent2 = aContent2.get();
131 OSL_ENSURE( xContent1.is() && xContent2.is(), "isCaseSensitiveParentFolder: invalid content interfaces!" );
132 if ( xContent1.is() && xContent2.is() )
134 Reference< XContentIdentifier > xID1 = xContent1->getIdentifier();
135 Reference< XContentIdentifier > xID2 = xContent2->getIdentifier();
136 OSL_ENSURE( xID1.is() && xID2.is(), "isCaseSensitiveParentFolder: invalid ID interfaces!" );
137 if ( xID1.is() && xID2.is()
138 && ( UniversalContentBroker::create(
139 comphelper::getProcessComponentContext() )->
140 compareContentIds( xID1, xID2 ) == 0 ) )
142 // finally, we know that the folder is not case-sensitive ....
143 nIsCS = 0;
148 catch( const Exception& )
150 SAL_WARN( "connectivity.drivers", "isCaseSensitiveParentFolder: caught an unexpected exception!" );
153 return nIsCS;
158 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
159 const Any& /*catalog*/, const OUString& /*schemaPattern*/,
160 const OUString& tableNamePattern, const Sequence< OUString >& types ) throw(SQLException, RuntimeException, std::exception)
162 ::osl::MutexGuard aGuard( m_aMutex );
165 ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eTables );
166 Reference< XResultSet > xRef = pResult;
168 // check if any type is given
169 // when no types are given then we have to return all tables e.g. TABLE
171 static const OUString aTable("TABLE");
173 bool bTableFound = true;
174 sal_Int32 nLength = types.getLength();
175 if(nLength)
177 bTableFound = false;
179 const OUString* pBegin = types.getConstArray();
180 const OUString* pEnd = pBegin + nLength;
181 for(;pBegin != pEnd;++pBegin)
183 if(*pBegin == aTable)
185 bTableFound = true;
186 break;
190 if(!bTableFound)
191 return xRef;
193 Reference<XDynamicResultSet> xContent = m_pConnection->getDir();
194 Reference < XSortedDynamicResultSetFactory > xSRSFac =
195 SortedDynamicResultSetFactory::create( m_pConnection->getDriver()->getComponentContext() );
197 Sequence< NumberedSortingInfo > aSortInfo( 1 );
198 NumberedSortingInfo* pInfo = aSortInfo.getArray();
199 pInfo[ 0 ].ColumnIndex = 1;
200 pInfo[ 0 ].Ascending = sal_True;
202 Reference < XAnyCompareFactory > xFactory;
203 Reference< XDynamicResultSet > xDynamicResultSet;
204 xDynamicResultSet = xSRSFac->createSortedDynamicResultSet( xContent, aSortInfo, xFactory );
205 Reference<XResultSet> xResultSet = xDynamicResultSet->getStaticResultSet();
207 Reference<XRow> xRow(xResultSet,UNO_QUERY);
209 OUString aFilenameExtension = m_pConnection->getExtension();
210 OUString sThisContentExtension;
211 ODatabaseMetaDataResultSet::ORows aRows;
212 // scan the directory for tables
213 OUString aName;
214 INetURLObject aURL;
215 xResultSet->beforeFirst();
217 bool bKnowCaseSensivity = false;
218 bool bCaseSensitiveDir = true;
219 bool bCheckEnabled = m_pConnection->isCheckEnabled();
221 while(xResultSet->next())
223 aName = xRow->getString(1);
224 aURL.SetSmartProtocol(INET_PROT_FILE);
225 OUString sUrl = m_pConnection->getURL() + "/" + aName;
226 aURL.SetSmartURL( sUrl );
227 sThisContentExtension = aURL.getExtension();
229 ODatabaseMetaDataResultSet::ORow aRow(3);
230 aRow.reserve(6);
231 bool bNewRow = false;
233 if ( !bKnowCaseSensivity )
235 bKnowCaseSensivity = true;
236 sal_Int16 nCase = isCaseSensitiveParentFolder( m_pConnection->getURL(), aURL.getName() );
237 switch( nCase )
239 case 1:
240 bCaseSensitiveDir = true;
241 break;
242 case -1:
243 bKnowCaseSensivity = false;
244 /** run through */
245 case 0:
246 bCaseSensitiveDir = false;
248 if ( bKnowCaseSensivity )
250 m_pConnection->setCaseSensitiveExtension( bCaseSensitiveDir, OConnection::GrantAccess() );
251 if ( !bCaseSensitiveDir )
253 aFilenameExtension = aFilenameExtension.toAsciiLowerCase();
258 if (!aFilenameExtension.isEmpty())
260 if ( !bCaseSensitiveDir )
262 sThisContentExtension = sThisContentExtension.toAsciiLowerCase();
265 if ( sThisContentExtension == aFilenameExtension )
267 aName = aName.copy(0, (aName.getLength()-(aFilenameExtension.getLength()+1)));
268 sal_Unicode nChar = aName.toChar();
269 if ( match(tableNamePattern,aName,'\0') && ( !bCheckEnabled || ( bCheckEnabled && ((nChar < '0' || nChar > '9')))) )
271 aRow.push_back(new ORowSetValueDecorator(aName));
272 bNewRow = true;
276 else // no extension, filter myself
278 bool bErg = false;
281 if (aURL.getExtension().isEmpty())
283 sal_Unicode nChar = aURL.getBase()[0];
284 if(match(tableNamePattern,aURL.getBase(),'\0') && ( !bCheckEnabled || ( bCheckEnabled && ((nChar < '0' || nChar > '9')))) )
286 aRow.push_back(new ORowSetValueDecorator(OUString(aURL.getBase())));
287 bNewRow = true;
289 break;
291 else if ( ( bErg = xResultSet->next() ) )
293 aName = xRow->getString(1);
294 aURL.SetSmartURL(aName);
296 } while (bErg);
298 if(bNewRow)
300 aRow.push_back(new ORowSetValueDecorator(aTable));
301 aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
303 aRows.push_back(aRow);
307 pResult->setRows(aRows);
309 return xRef;
312 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxBinaryLiteralLength( ) throw(SQLException, RuntimeException, std::exception)
314 return 0;
317 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxRowSize( ) throw(SQLException, RuntimeException, std::exception)
319 return 0;
322 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCatalogNameLength( ) throw(SQLException, RuntimeException, std::exception)
324 return 0;
327 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCharLiteralLength( ) throw(SQLException, RuntimeException, std::exception)
329 return SAL_MAX_INT32;
332 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnNameLength( ) throw(SQLException, RuntimeException, std::exception)
334 return 0;
337 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInIndex( ) throw(SQLException, RuntimeException, std::exception)
339 return 0;
342 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCursorNameLength( ) throw(SQLException, RuntimeException, std::exception)
344 return 0;
347 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxConnections( ) throw(SQLException, RuntimeException, std::exception)
349 return 0;
352 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInTable( ) throw(SQLException, RuntimeException, std::exception)
354 return 0;
357 sal_Int32 ODatabaseMetaData::impl_getMaxStatements_throw( )
359 return 0;
362 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxTableNameLength( ) throw(SQLException, RuntimeException, std::exception)
364 return 0;
367 sal_Int32 ODatabaseMetaData::impl_getMaxTablesInSelect_throw( )
369 return 1;
372 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges(
373 const Any& /*catalog*/, const OUString& /*schemaPattern*/, const OUString& tableNamePattern ) throw(SQLException, RuntimeException, std::exception)
375 ::osl::MutexGuard aGuard( m_aMutex );
377 ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eTablePrivileges );
378 Reference< XResultSet > xRef = pResult;
379 ODatabaseMetaDataResultSet::ORows aRows;
382 Reference< XTablesSupplier > xTabSup = m_pConnection->createCatalog();
383 if( xTabSup.is())
385 Reference< XNameAccess> xNames = xTabSup->getTables();
386 Sequence< OUString > aNames = xNames->getElementNames();
387 const OUString* pBegin = aNames.getConstArray();
388 const OUString* pEnd = pBegin + aNames.getLength();
389 for(;pBegin != pEnd;++pBegin)
391 if(match(tableNamePattern,*pBegin,'\0'))
393 static ODatabaseMetaDataResultSet::ORow aRow(8);
395 aRow[2] = new ORowSetValueDecorator(*pBegin);
396 aRow[6] = ODatabaseMetaDataResultSet::getSelectValue();
397 aRow[7] = new ORowSetValueDecorator(OUString("NO"));
398 aRows.push_back(aRow);
400 Reference< XPropertySet> xTable(
401 xNames->getByName(*pBegin), css::uno::UNO_QUERY);
402 if(xTable.is())
404 Reference<XUnoTunnel> xTunnel(xTable,UNO_QUERY);
405 if(xTunnel.is())
407 OFileTable* pTable = reinterpret_cast< OFileTable* >( xTunnel->getSomething(OFileTable::getUnoTunnelImplementationId()) );
408 if(pTable)
410 if(!pTable->isReadOnly())
412 aRow[6] = ODatabaseMetaDataResultSet::getInsertValue();
413 aRows.push_back(aRow);
414 if(!m_pConnection->showDeleted())
416 aRow[6] = ODatabaseMetaDataResultSet::getDeleteValue();
417 aRows.push_back(aRow);
419 aRow[6] = ODatabaseMetaDataResultSet::getUpdateValue();
420 aRows.push_back(aRow);
421 aRow[6] = ODatabaseMetaDataResultSet::getCreateValue();
422 aRows.push_back(aRow);
423 aRow[6] = ODatabaseMetaDataResultSet::getReadValue();
424 aRows.push_back(aRow);
425 aRow[6] = ODatabaseMetaDataResultSet::getAlterValue();
426 aRows.push_back(aRow);
427 aRow[6] = ODatabaseMetaDataResultSet::getDropValue();
428 aRows.push_back(aRow);
437 pResult->setRows(aRows);
438 return xRef;
441 sal_Bool SAL_CALL ODatabaseMetaData::doesMaxRowSizeIncludeBlobs( ) throw(SQLException, RuntimeException, std::exception)
443 return sal_True;
446 sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException, std::exception)
448 return sal_False;
451 sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseIdentifiers( ) throw(SQLException, RuntimeException, std::exception)
453 return sal_False;
456 bool ODatabaseMetaData::impl_storesMixedCaseQuotedIdentifiers_throw( )
458 return false;
461 sal_Bool SAL_CALL ODatabaseMetaData::storesMixedCaseIdentifiers( ) throw(SQLException, RuntimeException, std::exception)
463 return sal_False;
466 sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException, std::exception)
468 return sal_False;
471 sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseIdentifiers( ) throw(SQLException, RuntimeException, std::exception)
473 return sal_False;
476 bool ODatabaseMetaData::impl_supportsAlterTableWithAddColumn_throw( )
478 return false;
481 bool ODatabaseMetaData::impl_supportsAlterTableWithDropColumn_throw( )
483 return false;
486 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxIndexLength( ) throw(SQLException, RuntimeException, std::exception)
488 return 0;
491 sal_Bool SAL_CALL ODatabaseMetaData::supportsNonNullableColumns( ) throw(SQLException, RuntimeException, std::exception)
493 return sal_False;
496 OUString SAL_CALL ODatabaseMetaData::getCatalogTerm( ) throw(SQLException, RuntimeException, std::exception)
498 return OUString();
501 OUString ODatabaseMetaData::impl_getIdentifierQuoteString_throw( )
503 static const OUString sQuote("\"");
504 return sQuote;
507 OUString SAL_CALL ODatabaseMetaData::getExtraNameCharacters( ) throw(SQLException, RuntimeException, std::exception)
509 return OUString();
512 sal_Bool SAL_CALL ODatabaseMetaData::supportsDifferentTableCorrelationNames( ) throw(SQLException, RuntimeException, std::exception)
514 return sal_True;
517 bool ODatabaseMetaData::impl_isCatalogAtStart_throw( )
519 return true;
522 sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionIgnoredInTransactions( ) throw(SQLException, RuntimeException, std::exception)
524 return sal_True;
527 sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionCausesTransactionCommit( ) throw(SQLException, RuntimeException, std::exception)
529 return sal_True;
532 sal_Bool SAL_CALL ODatabaseMetaData::supportsDataManipulationTransactionsOnly( ) throw(SQLException, RuntimeException, std::exception)
534 return sal_False;
537 sal_Bool SAL_CALL ODatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions( ) throw(SQLException, RuntimeException, std::exception)
539 return sal_False;
542 sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedDelete( ) throw(SQLException, RuntimeException, std::exception)
544 return sal_False;
547 sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedUpdate( ) throw(SQLException, RuntimeException, std::exception)
549 return sal_False;
552 sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossRollback( ) throw(SQLException, RuntimeException, std::exception)
554 return sal_False;
557 sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossCommit( ) throw(SQLException, RuntimeException, std::exception)
559 return sal_False;
562 sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossCommit( ) throw(SQLException, RuntimeException, std::exception)
564 return sal_False;
567 sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossRollback( ) throw(SQLException, RuntimeException, std::exception)
569 return sal_False;
572 sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactionIsolationLevel( sal_Int32 /*level*/ ) throw(SQLException, RuntimeException, std::exception)
574 return sal_False;
577 bool ODatabaseMetaData::impl_supportsSchemasInDataManipulation_throw( )
579 return false;
582 sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92FullSQL( ) throw(SQLException, RuntimeException, std::exception)
584 return sal_False;
587 sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92EntryLevelSQL( ) throw(SQLException, RuntimeException, std::exception)
589 return sal_False;
592 sal_Bool SAL_CALL ODatabaseMetaData::supportsIntegrityEnhancementFacility( ) throw(SQLException, RuntimeException, std::exception)
594 return sal_False;
597 sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInIndexDefinitions( ) throw(SQLException, RuntimeException, std::exception)
599 return sal_False;
602 bool ODatabaseMetaData::impl_supportsSchemasInTableDefinitions_throw( )
604 return false;
607 bool ODatabaseMetaData::impl_supportsCatalogsInTableDefinitions_throw( )
609 return false;
612 sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInIndexDefinitions( ) throw(SQLException, RuntimeException, std::exception)
614 return sal_False;
617 bool ODatabaseMetaData::impl_supportsCatalogsInDataManipulation_throw( )
619 return false;
622 sal_Bool SAL_CALL ODatabaseMetaData::supportsOuterJoins( ) throw(SQLException, RuntimeException, std::exception)
624 return sal_False;
627 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTableTypes( ) throw(SQLException, RuntimeException, std::exception)
629 ::osl::MutexGuard aGuard( m_aMutex );
631 ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eTableTypes );
632 Reference< XResultSet > xRef = pResult;
633 static ODatabaseMetaDataResultSet::ORows aRows;
634 if(aRows.empty())
636 ODatabaseMetaDataResultSet::ORow aRow;
637 aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
638 aRow.push_back(new ORowSetValueDecorator(OUString("TABLE")));
639 aRows.push_back(aRow);
641 pResult->setRows(aRows);
642 return xRef;
645 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxStatementLength( ) throw(SQLException, RuntimeException, std::exception)
647 return 0;
650 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxProcedureNameLength( ) throw(SQLException, RuntimeException, std::exception)
652 return 0;
655 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxSchemaNameLength( ) throw(SQLException, RuntimeException, std::exception)
657 return 0;
660 sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactions( ) throw(SQLException, RuntimeException, std::exception)
662 return sal_False;
665 sal_Bool SAL_CALL ODatabaseMetaData::allProceduresAreCallable( ) throw(SQLException, RuntimeException, std::exception)
667 return sal_False;
670 sal_Bool SAL_CALL ODatabaseMetaData::supportsStoredProcedures( ) throw(SQLException, RuntimeException, std::exception)
672 return sal_False;
675 sal_Bool SAL_CALL ODatabaseMetaData::supportsSelectForUpdate( ) throw(SQLException, RuntimeException, std::exception)
677 return sal_False;
680 sal_Bool SAL_CALL ODatabaseMetaData::allTablesAreSelectable( ) throw(SQLException, RuntimeException, std::exception)
682 return sal_True;
685 sal_Bool SAL_CALL ODatabaseMetaData::isReadOnly( ) throw(SQLException, RuntimeException, std::exception)
687 return sal_True;
690 sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFiles( ) throw(SQLException, RuntimeException, std::exception)
692 return sal_True;
695 sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFilePerTable( ) throw(SQLException, RuntimeException, std::exception)
697 return sal_True;
700 sal_Bool SAL_CALL ODatabaseMetaData::supportsTypeConversion( ) throw(SQLException, RuntimeException, std::exception)
702 return sal_False;
705 sal_Bool SAL_CALL ODatabaseMetaData::nullPlusNonNullIsNull( ) throw(SQLException, RuntimeException, std::exception)
707 return sal_True;
710 sal_Bool SAL_CALL ODatabaseMetaData::supportsColumnAliasing( ) throw(SQLException, RuntimeException, std::exception)
712 return sal_True;
715 sal_Bool SAL_CALL ODatabaseMetaData::supportsTableCorrelationNames( ) throw(SQLException, RuntimeException, std::exception)
717 return sal_True;
720 sal_Bool SAL_CALL ODatabaseMetaData::supportsConvert( sal_Int32 /*fromType*/, sal_Int32 /*toType*/ ) throw(SQLException, RuntimeException, std::exception)
722 return sal_False;
725 sal_Bool SAL_CALL ODatabaseMetaData::supportsExpressionsInOrderBy( ) throw(SQLException, RuntimeException, std::exception)
727 return sal_False;
730 sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupBy( ) throw(SQLException, RuntimeException, std::exception)
732 return sal_False;
735 sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByBeyondSelect( ) throw(SQLException, RuntimeException, std::exception)
737 return sal_False;
740 sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByUnrelated( ) throw(SQLException, RuntimeException, std::exception)
742 return sal_False;
745 sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleTransactions( ) throw(SQLException, RuntimeException, std::exception)
747 return sal_False;
750 sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleResultSets( ) throw(SQLException, RuntimeException, std::exception)
752 return sal_False;
755 sal_Bool SAL_CALL ODatabaseMetaData::supportsLikeEscapeClause( ) throw(SQLException, RuntimeException, std::exception)
757 return sal_False;
760 sal_Bool SAL_CALL ODatabaseMetaData::supportsOrderByUnrelated( ) throw(SQLException, RuntimeException, std::exception)
762 return sal_True;
765 sal_Bool SAL_CALL ODatabaseMetaData::supportsUnion( ) throw(SQLException, RuntimeException, std::exception)
767 return sal_False;
770 sal_Bool SAL_CALL ODatabaseMetaData::supportsUnionAll( ) throw(SQLException, RuntimeException, std::exception)
772 return sal_False;
775 sal_Bool SAL_CALL ODatabaseMetaData::supportsMixedCaseIdentifiers( ) throw(SQLException, RuntimeException, std::exception)
777 return sal_True;
780 bool ODatabaseMetaData::impl_supportsMixedCaseQuotedIdentifiers_throw( )
782 return false;
785 sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtEnd( ) throw(SQLException, RuntimeException, std::exception)
787 return sal_False;
790 sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtStart( ) throw(SQLException, RuntimeException, std::exception)
792 return sal_True;
795 sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedHigh( ) throw(SQLException, RuntimeException, std::exception)
797 return sal_False;
800 sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedLow( ) throw(SQLException, RuntimeException, std::exception)
802 return sal_True;
805 sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInProcedureCalls( ) throw(SQLException, RuntimeException, std::exception)
807 return sal_False;
810 sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInPrivilegeDefinitions( ) throw(SQLException, RuntimeException, std::exception)
812 return sal_False;
815 sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInProcedureCalls( ) throw(SQLException, RuntimeException, std::exception)
817 return sal_False;
820 sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInPrivilegeDefinitions( ) throw(SQLException, RuntimeException, std::exception)
822 return sal_False;
825 sal_Bool SAL_CALL ODatabaseMetaData::supportsCorrelatedSubqueries( ) throw(SQLException, RuntimeException, std::exception)
827 return sal_False;
830 sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInComparisons( ) throw(SQLException, RuntimeException, std::exception)
832 return sal_False;
835 sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInExists( ) throw(SQLException, RuntimeException, std::exception)
837 return sal_False;
840 sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInIns( ) throw(SQLException, RuntimeException, std::exception)
842 return sal_False;
845 sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInQuantifieds( ) throw(SQLException, RuntimeException, std::exception)
847 return sal_False;
850 sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92IntermediateSQL( ) throw(SQLException, RuntimeException, std::exception)
852 return sal_False;
855 OUString SAL_CALL ODatabaseMetaData::getURL( ) throw(SQLException, RuntimeException, std::exception)
857 static const OUString aValue( "sdbc:file:" );
858 return aValue;
861 OUString SAL_CALL ODatabaseMetaData::getUserName( ) throw(SQLException, RuntimeException, std::exception)
863 return OUString();
866 OUString SAL_CALL ODatabaseMetaData::getDriverName( ) throw(SQLException, RuntimeException, std::exception)
868 return OUString();
871 OUString SAL_CALL ODatabaseMetaData::getDriverVersion( ) throw(SQLException, RuntimeException, std::exception)
873 return OUString::number(1);
876 OUString SAL_CALL ODatabaseMetaData::getDatabaseProductVersion( ) throw(SQLException, RuntimeException, std::exception)
878 return OUString::number(0);
881 OUString SAL_CALL ODatabaseMetaData::getDatabaseProductName( ) throw(SQLException, RuntimeException, std::exception)
883 return OUString();
886 OUString SAL_CALL ODatabaseMetaData::getProcedureTerm( ) throw(SQLException, RuntimeException, std::exception)
888 return OUString();
891 OUString SAL_CALL ODatabaseMetaData::getSchemaTerm( ) throw(SQLException, RuntimeException, std::exception)
893 return OUString();
896 sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMajorVersion( ) throw(RuntimeException, std::exception)
898 return 0;
901 sal_Int32 SAL_CALL ODatabaseMetaData::getDefaultTransactionIsolation( ) throw(SQLException, RuntimeException, std::exception)
903 return 0;
906 sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeException, std::exception)
908 return 0;
911 OUString SAL_CALL ODatabaseMetaData::getSQLKeywords( ) throw(SQLException, RuntimeException, std::exception)
913 return OUString();
916 OUString SAL_CALL ODatabaseMetaData::getSearchStringEscape( ) throw(SQLException, RuntimeException, std::exception)
918 return OUString();
921 OUString SAL_CALL ODatabaseMetaData::getStringFunctions( ) throw(SQLException, RuntimeException, std::exception)
923 return OUString("UCASE,LCASE,ASCII,LENGTH,OCTET_LENGTH,CHAR_LENGTH,CHARACTER_LENGTH,CHAR,CONCAT,LOCATE,SUBSTRING,LTRIM,RTRIM,SPACE,REPLACE,REPEAT,INSERT,LEFT,RIGHT");
926 OUString SAL_CALL ODatabaseMetaData::getTimeDateFunctions( ) throw(SQLException, RuntimeException, std::exception)
928 return OUString("DAYOFWEEK,DAYOFMONTH,DAYOFYEAR,MONTH,DAYNAME,MONTHNAME,QUARTER,WEEK,YEAR,HOUR,MINUTE,SECOND,CURDATE,CURTIME,NOW");
931 OUString SAL_CALL ODatabaseMetaData::getSystemFunctions( ) throw(SQLException, RuntimeException, std::exception)
933 return OUString();
936 OUString SAL_CALL ODatabaseMetaData::getNumericFunctions( ) throw(SQLException, RuntimeException, std::exception)
938 return OUString("ABS,SIGN,MOD,FLOOR,CEILING,ROUND,EXP,LN,LOG,LOG10,POWER,SQRT,PI,COS,SIN,TAN,ACOS,ASIN,ATAN,ATAN2,DEGREES,RADIANS");
941 sal_Bool SAL_CALL ODatabaseMetaData::supportsExtendedSQLGrammar( ) throw(SQLException, RuntimeException, std::exception)
943 return sal_False;
946 sal_Bool SAL_CALL ODatabaseMetaData::supportsCoreSQLGrammar( ) throw(SQLException, RuntimeException, std::exception)
948 return sal_False;
951 sal_Bool SAL_CALL ODatabaseMetaData::supportsMinimumSQLGrammar( ) throw(SQLException, RuntimeException, std::exception)
953 return sal_True;
956 sal_Bool SAL_CALL ODatabaseMetaData::supportsFullOuterJoins( ) throw(SQLException, RuntimeException, std::exception)
958 return sal_False;
961 sal_Bool SAL_CALL ODatabaseMetaData::supportsLimitedOuterJoins( ) throw(SQLException, RuntimeException, std::exception)
963 return sal_False;
966 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInGroupBy( ) throw(SQLException, RuntimeException, std::exception)
968 return 0;
971 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInOrderBy( ) throw(SQLException, RuntimeException, std::exception)
973 return 0;
976 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInSelect( ) throw(SQLException, RuntimeException, std::exception)
978 return 0;
981 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxUserNameLength( ) throw(SQLException, RuntimeException, std::exception)
983 return 0;
986 sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetType( sal_Int32 setType ) throw(SQLException, RuntimeException, std::exception)
988 switch(setType)
990 case ResultSetType::FORWARD_ONLY:
991 return sal_True;
992 case ResultSetType::SCROLL_INSENSITIVE:
993 case ResultSetType::SCROLL_SENSITIVE:
994 break;
996 return sal_False;
999 sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 /*concurrency*/ ) throw(SQLException, RuntimeException, std::exception)
1001 switch(setType)
1003 case ResultSetType::FORWARD_ONLY:
1004 return sal_True;
1005 case ResultSetType::SCROLL_INSENSITIVE:
1006 case ResultSetType::SCROLL_SENSITIVE:
1007 break;
1009 return sal_False;
1012 sal_Bool SAL_CALL ODatabaseMetaData::ownUpdatesAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException, std::exception)
1014 return sal_True;
1017 sal_Bool SAL_CALL ODatabaseMetaData::ownDeletesAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException, std::exception)
1019 return sal_True;
1022 sal_Bool SAL_CALL ODatabaseMetaData::ownInsertsAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException, std::exception)
1024 return sal_True;
1027 sal_Bool SAL_CALL ODatabaseMetaData::othersUpdatesAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException, std::exception)
1029 return sal_True;
1032 sal_Bool SAL_CALL ODatabaseMetaData::othersDeletesAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException, std::exception)
1034 return sal_True;
1037 sal_Bool SAL_CALL ODatabaseMetaData::othersInsertsAreVisible( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException, std::exception)
1039 return sal_True;
1042 sal_Bool SAL_CALL ODatabaseMetaData::updatesAreDetected( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException, std::exception)
1044 return sal_False;
1047 sal_Bool SAL_CALL ODatabaseMetaData::deletesAreDetected( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException, std::exception)
1049 return sal_False;
1052 sal_Bool SAL_CALL ODatabaseMetaData::insertsAreDetected( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException, std::exception)
1054 return sal_False;
1057 sal_Bool SAL_CALL ODatabaseMetaData::supportsBatchUpdates( ) throw(SQLException, RuntimeException, std::exception)
1059 return sal_False;
1062 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)
1064 return NULL;
1068 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */