2013-05-10 18:21:30 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/*************************************************************************
|
|
|
|
*
|
|
|
|
* The Contents of this file are made available subject to the terms of
|
|
|
|
* the BSD license.
|
|
|
|
*
|
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. Neither the name of Sun Microsystems, Inc. nor the names of its
|
|
|
|
* contributors may be used to endorse or promote products derived
|
|
|
|
* from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
|
|
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
|
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
|
|
|
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
|
|
|
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
#include "FDatabaseMetaData.hxx"
|
2013-05-22 08:56:23 +00:00
|
|
|
#include "FDatabaseMetaDataResultSet.hxx"
|
2013-07-22 10:49:37 +02:00
|
|
|
#include "Util.hxx"
|
2013-07-20 20:59:07 +02:00
|
|
|
|
|
|
|
#include <ibase.h>
|
|
|
|
#include <rtl/ustrbuf.hxx>
|
|
|
|
|
2013-07-22 10:49:37 +02:00
|
|
|
#include <com/sun/star/sdbc/ColumnValue.hpp>
|
2013-05-10 18:21:30 +00:00
|
|
|
#include <com/sun/star/sdbc/DataType.hpp>
|
|
|
|
#include <com/sun/star/sdbc/ResultSetType.hpp>
|
|
|
|
#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
|
|
|
|
#include <com/sun/star/sdbc/TransactionIsolation.hpp>
|
2013-05-22 08:56:23 +00:00
|
|
|
#include <com/sun/star/sdbc/XParameters.hpp>
|
|
|
|
#include <com/sun/star/sdbc/XRow.hpp>
|
2013-05-10 18:21:30 +00:00
|
|
|
|
|
|
|
using namespace connectivity::firebird;
|
2013-07-20 20:59:07 +02:00
|
|
|
|
|
|
|
using namespace ::rtl;
|
|
|
|
|
|
|
|
using namespace com::sun::star;
|
2013-05-10 18:21:30 +00:00
|
|
|
using namespace com::sun::star::uno;
|
|
|
|
using namespace com::sun::star::lang;
|
|
|
|
using namespace com::sun::star::beans;
|
|
|
|
using namespace com::sun::star::sdbc;
|
|
|
|
|
2013-05-22 08:56:23 +00:00
|
|
|
namespace connectivity
|
|
|
|
{
|
|
|
|
namespace firebird
|
|
|
|
{
|
|
|
|
static sal_Int32 const s_nCOLUMN_SIZE = 256;
|
|
|
|
static sal_Int32 const s_nDECIMAL_DIGITS = 0;
|
|
|
|
static sal_Int32 const s_nNULLABLE = 1;
|
|
|
|
static sal_Int32 const s_nCHAR_OCTET_LENGTH = 65535;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-10 18:21:30 +00:00
|
|
|
ODatabaseMetaData::ODatabaseMetaData(OConnection* _pCon)
|
|
|
|
: m_pConnection(_pCon)
|
|
|
|
{
|
|
|
|
OSL_ENSURE(m_pConnection,"ODatabaseMetaData::ODatabaseMetaData: No connection set!");
|
|
|
|
}
|
2013-07-12 09:45:39 +01:00
|
|
|
|
2013-05-10 18:21:30 +00:00
|
|
|
ODatabaseMetaData::~ODatabaseMetaData()
|
|
|
|
{
|
|
|
|
}
|
2013-07-12 15:09:22 +01:00
|
|
|
|
2013-07-20 20:59:07 +02:00
|
|
|
//----- Catalog Info -- UNSUPPORTED -------------------------------------------
|
2013-07-12 15:09:22 +01:00
|
|
|
OUString SAL_CALL ODatabaseMetaData::getCatalogSeparator() throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-12 15:09:22 +01:00
|
|
|
return OUString();
|
|
|
|
}
|
2013-05-10 18:21:30 +00:00
|
|
|
|
2013-07-12 15:09:22 +01:00
|
|
|
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCatalogNameLength() throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-24 20:09:39 +02:00
|
|
|
return -1;
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
2013-07-12 15:09:22 +01:00
|
|
|
|
|
|
|
OUString SAL_CALL ODatabaseMetaData::getCatalogTerm() throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-12 15:09:22 +01:00
|
|
|
return OUString();
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
2013-07-12 15:09:22 +01:00
|
|
|
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::isCatalogAtStart() throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-12 15:09:22 +01:00
|
|
|
return sal_False;
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
2013-07-12 15:09:22 +01:00
|
|
|
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInTableDefinitions() throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-12 15:09:22 +01:00
|
|
|
return sal_False;
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
2013-07-12 15:09:22 +01:00
|
|
|
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInIndexDefinitions() throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-12 15:09:22 +01:00
|
|
|
return sal_False;
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
2013-07-12 15:09:22 +01:00
|
|
|
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInDataManipulation( ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-12 15:09:22 +01:00
|
|
|
return sal_False;
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
2013-07-12 15:09:22 +01:00
|
|
|
|
2013-07-20 20:59:07 +02:00
|
|
|
uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCatalogs() throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-12 15:09:22 +01:00
|
|
|
return 0;
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
2013-07-12 15:09:22 +01:00
|
|
|
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInProcedureCalls() throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-12 15:09:22 +01:00
|
|
|
return sal_False;
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
2013-07-12 15:09:22 +01:00
|
|
|
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInPrivilegeDefinitions() throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-12 15:09:22 +01:00
|
|
|
return sal_False;
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
2013-07-12 15:09:22 +01:00
|
|
|
|
|
|
|
//----- Max Sizes/Lengths -----------------------------------------------------
|
|
|
|
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxBinaryLiteralLength() throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-16 22:40:47 +02:00
|
|
|
return 32767;
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
2013-07-12 15:09:22 +01:00
|
|
|
|
|
|
|
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxRowSize() throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-16 22:40:47 +02:00
|
|
|
return 32767;
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
2013-07-12 15:09:22 +01:00
|
|
|
|
|
|
|
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCharLiteralLength() throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-16 22:40:47 +02:00
|
|
|
return 32767;
|
2013-07-12 15:09:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnNameLength() throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-24 20:09:39 +02:00
|
|
|
return 31;
|
2013-07-12 15:09:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInIndex() throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-20 20:59:07 +02:00
|
|
|
// TODO: No idea.
|
2013-07-12 15:09:22 +01:00
|
|
|
// See: http://www.firebirdsql.org/en/firebird-technical-specifications/
|
2013-07-16 22:40:47 +02:00
|
|
|
return 16;
|
2013-07-12 15:09:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCursorNameLength() throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 22:40:47 +02:00
|
|
|
return 32;
|
2013-07-12 15:09:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxConnections() throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return 100; // Arbitrary
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInTable() throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
// May however be smaller.
|
|
|
|
// See: http://www.firebirdsql.org/en/firebird-technical-specifications/
|
2013-07-16 22:40:47 +02:00
|
|
|
return 32767;
|
2013-07-12 15:09:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxStatementLength() throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 22:40:47 +02:00
|
|
|
return 32767;
|
2013-07-12 15:09:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxTableNameLength() throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-22 15:36:38 +02:00
|
|
|
return 31;
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxTablesInSelect( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
sal_Int32 nValue = 0; // 0 means no limit
|
|
|
|
return nValue;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::doesMaxRowSizeIncludeBlobs( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
2013-07-24 20:09:39 +02:00
|
|
|
|
|
|
|
// ---- Identifiers -----------------------------------------------------------
|
|
|
|
// Only quoted identifiers are case sensitive, unquoted are case insensitive
|
|
|
|
OUString SAL_CALL ODatabaseMetaData::getIdentifierQuoteString()
|
|
|
|
throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-24 20:09:39 +02:00
|
|
|
OUString aVal('"');
|
|
|
|
return aVal;
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
2013-07-24 20:09:39 +02:00
|
|
|
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsMixedCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseQuotedIdentifiers()
|
|
|
|
throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
2013-07-24 20:09:39 +02:00
|
|
|
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::storesMixedCaseQuotedIdentifiers()
|
|
|
|
throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
// TODO: confirm this -- the documentation is highly ambiguous
|
|
|
|
// However it seems this should be true as quoted identifiers ARE
|
|
|
|
// stored mixed case.
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseQuotedIdentifiers()
|
|
|
|
throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
2013-07-24 20:09:39 +02:00
|
|
|
|
|
|
|
// ---- Unquoted Identifiers -------------------------------------------------
|
|
|
|
// All unquoted identifers are stored upper case.
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsMixedCaseIdentifiers()
|
|
|
|
throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
2013-07-24 20:09:39 +02:00
|
|
|
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseIdentifiers()
|
|
|
|
throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
2013-07-24 20:09:39 +02:00
|
|
|
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::storesMixedCaseIdentifiers()
|
|
|
|
throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
2013-07-24 20:09:39 +02:00
|
|
|
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseIdentifiers()
|
|
|
|
throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
|
2013-05-10 18:21:30 +00:00
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsAlterTableWithAddColumn( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsAlterTableWithDropColumn( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxIndexLength( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
sal_Int32 nValue = 0; // 0 means no limit
|
|
|
|
return nValue;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsNonNullableColumns( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-22 17:47:38 +02:00
|
|
|
return sal_True;
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-21 20:38:58 +02:00
|
|
|
OUString SAL_CALL ODatabaseMetaData::getExtraNameCharacters( ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-21 20:38:58 +02:00
|
|
|
OUString aVal;
|
2013-05-10 18:21:30 +00:00
|
|
|
return aVal;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsDifferentTableCorrelationNames( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionIgnoredInTransactions( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionCausesTransactionCommit( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsDataManipulationTransactionsOnly( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedDelete( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedUpdate( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossRollback( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossCommit( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossCommit( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossRollback( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactionIsolationLevel( sal_Int32 level ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) level;
|
2013-05-10 18:21:30 +00:00
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInDataManipulation( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92FullSQL( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92EntryLevelSQL( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_True; // should be supported at least
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsIntegrityEnhancementFacility( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInIndexDefinitions( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInTableDefinitions( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsOuterJoins( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxStatements( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
sal_Int32 nValue = 0; // 0 means no limit
|
|
|
|
return nValue;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxProcedureNameLength( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-24 20:09:39 +02:00
|
|
|
sal_Int32 nValue = 31; // TODO: confirm
|
2013-05-10 18:21:30 +00:00
|
|
|
return nValue;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxSchemaNameLength( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-24 20:09:39 +02:00
|
|
|
sal_Int32 nValue = -1; // 0 means no limit
|
2013-05-10 18:21:30 +00:00
|
|
|
return nValue;
|
|
|
|
}
|
2013-07-12 15:09:22 +01:00
|
|
|
|
2013-05-10 18:21:30 +00:00
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactions( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-12 15:09:22 +01:00
|
|
|
return sal_True;
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::allProceduresAreCallable( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
2013-07-12 15:09:22 +01:00
|
|
|
|
2013-05-10 18:21:30 +00:00
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsStoredProcedures( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-12 15:09:22 +01:00
|
|
|
return sal_True;
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsSelectForUpdate( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::allTablesAreSelectable( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::isReadOnly( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-12 15:09:22 +01:00
|
|
|
return m_pConnection->isReadOnly();
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
2013-07-12 15:09:22 +01:00
|
|
|
|
2013-05-10 18:21:30 +00:00
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFiles( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-12 15:09:22 +01:00
|
|
|
return m_pConnection->isEmbedded();
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
2013-07-12 15:09:22 +01:00
|
|
|
|
2013-05-10 18:21:30 +00:00
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFilePerTable( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsTypeConversion( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::nullPlusNonNullIsNull( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsColumnAliasing( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsTableCorrelationNames( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsConvert( sal_Int32 fromType, sal_Int32 toType ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) fromType;
|
|
|
|
(void) toType;
|
2013-05-10 18:21:30 +00:00
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsExpressionsInOrderBy( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
2013-07-12 15:09:22 +01:00
|
|
|
|
2013-05-10 18:21:30 +00:00
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupBy( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-12 15:09:22 +01:00
|
|
|
return sal_True;
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
2013-07-12 15:09:22 +01:00
|
|
|
|
2013-05-10 18:21:30 +00:00
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByBeyondSelect( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-12 15:09:22 +01:00
|
|
|
// Unsure
|
|
|
|
return sal_True;
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
2013-07-12 15:09:22 +01:00
|
|
|
|
2013-05-10 18:21:30 +00:00
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByUnrelated( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-12 15:09:22 +01:00
|
|
|
// Unsure
|
2013-05-10 18:21:30 +00:00
|
|
|
return sal_False;
|
|
|
|
}
|
2013-07-12 15:09:22 +01:00
|
|
|
|
2013-05-10 18:21:30 +00:00
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleTransactions( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-12 15:09:22 +01:00
|
|
|
return sal_True;
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleResultSets( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsLikeEscapeClause( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsOrderByUnrelated( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
2013-07-12 15:09:22 +01:00
|
|
|
|
2013-05-10 18:21:30 +00:00
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsUnion( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-12 15:09:22 +01:00
|
|
|
return sal_True;
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
2013-07-12 15:09:22 +01:00
|
|
|
|
2013-05-10 18:21:30 +00:00
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsUnionAll( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-12 15:09:22 +01:00
|
|
|
return sal_True;
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtEnd( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtStart( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedHigh( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedLow( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInProcedureCalls( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInPrivilegeDefinitions( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsCorrelatedSubqueries( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInComparisons( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInExists( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInIns( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInQuantifieds( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92IntermediateSQL( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
2013-07-12 15:09:22 +01:00
|
|
|
|
|
|
|
OUString SAL_CALL ODatabaseMetaData::getURL() throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-12 15:09:22 +01:00
|
|
|
return m_pConnection->getConnectionURL();
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-21 20:38:58 +02:00
|
|
|
OUString SAL_CALL ODatabaseMetaData::getUserName( ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-21 20:38:58 +02:00
|
|
|
OUString aValue;
|
2013-05-10 18:21:30 +00:00
|
|
|
return aValue;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-21 20:38:58 +02:00
|
|
|
OUString SAL_CALL ODatabaseMetaData::getDriverName( ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-21 20:38:58 +02:00
|
|
|
OUString aValue;
|
2013-05-10 18:21:30 +00:00
|
|
|
return aValue;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-21 20:38:58 +02:00
|
|
|
OUString SAL_CALL ODatabaseMetaData::getDriverVersion() throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-21 20:38:58 +02:00
|
|
|
OUString aValue;
|
2013-05-10 18:21:30 +00:00
|
|
|
return aValue;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-21 20:38:58 +02:00
|
|
|
OUString SAL_CALL ODatabaseMetaData::getDatabaseProductVersion( ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-21 20:38:58 +02:00
|
|
|
OUString aValue;
|
2013-05-10 18:21:30 +00:00
|
|
|
return aValue;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-21 20:38:58 +02:00
|
|
|
OUString SAL_CALL ODatabaseMetaData::getDatabaseProductName( ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-21 20:38:58 +02:00
|
|
|
OUString aValue;
|
2013-05-10 18:21:30 +00:00
|
|
|
return aValue;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-21 20:38:58 +02:00
|
|
|
OUString SAL_CALL ODatabaseMetaData::getProcedureTerm( ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-21 20:38:58 +02:00
|
|
|
OUString aValue;
|
2013-05-10 18:21:30 +00:00
|
|
|
return aValue;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-21 20:38:58 +02:00
|
|
|
OUString SAL_CALL ODatabaseMetaData::getSchemaTerm( ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-21 20:38:58 +02:00
|
|
|
OUString aValue;
|
2013-05-10 18:21:30 +00:00
|
|
|
return aValue;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMajorVersion( ) throw(RuntimeException)
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Int32 SAL_CALL ODatabaseMetaData::getDefaultTransactionIsolation( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return TransactionIsolation::NONE;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeException)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-21 20:38:58 +02:00
|
|
|
OUString SAL_CALL ODatabaseMetaData::getSQLKeywords( ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-21 20:38:58 +02:00
|
|
|
OUString aValue;
|
2013-05-10 18:21:30 +00:00
|
|
|
return aValue;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-21 20:38:58 +02:00
|
|
|
OUString SAL_CALL ODatabaseMetaData::getSearchStringEscape( ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-21 20:38:58 +02:00
|
|
|
OUString aValue;
|
2013-05-10 18:21:30 +00:00
|
|
|
return aValue;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-21 20:38:58 +02:00
|
|
|
OUString SAL_CALL ODatabaseMetaData::getStringFunctions( ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-21 20:38:58 +02:00
|
|
|
return OUString();
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-21 20:38:58 +02:00
|
|
|
OUString SAL_CALL ODatabaseMetaData::getTimeDateFunctions( ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-21 20:38:58 +02:00
|
|
|
return OUString();
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-21 20:38:58 +02:00
|
|
|
OUString SAL_CALL ODatabaseMetaData::getSystemFunctions( ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-21 20:38:58 +02:00
|
|
|
return OUString();
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-21 20:38:58 +02:00
|
|
|
OUString SAL_CALL ODatabaseMetaData::getNumericFunctions( ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-21 20:38:58 +02:00
|
|
|
return OUString();
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsExtendedSQLGrammar( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsCoreSQLGrammar( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsMinimumSQLGrammar( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsFullOuterJoins( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsLimitedOuterJoins( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInGroupBy( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
sal_Int32 nValue = 0; // 0 means no limit
|
|
|
|
return nValue;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInOrderBy( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
sal_Int32 nValue = 0; // 0 means no limit
|
|
|
|
return nValue;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInSelect( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
sal_Int32 nValue = 0; // 0 means no limit
|
|
|
|
return nValue;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Int32 SAL_CALL ODatabaseMetaData::getMaxUserNameLength( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 22:40:47 +02:00
|
|
|
return 31;
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
2013-07-22 18:05:08 +02:00
|
|
|
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetType(sal_Int32 setType)
|
|
|
|
throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-22 18:05:08 +02:00
|
|
|
switch (setType)
|
|
|
|
{
|
|
|
|
case ResultSetType::FORWARD_ONLY:
|
|
|
|
return sal_True;
|
|
|
|
default:
|
|
|
|
return sal_False;
|
|
|
|
}
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 concurrency ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) setType;
|
|
|
|
(void) concurrency;
|
2013-05-10 18:21:30 +00:00
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::ownUpdatesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) setType;
|
2013-05-10 18:21:30 +00:00
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::ownDeletesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) setType;
|
2013-05-10 18:21:30 +00:00
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::ownInsertsAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) setType;
|
2013-05-10 18:21:30 +00:00
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::othersUpdatesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) setType;
|
2013-05-10 18:21:30 +00:00
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::othersDeletesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) setType;
|
2013-05-10 18:21:30 +00:00
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::othersInsertsAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) setType;
|
2013-05-10 18:21:30 +00:00
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::updatesAreDetected( sal_Int32 setType ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) setType;
|
2013-05-10 18:21:30 +00:00
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::deletesAreDetected( sal_Int32 setType ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) setType;
|
2013-05-10 18:21:30 +00:00
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::insertsAreDetected( sal_Int32 setType ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) setType;
|
2013-05-10 18:21:30 +00:00
|
|
|
return sal_False;
|
|
|
|
}
|
2013-07-17 17:00:18 +02:00
|
|
|
|
|
|
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsBatchUpdates() throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-17 17:00:18 +02:00
|
|
|
// No batch support in firebird
|
2013-05-10 18:21:30 +00:00
|
|
|
return sal_False;
|
|
|
|
}
|
2013-07-12 15:09:22 +01:00
|
|
|
|
2013-07-20 20:59:07 +02:00
|
|
|
uno::Reference< XConnection > SAL_CALL ODatabaseMetaData::getConnection() throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-20 20:59:07 +02:00
|
|
|
return (uno::Reference< XConnection >) m_pConnection;
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
// here follow all methods which return a resultset
|
|
|
|
// the first methods is an example implementation how to use this resultset
|
|
|
|
// of course you could implement it on your and you should do this because
|
|
|
|
// the general way is more memory expensive
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-20 20:59:07 +02:00
|
|
|
uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTableTypes( ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-20 20:59:07 +02:00
|
|
|
uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTypeInfo( ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-18 11:23:01 +02:00
|
|
|
SAL_INFO("connectivity.firebird", "getTypeInfo().");
|
2013-05-22 08:56:23 +00:00
|
|
|
|
|
|
|
// this returns an empty resultset where the column-names are already set
|
|
|
|
// in special the metadata of the resultset already returns the right columns
|
|
|
|
ODatabaseMetaDataResultSet* pResultSet = new ODatabaseMetaDataResultSet(ODatabaseMetaDataResultSet::eTypeInfo);
|
2013-07-20 20:59:07 +02:00
|
|
|
uno::Reference< XResultSet > xResultSet = pResultSet;
|
2013-05-22 08:56:23 +00:00
|
|
|
static ODatabaseMetaDataResultSet::ORows aRows;
|
|
|
|
|
|
|
|
if(aRows.empty())
|
|
|
|
{
|
|
|
|
ODatabaseMetaDataResultSet::ORow aRow;
|
|
|
|
aRow.reserve(19);
|
|
|
|
aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
|
2013-06-06 08:24:57 +00:00
|
|
|
aRow.push_back(new ORowSetValueDecorator(OUString("VARCHAR(100)")));
|
2013-05-22 08:56:23 +00:00
|
|
|
aRow.push_back(new ORowSetValueDecorator(DataType::VARCHAR));
|
|
|
|
aRow.push_back(new ORowSetValueDecorator((sal_Int32)s_nCHAR_OCTET_LENGTH));
|
|
|
|
aRow.push_back(ODatabaseMetaDataResultSet::getQuoteValue());
|
|
|
|
aRow.push_back(ODatabaseMetaDataResultSet::getQuoteValue());
|
|
|
|
aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
|
|
|
|
// aRow.push_back(new ORowSetValueDecorator((sal_Int32)ColumnValue::NULLABLE));
|
|
|
|
aRow.push_back(ODatabaseMetaDataResultSet::get1Value());
|
|
|
|
aRow.push_back(ODatabaseMetaDataResultSet::get1Value());
|
|
|
|
aRow.push_back(new ORowSetValueDecorator((sal_Int32)ColumnSearch::CHAR));
|
|
|
|
aRow.push_back(ODatabaseMetaDataResultSet::get1Value());
|
|
|
|
aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
|
|
|
|
aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
|
|
|
|
aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
|
|
|
|
aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
|
|
|
|
aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
|
|
|
|
aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
|
|
|
|
aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
|
|
|
|
aRow.push_back(new ORowSetValueDecorator((sal_Int32)10));
|
|
|
|
|
|
|
|
aRows.push_back(aRow);
|
|
|
|
|
|
|
|
}
|
|
|
|
pResultSet->setRows(aRows);
|
|
|
|
return xResultSet;
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
2013-07-24 20:09:39 +02:00
|
|
|
|
|
|
|
uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getSchemas()
|
|
|
|
throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-20 20:59:07 +02:00
|
|
|
uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumnPrivileges(
|
2013-07-21 20:38:58 +02:00
|
|
|
const Any& catalog, const OUString& schema, const OUString& table,
|
|
|
|
const OUString& columnNamePattern ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) catalog;
|
|
|
|
(void) schema;
|
|
|
|
(void) table;
|
|
|
|
(void) columnNamePattern;
|
2013-05-10 18:21:30 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
2013-07-22 10:49:37 +02:00
|
|
|
|
2013-07-20 20:59:07 +02:00
|
|
|
uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns(
|
2013-07-22 10:49:37 +02:00
|
|
|
const Any& catalog,
|
|
|
|
const OUString& schemaPattern,
|
|
|
|
const OUString& tableNamePattern,
|
|
|
|
const OUString& columnNamePattern)
|
|
|
|
throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-22 10:49:37 +02:00
|
|
|
(void) catalog; // Unsupported in firebird
|
|
|
|
(void) schemaPattern; // Unsupported in firebird
|
|
|
|
SAL_INFO("connectivity.firebird", "getColumns() with "
|
|
|
|
"TableNamePattern: " << tableNamePattern <<
|
|
|
|
" & ColumnNamePattern: " << columnNamePattern);
|
|
|
|
|
|
|
|
OUStringBuffer queryBuf("SELECT "
|
|
|
|
"relfields.RDB$RELATION_NAME, " // 1
|
|
|
|
"relfields.RDB$FIELD_NAME, " // 2
|
|
|
|
"relfields.RDB$DESCRIPTION," // 3
|
|
|
|
"relfields.RDB$DEFAULT_VALUE, " // 4
|
|
|
|
"relfields.RDB$FIELD_POSITION, "// 5
|
|
|
|
"fields.RDB$FIELD_TYPE, " // 6
|
|
|
|
"fields.RDB$FIELD_LENGTH, " // 7
|
|
|
|
"fields.RDB$FIELD_PRECISION, " // 8
|
|
|
|
"fields.RDB$NULL_FLAG " // 9
|
|
|
|
"FROM RDB$RELATION_FIELDS relfields "
|
|
|
|
"JOIN RDB$FIELDS fields "
|
2013-07-22 15:36:38 +02:00
|
|
|
"on (fields.RDB$FIELD_NAME = relfields.RDB$FIELD_SOURCE) ");
|
2013-07-22 10:49:37 +02:00
|
|
|
|
2013-07-22 15:36:38 +02:00
|
|
|
if (!tableNamePattern.isEmpty() && !columnNamePattern.isEmpty())
|
|
|
|
{
|
|
|
|
queryBuf.append("WHERE ");
|
|
|
|
}
|
2013-07-22 10:49:37 +02:00
|
|
|
if (!tableNamePattern.isEmpty())
|
|
|
|
{
|
|
|
|
OUString sAppend;
|
|
|
|
if (tableNamePattern.match("%"))
|
2013-07-22 15:36:38 +02:00
|
|
|
sAppend = "relfields.RDB$RELATION_NAME LIKE '%' ";
|
2013-07-22 10:49:37 +02:00
|
|
|
else
|
2013-07-22 15:36:38 +02:00
|
|
|
sAppend = "relfields.RDB$RELATION_NAME = '%' ";
|
2013-07-22 10:49:37 +02:00
|
|
|
|
|
|
|
queryBuf.append(sAppend.replaceAll("%", tableNamePattern));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!columnNamePattern.isEmpty())
|
|
|
|
{
|
2013-07-22 15:36:38 +02:00
|
|
|
if (!tableNamePattern.isEmpty())
|
|
|
|
queryBuf.append("AND ");
|
|
|
|
|
2013-07-22 10:49:37 +02:00
|
|
|
OUString sAppend;
|
|
|
|
if (columnNamePattern.match("%"))
|
2013-07-22 15:36:38 +02:00
|
|
|
sAppend = "relfields.RDB$FIELD_NAME LIKE '%' ";
|
2013-07-22 10:49:37 +02:00
|
|
|
else
|
2013-07-22 15:36:38 +02:00
|
|
|
sAppend = "relfields.RDB$FIELD_NAME = '%' ";
|
2013-07-22 10:49:37 +02:00
|
|
|
|
|
|
|
queryBuf.append(sAppend.replaceAll("%", columnNamePattern));
|
|
|
|
}
|
|
|
|
|
|
|
|
OUString query = queryBuf.makeStringAndClear();
|
|
|
|
|
2013-07-22 15:36:38 +02:00
|
|
|
SAL_INFO("connectivity.firebird", "Retrieving columns with " <<
|
|
|
|
OUStringToOString(query,RTL_TEXTENCODING_UTF8).getStr());
|
|
|
|
|
2013-07-22 10:49:37 +02:00
|
|
|
uno::Reference< XStatement > statement = m_pConnection->createStatement();
|
|
|
|
uno::Reference< XResultSet > rs = statement->executeQuery(query.getStr());
|
|
|
|
uno::Reference< XRow > xRow( rs, UNO_QUERY_THROW );
|
|
|
|
|
|
|
|
ODatabaseMetaDataResultSet::ORows aResults;
|
|
|
|
|
|
|
|
while( rs->next() )
|
|
|
|
{
|
2013-07-22 17:47:38 +02:00
|
|
|
ODatabaseMetaDataResultSet::ORow aCurrentRow(18);
|
2013-07-22 10:49:37 +02:00
|
|
|
|
2013-07-22 17:47:38 +02:00
|
|
|
// 1. TABLE_CAT (catalog) may be null
|
|
|
|
aCurrentRow.push_back(new ORowSetValueDecorator());
|
|
|
|
// 2. TABLE_SCHEM (schema) may be null
|
|
|
|
aCurrentRow.push_back(new ORowSetValueDecorator());
|
2013-07-22 10:49:37 +02:00
|
|
|
// 3. TABLE_NAME
|
|
|
|
{
|
|
|
|
OUString aTableName = xRow->getString(1);
|
|
|
|
aCurrentRow.push_back(new ORowSetValueDecorator(aTableName));
|
|
|
|
}
|
|
|
|
// 4. Column Name
|
|
|
|
{
|
|
|
|
OUString aColumnName = xRow->getString(2);
|
|
|
|
aCurrentRow.push_back(new ORowSetValueDecorator(aColumnName));
|
|
|
|
}
|
|
|
|
|
|
|
|
// 5. Datatype
|
|
|
|
short aType = getFBTypeFromBlrType(xRow->getShort(6));
|
|
|
|
aCurrentRow.push_back(new ORowSetValueDecorator(getColumnTypeFromFBType(aType)));
|
|
|
|
// 6. Typename (SQL_*)
|
|
|
|
aCurrentRow.push_back(new ORowSetValueDecorator(getColumnTypeNameFromFBType(aType)));
|
|
|
|
|
|
|
|
// 7. Column Sizes
|
|
|
|
{
|
|
|
|
sal_Int32 aColumnSize = 0;
|
|
|
|
switch (aType)
|
|
|
|
{
|
|
|
|
case SQL_TEXT:
|
|
|
|
case SQL_VARYING:
|
|
|
|
aColumnSize = xRow->getShort(7);
|
|
|
|
break;
|
|
|
|
case SQL_SHORT:
|
|
|
|
case SQL_LONG:
|
|
|
|
case SQL_FLOAT:
|
|
|
|
case SQL_DOUBLE:
|
|
|
|
case SQL_D_FLOAT:
|
|
|
|
case SQL_INT64:
|
|
|
|
case SQL_QUAD:
|
|
|
|
aColumnSize = xRow->getShort(8);
|
|
|
|
break;
|
|
|
|
case SQL_TIMESTAMP:
|
|
|
|
case SQL_BLOB:
|
|
|
|
case SQL_ARRAY:
|
|
|
|
case SQL_TYPE_TIME:
|
|
|
|
case SQL_TYPE_DATE:
|
|
|
|
case SQL_NULL:
|
|
|
|
// TODO: implement.
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
aCurrentRow.push_back(new ORowSetValueDecorator(aColumnSize));
|
|
|
|
}
|
|
|
|
// 8. Unused
|
|
|
|
aCurrentRow.push_back(new ORowSetValueDecorator());
|
|
|
|
// 9. Decimal Digits
|
|
|
|
// TODO: implement
|
2013-07-22 16:34:56 +02:00
|
|
|
aCurrentRow.push_back(new ORowSetValueDecorator(sal_Int32(0)));
|
2013-07-22 10:49:37 +02:00
|
|
|
// 10. Radix
|
2013-07-22 16:34:56 +02:00
|
|
|
aCurrentRow.push_back(new ORowSetValueDecorator(sal_Int32(10)));
|
2013-07-22 10:49:37 +02:00
|
|
|
// 11. Nullable
|
|
|
|
if (xRow->getShort(9))
|
|
|
|
{
|
|
|
|
aCurrentRow.push_back(new ORowSetValueDecorator(ColumnValue::NO_NULLS));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
aCurrentRow.push_back(new ORowSetValueDecorator(ColumnValue::NULLABLE));
|
|
|
|
}
|
|
|
|
// 12. Comments -- may be omitted
|
|
|
|
{
|
2013-07-22 17:47:38 +02:00
|
|
|
OUString aDescription;
|
2013-07-22 10:49:37 +02:00
|
|
|
uno::Reference< XBlob > xDescriptionBlob = xRow->getBlob(3);
|
|
|
|
if (xDescriptionBlob.is())
|
|
|
|
{
|
|
|
|
sal_Int32 aBlobLength = (sal_Int32) xDescriptionBlob->length();
|
2013-07-22 17:47:38 +02:00
|
|
|
aDescription = OUString((char*) xDescriptionBlob->getBytes(0, aBlobLength).getArray(),
|
2013-07-22 10:49:37 +02:00
|
|
|
aBlobLength,
|
|
|
|
RTL_TEXTENCODING_UTF8);
|
|
|
|
}
|
2013-07-22 17:47:38 +02:00
|
|
|
aCurrentRow.push_back(new ORowSetValueDecorator(aDescription));
|
2013-07-22 10:49:37 +02:00
|
|
|
}
|
|
|
|
// 13. Default -- may be omitted.
|
|
|
|
{
|
|
|
|
uno::Reference< XBlob > xDefaultValueBlob = xRow->getBlob(4);
|
|
|
|
if (xDefaultValueBlob.is())
|
|
|
|
{
|
2013-07-22 17:47:38 +02:00
|
|
|
// TODO: Implement
|
2013-07-22 10:49:37 +02:00
|
|
|
}
|
2013-07-22 17:47:38 +02:00
|
|
|
aCurrentRow.push_back(new ORowSetValueDecorator());
|
2013-07-22 10:49:37 +02:00
|
|
|
}
|
|
|
|
// 14. Unused
|
|
|
|
aCurrentRow.push_back(new ORowSetValueDecorator());
|
|
|
|
// 15. Unused
|
|
|
|
aCurrentRow.push_back(new ORowSetValueDecorator());
|
|
|
|
// 16. Bytes in Column for char
|
|
|
|
if (aType == SQL_TEXT)
|
|
|
|
{
|
|
|
|
aCurrentRow.push_back(new ORowSetValueDecorator(xRow->getShort(7)));
|
|
|
|
}
|
|
|
|
else if (aType == SQL_VARYING)
|
|
|
|
{
|
2013-07-22 16:34:56 +02:00
|
|
|
aCurrentRow.push_back(new ORowSetValueDecorator(sal_Int32(32767)));
|
2013-07-22 10:49:37 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-07-22 16:34:56 +02:00
|
|
|
aCurrentRow.push_back(new ORowSetValueDecorator(sal_Int32(0)));
|
2013-07-22 10:49:37 +02:00
|
|
|
}
|
2013-07-22 17:47:38 +02:00
|
|
|
// 17. Index of column
|
2013-07-22 10:49:37 +02:00
|
|
|
{
|
|
|
|
short aColumnNumber = xRow->getShort(5);
|
2013-07-22 17:47:38 +02:00
|
|
|
// Firebird stores column numbers beginning with 0 internally
|
|
|
|
// SDBC expects column numbering to begin with 1.
|
2013-07-22 20:22:27 +02:00
|
|
|
aCurrentRow.push_back(new ORowSetValueDecorator(sal_Int32(aColumnNumber + 1)));
|
2013-07-22 10:49:37 +02:00
|
|
|
}
|
|
|
|
// 18. Is nullable
|
|
|
|
if (xRow->getShort(9))
|
|
|
|
{
|
2013-07-22 18:05:08 +02:00
|
|
|
aCurrentRow.push_back(new ORowSetValueDecorator(OUString("NO")));
|
2013-07-22 10:49:37 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-07-22 18:05:08 +02:00
|
|
|
aCurrentRow.push_back(new ORowSetValueDecorator(OUString("YES")));
|
2013-07-22 10:49:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
aResults.push_back(aCurrentRow);
|
|
|
|
}
|
|
|
|
ODatabaseMetaDataResultSet* pResultSet = new ODatabaseMetaDataResultSet(ODatabaseMetaDataResultSet::eTables);
|
|
|
|
uno::Reference< XResultSet > xResultSet = pResultSet;
|
|
|
|
pResultSet->setRows( aResults );
|
|
|
|
|
|
|
|
return xResultSet;
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
2013-07-22 10:49:37 +02:00
|
|
|
|
2013-07-20 20:59:07 +02:00
|
|
|
uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
|
|
|
|
const Any& catalog,
|
2013-07-21 20:38:58 +02:00
|
|
|
const OUString& schemaPattern,
|
|
|
|
const OUString& tableNamePattern,
|
|
|
|
const Sequence< OUString >& types)
|
2013-07-20 20:59:07 +02:00
|
|
|
throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) catalog;
|
2013-07-20 20:59:07 +02:00
|
|
|
(void) schemaPattern;
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) types;
|
2013-07-20 20:59:07 +02:00
|
|
|
// TODO: implement types
|
|
|
|
SAL_INFO("connectivity.firebird", "getTables() with "
|
2013-06-04 13:51:40 +03:00
|
|
|
"TableNamePattern: " << tableNamePattern);
|
2013-05-22 08:56:23 +00:00
|
|
|
|
|
|
|
ODatabaseMetaDataResultSet* pResultSet = new ODatabaseMetaDataResultSet(ODatabaseMetaDataResultSet::eTables);
|
2013-07-20 20:59:07 +02:00
|
|
|
uno::Reference< XResultSet > xResultSet = pResultSet;
|
|
|
|
uno::Reference< XStatement > statement = m_pConnection->createStatement();
|
2013-05-22 08:56:23 +00:00
|
|
|
|
2013-06-05 15:07:01 +00:00
|
|
|
static const OUString wld("%");
|
2013-07-20 20:59:07 +02:00
|
|
|
OUStringBuffer queryBuf(
|
2013-05-22 08:56:23 +00:00
|
|
|
"SELECT "
|
2013-07-21 18:07:35 +02:00
|
|
|
"RDB$RELATION_NAME, RDB$SYSTEM_FLAG, RDB$RELATION_TYPE, "
|
|
|
|
"RDB$DESCRIPTION "
|
2013-05-22 08:56:23 +00:00
|
|
|
"FROM RDB$RELATIONS "
|
2013-07-20 20:59:07 +02:00
|
|
|
"WHERE (RDB$RELATION_TYPE = 0 OR RDB$RELATION_TYPE = 1)");
|
2013-05-22 08:56:23 +00:00
|
|
|
|
2013-06-05 15:07:01 +00:00
|
|
|
if (!tableNamePattern.isEmpty())
|
|
|
|
{
|
2013-07-20 20:59:07 +02:00
|
|
|
OUString sAppend;
|
2013-06-05 15:07:01 +00:00
|
|
|
if (tableNamePattern.match(wld))
|
2013-07-20 20:59:07 +02:00
|
|
|
sAppend = "AND RDB$RELATION_NAME LIKE '%' ";
|
2013-06-05 15:07:01 +00:00
|
|
|
else
|
2013-07-20 20:59:07 +02:00
|
|
|
sAppend = "AND RDB$RELATION_NAME = '%' ";
|
|
|
|
|
|
|
|
queryBuf.append(sAppend.replaceAll(wld, tableNamePattern));
|
2013-06-05 15:07:01 +00:00
|
|
|
}
|
2013-07-20 20:59:07 +02:00
|
|
|
queryBuf.append(" ORDER BY RDB$RELATION_TYPE, RDB$RELATION_NAME");
|
2013-05-22 08:56:23 +00:00
|
|
|
|
2013-07-20 20:59:07 +02:00
|
|
|
OUString query = queryBuf.makeStringAndClear();
|
2013-05-22 08:56:23 +00:00
|
|
|
|
2013-07-20 20:59:07 +02:00
|
|
|
uno::Reference< XResultSet > rs = statement->executeQuery(query.getStr());
|
|
|
|
uno::Reference< XRow > xRow( rs, UNO_QUERY_THROW );
|
2013-05-22 08:56:23 +00:00
|
|
|
ODatabaseMetaDataResultSet::ORows aRows;
|
2013-07-20 20:59:07 +02:00
|
|
|
|
2013-05-22 08:56:23 +00:00
|
|
|
while( rs->next() )
|
|
|
|
{
|
2013-07-20 20:59:07 +02:00
|
|
|
ODatabaseMetaDataResultSet::ORow aCurrentRow(3);
|
2013-05-22 08:56:23 +00:00
|
|
|
|
2013-07-21 18:07:35 +02:00
|
|
|
OUString aTableName = xRow->getString(1);
|
|
|
|
sal_Int16 systemFlag = xRow->getShort(2);
|
|
|
|
sal_Int16 tableType = xRow->getShort(3);
|
|
|
|
uno::Reference< XBlob > xBlob = xRow->getBlob(4);
|
|
|
|
|
|
|
|
OUString aDescription;
|
|
|
|
if (xBlob.is())
|
|
|
|
{
|
|
|
|
sal_Int32 aBlobLength = (sal_Int32) xBlob->length();
|
|
|
|
aDescription = OUString((char*) xBlob->getBytes(0, aBlobLength).getArray(),
|
|
|
|
aBlobLength,
|
|
|
|
RTL_TEXTENCODING_UTF8);
|
|
|
|
}
|
2013-05-22 08:56:23 +00:00
|
|
|
|
|
|
|
OUString aTableType;
|
2013-05-27 13:15:02 +00:00
|
|
|
if( 1 == systemFlag )
|
2013-05-22 08:56:23 +00:00
|
|
|
{
|
|
|
|
aTableType = OUString::createFromAscii("SYSTEM TABLE");
|
|
|
|
|
2013-07-20 20:59:07 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-05-27 13:15:02 +00:00
|
|
|
if( 0 == tableType )
|
2013-05-22 08:56:23 +00:00
|
|
|
{
|
|
|
|
aTableType = OUString::createFromAscii("TABLE");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
aTableType = OUString::createFromAscii("VIEW");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-20 20:59:07 +02:00
|
|
|
// TABLE_CAT (catalog) may be null -- thus we omit it.
|
|
|
|
// TABLE_SCHEM (schema) may be null -- thus we omit it.
|
|
|
|
// TABLE_NAME
|
|
|
|
aCurrentRow.push_back(new ORowSetValueDecorator(aTableName));
|
|
|
|
// TABLE_TYPE
|
|
|
|
aCurrentRow.push_back(new ORowSetValueDecorator(aTableType));
|
|
|
|
// REMARKS
|
|
|
|
aCurrentRow.push_back(new ORowSetValueDecorator(aDescription));
|
|
|
|
|
|
|
|
aRows.push_back(aCurrentRow);
|
2013-05-22 08:56:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pResultSet->setRows( aRows );
|
|
|
|
|
|
|
|
return xResultSet;
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-20 20:59:07 +02:00
|
|
|
uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedureColumns(
|
2013-07-21 20:38:58 +02:00
|
|
|
const Any& catalog, const OUString& schemaPattern,
|
|
|
|
const OUString& procedureNamePattern, const OUString& columnNamePattern ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) catalog;
|
|
|
|
(void) schemaPattern;
|
|
|
|
(void) procedureNamePattern;
|
|
|
|
(void) columnNamePattern;
|
2013-05-10 18:21:30 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-20 20:59:07 +02:00
|
|
|
uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedures(
|
2013-07-21 20:38:58 +02:00
|
|
|
const Any& catalog, const OUString& schemaPattern,
|
|
|
|
const OUString& procedureNamePattern ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) catalog;
|
|
|
|
(void) schemaPattern;
|
|
|
|
(void) procedureNamePattern;
|
2013-05-10 18:21:30 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-20 20:59:07 +02:00
|
|
|
uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getVersionColumns(
|
2013-07-21 20:38:58 +02:00
|
|
|
const Any& catalog, const OUString& schema, const OUString& table ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) catalog;
|
|
|
|
(void) schema;
|
|
|
|
(void) table;
|
2013-05-10 18:21:30 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-20 20:59:07 +02:00
|
|
|
uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getExportedKeys(
|
2013-07-21 20:38:58 +02:00
|
|
|
const Any& catalog, const OUString& schema, const OUString& table ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) catalog;
|
|
|
|
(void) schema;
|
|
|
|
(void) table;
|
2013-05-10 18:21:30 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-20 20:59:07 +02:00
|
|
|
uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getImportedKeys(
|
2013-07-21 20:38:58 +02:00
|
|
|
const Any& catalog, const OUString& schema, const OUString& table ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) catalog;
|
|
|
|
(void) schema;
|
|
|
|
(void) table;
|
2013-05-10 18:21:30 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-20 20:59:07 +02:00
|
|
|
uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getPrimaryKeys(
|
2013-07-21 20:38:58 +02:00
|
|
|
const Any& catalog, const OUString& schema, const OUString& table ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) catalog;
|
|
|
|
(void) schema;
|
|
|
|
(void) table;
|
2013-05-10 18:21:30 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-20 20:59:07 +02:00
|
|
|
uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getIndexInfo(
|
2013-07-21 20:38:58 +02:00
|
|
|
const Any& catalog, const OUString& schema, const OUString& table,
|
2013-05-10 18:21:30 +00:00
|
|
|
sal_Bool unique, sal_Bool approximate ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) catalog;
|
|
|
|
(void) schema;
|
|
|
|
(void) table;
|
|
|
|
(void) unique;
|
|
|
|
(void) approximate;
|
2013-05-10 18:21:30 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-20 20:59:07 +02:00
|
|
|
uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getBestRowIdentifier(
|
2013-07-21 20:38:58 +02:00
|
|
|
const Any& catalog, const OUString& schema, const OUString& table, sal_Int32 scope,
|
2013-05-10 18:21:30 +00:00
|
|
|
sal_Bool nullable ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) catalog;
|
|
|
|
(void) schema;
|
|
|
|
(void) table;
|
|
|
|
(void) scope;
|
|
|
|
(void) nullable;
|
2013-05-10 18:21:30 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-20 20:59:07 +02:00
|
|
|
uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges(
|
2013-07-21 20:38:58 +02:00
|
|
|
const Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) catalog;
|
|
|
|
(void) schemaPattern;
|
|
|
|
(void) tableNamePattern;
|
2013-05-10 18:21:30 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-20 20:59:07 +02:00
|
|
|
uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCrossReference(
|
2013-07-21 20:38:58 +02:00
|
|
|
const Any& primaryCatalog, const OUString& primarySchema,
|
|
|
|
const OUString& primaryTable, const Any& foreignCatalog,
|
|
|
|
const OUString& foreignSchema, const OUString& foreignTable ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) primaryCatalog;
|
|
|
|
(void) primarySchema;
|
|
|
|
(void) primaryTable;
|
|
|
|
(void) foreignCatalog;
|
|
|
|
(void) foreignSchema;
|
|
|
|
(void) foreignTable;
|
2013-05-10 18:21:30 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-21 20:38:58 +02:00
|
|
|
uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getUDTs( const Any& catalog, const OUString& schemaPattern, const OUString& typeNamePattern, const Sequence< sal_Int32 >& types ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) catalog;
|
|
|
|
(void) schemaPattern;
|
|
|
|
(void) typeNamePattern;
|
|
|
|
(void) types;
|
2013-05-10 18:21:30 +00:00
|
|
|
OSL_FAIL("Not implemented yet!");
|
|
|
|
throw SQLException();
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|