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 "FResultSet.hxx"
|
|
|
|
#include "FResultSetMetaData.hxx"
|
2013-07-19 09:21:43 +02:00
|
|
|
#include <propertyids.hxx>
|
|
|
|
#include <TConnection.hxx>
|
2013-07-17 21:03:16 +02:00
|
|
|
|
|
|
|
#include <comphelper/sequence.hxx>
|
|
|
|
#include <cppuhelper/typeprovider.hxx>
|
2013-07-18 10:59:11 +02:00
|
|
|
#include <rtl/string.hxx>
|
2013-05-23 13:31:58 +00:00
|
|
|
#include <rtl/ustrbuf.hxx>
|
2013-07-17 21:03:16 +02:00
|
|
|
|
2013-05-10 18:21:30 +00:00
|
|
|
#include <com/sun/star/beans/PropertyAttribute.hpp>
|
|
|
|
#include <com/sun/star/lang/DisposedException.hpp>
|
2013-07-17 21:03:16 +02:00
|
|
|
#include <com/sun/star/sdbc/DataType.hpp>
|
|
|
|
#include <com/sun/star/sdbcx/CompareBookmark.hpp>
|
2013-05-10 18:21:30 +00:00
|
|
|
|
2013-07-17 08:55:24 +02:00
|
|
|
using namespace ::comphelper;
|
2013-07-18 18:04:42 +02:00
|
|
|
using namespace ::connectivity;
|
2013-07-17 21:03:16 +02:00
|
|
|
using namespace ::connectivity::firebird;
|
|
|
|
using namespace ::cppu;
|
2013-07-18 08:57:15 +02:00
|
|
|
using namespace ::osl;
|
2013-07-17 21:03:16 +02:00
|
|
|
using namespace ::rtl;
|
|
|
|
|
|
|
|
using namespace ::com::sun::star;
|
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using namespace ::com::sun::star::lang;
|
|
|
|
using namespace ::com::sun::star::beans;
|
|
|
|
using namespace ::com::sun::star::sdbc;
|
|
|
|
using namespace ::com::sun::star::sdbcx;
|
|
|
|
using namespace ::com::sun::star::container;
|
|
|
|
using namespace ::com::sun::star::io;
|
|
|
|
using namespace ::com::sun::star::util;
|
|
|
|
|
2013-07-19 09:04:36 +02:00
|
|
|
OResultSet::OResultSet(OConnection* pConnection,
|
|
|
|
const uno::Reference< XStatement >& xStatement,
|
2013-07-17 21:03:16 +02:00
|
|
|
isc_stmt_handle& aStatementHandle,
|
2013-07-17 17:00:18 +02:00
|
|
|
XSQLDA* pSqlda)
|
2013-07-19 09:04:36 +02:00
|
|
|
: OResultSet_BASE(pConnection->getMutex())
|
2013-07-17 21:03:16 +02:00
|
|
|
, OPropertySetHelper(OResultSet_BASE::rBHelper)
|
2013-07-19 09:04:36 +02:00
|
|
|
, m_pConnection(pConnection)
|
2013-07-17 21:03:16 +02:00
|
|
|
, m_xStatement(xStatement)
|
2013-07-19 14:57:12 +02:00
|
|
|
, m_xMetaData(0)
|
2013-07-17 21:03:16 +02:00
|
|
|
, m_pSqlda(pSqlda)
|
2013-07-18 08:57:15 +02:00
|
|
|
, m_statementHandle(aStatementHandle)
|
2013-07-19 10:55:14 +02:00
|
|
|
, m_bWasNull(false)
|
2013-07-18 08:57:15 +02:00
|
|
|
, m_currentRow(0)
|
2013-07-19 10:55:14 +02:00
|
|
|
, m_bIsAfterLastRow(false)
|
2013-07-18 08:57:15 +02:00
|
|
|
, m_fieldCount(pSqlda? pSqlda->sqld : 0)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-18 11:23:01 +02:00
|
|
|
SAL_INFO("connectivity.firebird", "OResultSet().");
|
2013-06-04 13:51:40 +03:00
|
|
|
|
2013-07-17 21:03:16 +02:00
|
|
|
if (!pSqlda)
|
|
|
|
return; // TODO: what?
|
2013-07-17 17:00:18 +02:00
|
|
|
|
2013-07-18 08:57:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
OResultSet::~OResultSet()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-07-19 10:55:14 +02:00
|
|
|
// void OResultSet::ensureDataAvailable() throw (SQLException)
|
|
|
|
// {
|
|
|
|
// MutexGuard aGuard(m_pConnection->getMutex());
|
|
|
|
// checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
//
|
|
|
|
// if (!m_bIsPopulated)
|
|
|
|
// {
|
|
|
|
//
|
|
|
|
// ISC_STATUS aErr = isc_dsql_free_statement(m_statusVector,
|
|
|
|
// &m_statementHandle,
|
|
|
|
// DSQL_drop);
|
|
|
|
// // TODO: cleanup the XSQLDA, probably in the destructor?
|
|
|
|
//
|
|
|
|
// // fetchstat == 100L if fetching of data completed successfully.
|
|
|
|
// if ((fetchStat != 100L) || aErr)
|
|
|
|
// {
|
|
|
|
// SAL_WARN("connectivity.firebird", "Error when populating data");
|
|
|
|
// OConnection::evaluateStatusVector(m_statusVector,
|
|
|
|
// "isc_dsql_free_statement",
|
|
|
|
// *this);
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// SAL_INFO("connectivity.firebird", "Populated dataset with " << m_rowCount << " rows.");
|
|
|
|
// m_bIsPopulated = true;
|
|
|
|
// }
|
|
|
|
// }
|
2013-07-18 10:59:11 +02:00
|
|
|
|
|
|
|
|
2013-07-18 08:57:15 +02:00
|
|
|
// ---- XResultSet -- Row retrieval methods ------------------------------------
|
|
|
|
sal_Int32 SAL_CALL OResultSet::getRow() throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-07-18 08:57:15 +02:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
return m_currentRow;
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool SAL_CALL OResultSet::next() throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-07-18 08:57:15 +02:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
2013-07-19 10:55:14 +02:00
|
|
|
m_currentRow++;
|
|
|
|
|
|
|
|
ISC_STATUS fetchStat = isc_dsql_fetch(m_statusVector,
|
|
|
|
&m_statementHandle,
|
|
|
|
1,
|
|
|
|
m_pSqlda);
|
|
|
|
if (fetchStat == 0) // SUCCESSFUL
|
2013-07-18 08:57:15 +02:00
|
|
|
{
|
|
|
|
return sal_True;
|
|
|
|
}
|
2013-07-19 10:55:14 +02:00
|
|
|
else if (fetchStat == 100L) // END OF DATASET
|
|
|
|
{
|
|
|
|
// TODO: shut the statement
|
|
|
|
return sal_False;
|
|
|
|
}
|
2013-07-18 08:57:15 +02:00
|
|
|
else
|
2013-05-27 13:14:41 +00:00
|
|
|
{
|
2013-07-19 10:55:14 +02:00
|
|
|
SAL_WARN("connectivity.firebird", "Error when populating data");
|
|
|
|
// Throws sql exception as appropriate
|
|
|
|
OConnection::evaluateStatusVector(m_statusVector,
|
|
|
|
"isc_dsql_fetch",
|
|
|
|
*this);
|
2013-07-18 08:57:15 +02:00
|
|
|
return sal_False;
|
|
|
|
}
|
2013-07-19 10:55:14 +02:00
|
|
|
|
|
|
|
// {
|
|
|
|
// m_rowCount++;
|
|
|
|
//
|
|
|
|
// TRow aRow(m_fieldCount);
|
|
|
|
// m_sqlData.push_back(aRow);
|
|
|
|
// TRow& rRow = m_sqlData.back();
|
|
|
|
//
|
|
|
|
// XSQLVAR* pVar = m_pSqlda->sqlvar;
|
|
|
|
// for (int i = 0; i < m_fieldCount; pVar++, i++)
|
|
|
|
// {
|
|
|
|
// if ((pVar->sqltype & 1) == 0) // Means: Cannot contain NULL
|
|
|
|
// {
|
|
|
|
// // TODO: test for null here and set as appropriate
|
|
|
|
// }
|
|
|
|
// else // Means: Can contain NULL
|
|
|
|
// {
|
|
|
|
// // otherwise we need to test for SQL_TYPE and SQL_TYPE+1 below
|
|
|
|
// pVar->sqltype--;
|
|
|
|
// }
|
|
|
|
// switch (pVar->sqltype)
|
|
|
|
// {
|
|
|
|
// case SQL_SHORT:
|
|
|
|
// rRow[i] = (sal_Int16) *pVar->sqldata;
|
|
|
|
// break;
|
|
|
|
// case SQL_LONG:
|
|
|
|
// rRow[i] = (sal_Int32) *pVar->sqldata;
|
|
|
|
// break;
|
|
|
|
// case SQL_INT64:
|
|
|
|
// rRow[i] = (sal_Int64) *pVar->sqldata;
|
|
|
|
// break;
|
|
|
|
// // TODO: remember sqlscale for decimal types
|
|
|
|
// default:
|
|
|
|
// rRow[i] = OUString(pVar->sqldata, pVar->sqllen, RTL_TEXTENCODING_UTF8);
|
|
|
|
// break;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
2013-07-18 08:57:15 +02:00
|
|
|
}
|
|
|
|
|
2013-07-18 09:54:11 +02:00
|
|
|
sal_Bool SAL_CALL OResultSet::previous() throw(SQLException, RuntimeException)
|
2013-07-18 08:57:15 +02:00
|
|
|
{
|
2013-07-19 10:55:14 +02:00
|
|
|
throw SQLException("Firebird doesn't support previous()", *this, OUString(), 0, Any());
|
|
|
|
}
|
2013-07-18 08:57:15 +02:00
|
|
|
|
2013-07-19 10:55:14 +02:00
|
|
|
sal_Bool SAL_CALL OResultSet::isLast() throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
throw SQLException("Firebird doesn't support isLast()", *this, OUString(), 0, Any());
|
2013-07-18 08:57:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool SAL_CALL OResultSet::isBeforeFirst() throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-07-18 08:57:15 +02:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
return m_currentRow == 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool SAL_CALL OResultSet::isAfterLast() throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-07-18 08:57:15 +02:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
2013-07-19 10:55:14 +02:00
|
|
|
return m_bIsAfterLastRow;
|
2013-07-18 08:57:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool SAL_CALL OResultSet::isFirst() throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-07-18 08:57:15 +02:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
2013-07-19 10:55:14 +02:00
|
|
|
return m_currentRow == 1 && !m_bIsAfterLastRow;
|
2013-07-18 08:57:15 +02:00
|
|
|
}
|
2013-05-27 13:14:41 +00:00
|
|
|
|
2013-07-18 08:57:15 +02:00
|
|
|
// Move to front
|
|
|
|
void SAL_CALL OResultSet::beforeFirst() throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-07-18 08:57:15 +02:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
2013-07-19 10:55:14 +02:00
|
|
|
if (m_currentRow != 0)
|
|
|
|
throw SQLException("Firebird doesn't support beforeFirst()", *this, OUString(), 0, Any());
|
2013-07-18 08:57:15 +02:00
|
|
|
}
|
|
|
|
// Move to back
|
|
|
|
void SAL_CALL OResultSet::afterLast() throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-07-18 08:57:15 +02:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
2013-07-19 10:55:14 +02:00
|
|
|
if (!m_bIsAfterLastRow)
|
|
|
|
throw SQLException("Firebird doesn't support afterLast()", *this, OUString(), 0, Any());
|
2013-07-18 08:57:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool SAL_CALL OResultSet::first() throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-07-18 08:57:15 +02:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
2013-07-19 10:55:14 +02:00
|
|
|
if (m_currentRow == 0)
|
2013-07-18 08:57:15 +02:00
|
|
|
{
|
2013-07-19 10:55:14 +02:00
|
|
|
return next();
|
|
|
|
}
|
|
|
|
else if (m_currentRow == 1 && !m_bIsAfterLastRow)
|
|
|
|
{
|
|
|
|
return true;
|
2013-07-18 08:57:15 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-07-19 10:55:14 +02:00
|
|
|
throw SQLException("Firebird doesn't support first()", *this, OUString(), 0, Any());
|
2013-07-18 08:57:15 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool SAL_CALL OResultSet::last() throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 10:55:14 +02:00
|
|
|
// We need to iterate past the last row to know when we've passed the last
|
|
|
|
// row, so we can't actually move to last.
|
|
|
|
throw SQLException("Firebird doesn't support last()", *this, OUString(), 0, Any());
|
2013-07-18 08:57:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool SAL_CALL OResultSet::absolute(sal_Int32 aRow) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-07-18 08:57:15 +02:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
2013-07-18 09:54:11 +02:00
|
|
|
|
2013-07-19 10:55:14 +02:00
|
|
|
if (aRow > m_currentRow)
|
2013-07-18 08:57:15 +02:00
|
|
|
{
|
2013-07-19 10:55:14 +02:00
|
|
|
sal_Int32 aIterations = aRow - m_currentRow;
|
|
|
|
return relative(aIterations);
|
2013-05-27 13:14:41 +00:00
|
|
|
}
|
2013-07-18 08:57:15 +02:00
|
|
|
else
|
2013-05-27 13:14:41 +00:00
|
|
|
{
|
2013-07-19 10:55:14 +02:00
|
|
|
throw SQLException("Firebird doesn't support retrieval of rows before the current row",
|
|
|
|
*this, OUString(), 0, Any());
|
2013-05-27 13:14:41 +00:00
|
|
|
}
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
2013-07-17 21:03:16 +02:00
|
|
|
|
2013-07-18 08:57:15 +02:00
|
|
|
sal_Bool SAL_CALL OResultSet::relative(sal_Int32 row) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-07-18 08:57:15 +02:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
2013-07-19 10:55:14 +02:00
|
|
|
if (row > 0)
|
2013-07-18 08:57:15 +02:00
|
|
|
{
|
2013-07-19 10:55:14 +02:00
|
|
|
while (row--)
|
|
|
|
{
|
|
|
|
if (!next())
|
|
|
|
return sal_False;
|
|
|
|
}
|
2013-07-18 08:57:15 +02:00
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-07-19 10:55:14 +02:00
|
|
|
throw SQLException("Firebird doesn't support relative() for a negative offset",
|
|
|
|
*this, OUString(), 0, Any());
|
2013-07-18 08:57:15 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-19 10:55:14 +02:00
|
|
|
void SAL_CALL OResultSet::checkColumnIndex(sal_Int32 index)
|
|
|
|
throw (SQLException, RuntimeException)
|
2013-07-18 08:57:15 +02:00
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-07-18 08:57:15 +02:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
if( index < 1 || index > m_fieldCount )
|
|
|
|
{
|
|
|
|
throw SQLException( "Column Index is outwith valid range", *this, OUString(), 1, Any() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-19 10:55:14 +02:00
|
|
|
void SAL_CALL OResultSet::checkRowIndex()
|
|
|
|
throw (SQLException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-07-18 08:57:15 +02:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
2013-07-19 10:55:14 +02:00
|
|
|
if((m_currentRow < 1) || m_bIsAfterLastRow)
|
2013-07-18 08:57:15 +02:00
|
|
|
{
|
2013-07-19 10:55:14 +02:00
|
|
|
throw SQLException( "Row index is out of valid range.", *this, OUString(),1, Any() );
|
2013-07-18 08:57:15 +02:00
|
|
|
}
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
void OResultSet::disposing(void)
|
|
|
|
{
|
2013-05-27 21:06:48 +00:00
|
|
|
|
2013-05-10 18:21:30 +00:00
|
|
|
OPropertySetHelper::disposing();
|
|
|
|
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
|
2013-07-20 12:31:13 +02:00
|
|
|
if (m_statementHandle)
|
|
|
|
{
|
|
|
|
isc_dsql_free_statement(m_statusVector,
|
|
|
|
&m_statementHandle,
|
|
|
|
DSQL_drop);
|
|
|
|
try {
|
|
|
|
OConnection::evaluateStatusVector(m_statusVector,
|
|
|
|
"isc_dsql_free_statement",
|
|
|
|
*this);
|
|
|
|
}
|
|
|
|
catch (SQLException e)
|
|
|
|
{
|
|
|
|
// we cannot throw any exceptions here anyway
|
|
|
|
SAL_WARN("connectivity.firebird", "isc_dsql_free_statement failed\n" <<
|
|
|
|
e.Message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-10 18:21:30 +00:00
|
|
|
m_xMetaData = NULL;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
Any SAL_CALL OResultSet::queryInterface( const Type & rType ) throw(RuntimeException)
|
|
|
|
{
|
|
|
|
Any aRet = OPropertySetHelper::queryInterface(rType);
|
|
|
|
if(!aRet.hasValue())
|
|
|
|
aRet = OResultSet_BASE::queryInterface(rType);
|
|
|
|
return aRet;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
Sequence< Type > SAL_CALL OResultSet::getTypes( ) throw( RuntimeException)
|
|
|
|
{
|
|
|
|
OTypeCollection aTypes(
|
2013-07-17 21:03:16 +02:00
|
|
|
::cppu::UnoType< uno::Reference< ::com::sun::star::beans::XMultiPropertySet > >::get(),
|
|
|
|
::cppu::UnoType< uno::Reference< ::com::sun::star::beans::XFastPropertySet > >::get(),
|
|
|
|
::cppu::UnoType< uno::Reference< ::com::sun::star::beans::XPropertySet > >::get());
|
2013-05-10 18:21:30 +00:00
|
|
|
|
|
|
|
return concatSequences(aTypes.getTypes(),OResultSet_BASE::getTypes());
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
2013-07-17 21:03:16 +02:00
|
|
|
sal_Int32 SAL_CALL OResultSet::findColumn( const OUString& columnName ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
// find the first column with the name columnName
|
|
|
|
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
|
2013-07-17 21:03:16 +02:00
|
|
|
uno::Reference< XResultSetMetaData > xMeta = getMetaData();
|
2013-05-10 18:21:30 +00:00
|
|
|
sal_Int32 nLen = xMeta->getColumnCount();
|
|
|
|
sal_Int32 i = 1;
|
|
|
|
for(;i<=nLen;++i)
|
|
|
|
if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
|
|
|
|
columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
|
|
|
|
break;
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-17 21:03:16 +02:00
|
|
|
uno::Reference< XInputStream > SAL_CALL OResultSet::getBinaryStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) columnIndex;
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-17 21:03:16 +02:00
|
|
|
uno::Reference< XInputStream > SAL_CALL OResultSet::getCharacterStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) columnIndex;
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2013-07-19 11:51:26 +02:00
|
|
|
// ---- Internal Utilities ---------------------------------------------------
|
|
|
|
bool OResultSet::isNull(sal_Int32 columnIndex)
|
|
|
|
{
|
|
|
|
assert(columnIndex <= m_fieldCount);
|
|
|
|
XSQLVAR* pVar = m_pSqlda->sqlvar;
|
|
|
|
|
|
|
|
if (pVar[columnIndex-1].sqltype & 1) // Indicates column may contain null
|
|
|
|
{
|
|
|
|
if (*pVar[columnIndex-1].sqlind == -1)
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
T OResultSet::retrieveValue(sal_Int32 columnIndex)
|
|
|
|
{
|
|
|
|
if ((m_bWasNull = isNull(columnIndex)))
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
return *m_pSqlda->sqlvar[columnIndex-1].sqldata;
|
|
|
|
}
|
|
|
|
|
2013-07-19 12:16:01 +02:00
|
|
|
template <>
|
2013-07-21 17:45:08 +02:00
|
|
|
OUString OResultSet::retrieveValue(sal_Int32 columnIndex)
|
2013-07-19 12:16:01 +02:00
|
|
|
{
|
|
|
|
if ((m_bWasNull = isNull(columnIndex)))
|
|
|
|
return OUString();
|
|
|
|
|
2013-07-20 13:27:07 +02:00
|
|
|
// &~1 to remove the "can contain NULL" indicator
|
|
|
|
int aSqlType = m_pSqlda->sqlvar[columnIndex-1].sqltype & ~1;
|
|
|
|
if (aSqlType == SQL_TEXT )
|
|
|
|
{
|
|
|
|
return OUString(m_pSqlda->sqlvar[columnIndex-1].sqldata,
|
|
|
|
m_pSqlda->sqlvar[columnIndex-1].sqllen,
|
|
|
|
RTL_TEXTENCODING_UTF8);
|
|
|
|
}
|
|
|
|
else if (aSqlType == SQL_VARYING)
|
|
|
|
{
|
|
|
|
// First 2 bytes are a short containing the length of the string
|
|
|
|
// No idea if sqllen is still valid here?
|
|
|
|
short aLength = *((short*) m_pSqlda->sqlvar[columnIndex-1].sqldata);
|
|
|
|
return OUString(m_pSqlda->sqlvar[columnIndex-1].sqldata + 2,
|
|
|
|
aLength,
|
|
|
|
RTL_TEXTENCODING_UTF8);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return OUString();
|
|
|
|
// TODO: Possibly do some sort of type conversion?
|
|
|
|
}
|
2013-07-19 12:16:01 +02:00
|
|
|
}
|
2013-07-19 11:51:26 +02:00
|
|
|
|
2013-07-21 17:45:08 +02:00
|
|
|
template <>
|
|
|
|
ISC_QUAD* OResultSet::retrieveValue(sal_Int32 columnIndex)
|
|
|
|
{
|
|
|
|
if ((m_bWasNull = isNull(columnIndex)))
|
|
|
|
return 0;
|
|
|
|
return (ISC_QUAD*) m_pSqlda->sqlvar[columnIndex-1].sqldata;
|
|
|
|
}
|
|
|
|
|
2013-07-19 11:51:26 +02:00
|
|
|
template <typename T>
|
|
|
|
T OResultSet::safelyRetrieveValue(sal_Int32 columnIndex)
|
|
|
|
throw (SQLException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
2013-07-19 11:51:26 +02:00
|
|
|
checkColumnIndex(columnIndex);
|
|
|
|
checkRowIndex();
|
|
|
|
|
|
|
|
return retrieveValue< T >(columnIndex);
|
|
|
|
}
|
|
|
|
// ---- Simple Numerical types -----------------------------------------------
|
2013-07-18 18:04:42 +02:00
|
|
|
sal_Bool SAL_CALL OResultSet::getBoolean(sal_Int32 columnIndex)
|
|
|
|
throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-19 11:51:26 +02:00
|
|
|
// TODO: maybe retrieve as string and test for "true", "t", "1" etc. instead?
|
|
|
|
return safelyRetrieveValue< bool >(columnIndex);
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
|
|
|
|
2013-07-18 18:04:42 +02:00
|
|
|
sal_Int8 SAL_CALL OResultSet::getByte( sal_Int32 columnIndex )
|
|
|
|
throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-19 11:51:26 +02:00
|
|
|
return safelyRetrieveValue< sal_Int8 >(columnIndex);
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
|
|
|
|
2013-07-18 18:04:42 +02:00
|
|
|
Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes(sal_Int32 columnIndex)
|
|
|
|
throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-19 11:51:26 +02:00
|
|
|
(void) columnIndex;
|
|
|
|
return Sequence< sal_Int8 >(); // TODO: implement
|
|
|
|
//return safelyRetrieveValue(columnIndex);
|
2013-07-18 18:04:42 +02:00
|
|
|
}
|
2013-05-10 18:21:30 +00:00
|
|
|
|
2013-07-18 18:04:42 +02:00
|
|
|
sal_Int16 SAL_CALL OResultSet::getShort(sal_Int32 columnIndex)
|
|
|
|
throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 11:51:26 +02:00
|
|
|
return safelyRetrieveValue< sal_Int16 >(columnIndex);
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
|
|
|
|
2013-07-18 18:04:42 +02:00
|
|
|
sal_Int32 SAL_CALL OResultSet::getInt(sal_Int32 columnIndex)
|
2013-07-18 10:59:11 +02:00
|
|
|
throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-19 11:51:26 +02:00
|
|
|
return safelyRetrieveValue< sal_Int32 >(columnIndex);
|
2013-07-18 18:04:42 +02:00
|
|
|
}
|
2013-05-10 18:21:30 +00:00
|
|
|
|
2013-07-18 18:04:42 +02:00
|
|
|
sal_Int64 SAL_CALL OResultSet::getLong(sal_Int32 columnIndex)
|
|
|
|
throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 11:51:26 +02:00
|
|
|
return safelyRetrieveValue< sal_Int64 >(columnIndex);
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
|
|
|
|
2013-07-18 10:59:11 +02:00
|
|
|
float SAL_CALL OResultSet::getFloat(sal_Int32 columnIndex)
|
|
|
|
throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-19 11:51:26 +02:00
|
|
|
(void) columnIndex;
|
|
|
|
return 0.0f; // TODO: implement
|
|
|
|
// return safelyRetrieveValue(columnIndex);
|
2013-07-18 18:04:42 +02:00
|
|
|
}
|
2013-05-10 18:21:30 +00:00
|
|
|
|
2013-07-18 18:04:42 +02:00
|
|
|
double SAL_CALL OResultSet::getDouble(sal_Int32 columnIndex)
|
|
|
|
throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 11:51:26 +02:00
|
|
|
(void) columnIndex;
|
|
|
|
return 0.0; // TODO: implement
|
|
|
|
// return safelyRetrieveValue(columnIndex);
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
|
|
|
|
2013-07-18 18:04:42 +02:00
|
|
|
// ---- More complex types ---------------------------------------------------
|
|
|
|
OUString SAL_CALL OResultSet::getString(sal_Int32 columnIndex)
|
2013-07-18 10:59:11 +02:00
|
|
|
throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-19 12:16:01 +02:00
|
|
|
return safelyRetrieveValue< OUString >(columnIndex);
|
2013-07-18 18:04:42 +02:00
|
|
|
}
|
2013-05-10 18:21:30 +00:00
|
|
|
|
2013-07-18 18:04:42 +02:00
|
|
|
Time SAL_CALL OResultSet::getTime( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 11:51:26 +02:00
|
|
|
(void) columnIndex;
|
|
|
|
return Time();
|
|
|
|
// return safelyRetrieveValue(columnIndex);
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
|
|
|
|
2013-07-18 18:04:42 +02:00
|
|
|
DateTime SAL_CALL OResultSet::getTimestamp( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-19 11:51:26 +02:00
|
|
|
(void) columnIndex;
|
|
|
|
return DateTime(); // TODO: implement
|
|
|
|
// return safelyRetrieveValue(columnIndex);
|
2013-07-18 18:04:42 +02:00
|
|
|
}
|
2013-05-10 18:21:30 +00:00
|
|
|
|
2013-07-18 18:04:42 +02:00
|
|
|
Date SAL_CALL OResultSet::getDate( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 11:51:26 +02:00
|
|
|
(void) columnIndex;
|
|
|
|
return Date(); // TODO: implement
|
|
|
|
// return safelyRetrieveValue(columnIndex);
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-17 21:03:16 +02:00
|
|
|
uno::Reference< XResultSetMetaData > SAL_CALL OResultSet::getMetaData( ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
if(!m_xMetaData.is())
|
2013-07-19 14:57:12 +02:00
|
|
|
m_xMetaData = new OResultSetMetaData(m_pConnection, m_pSqlda);
|
2013-05-10 18:21:30 +00:00
|
|
|
return m_xMetaData;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-17 21:03:16 +02:00
|
|
|
uno::Reference< XArray > SAL_CALL OResultSet::getArray( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) columnIndex;
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
2013-07-17 21:03:16 +02:00
|
|
|
uno::Reference< XClob > SAL_CALL OResultSet::getClob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) columnIndex;
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
2013-07-21 17:45:08 +02:00
|
|
|
|
|
|
|
uno::Reference< XBlob > SAL_CALL OResultSet::getBlob(sal_Int32 columnIndex)
|
|
|
|
throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
2013-07-21 17:45:08 +02:00
|
|
|
ISC_QUAD* pBlobID = safelyRetrieveValue< ISC_QUAD* >(columnIndex);
|
|
|
|
if (!pBlobID)
|
|
|
|
return 0;
|
|
|
|
return m_pConnection->createBlob(pBlobID);
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
2013-07-17 21:03:16 +02:00
|
|
|
uno::Reference< XRef > SAL_CALL OResultSet::getRef( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) columnIndex;
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
2013-07-17 21:03:16 +02:00
|
|
|
Any SAL_CALL OResultSet::getObject( sal_Int32 columnIndex, const uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) columnIndex;
|
|
|
|
(void) typeMap;
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
return Any();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void SAL_CALL OResultSet::close( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-18 11:23:01 +02:00
|
|
|
SAL_INFO("connectivity.firebird", "close().");
|
2013-05-27 21:06:48 +00:00
|
|
|
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
}
|
|
|
|
dispose();
|
|
|
|
}
|
|
|
|
|
2013-07-17 21:03:16 +02:00
|
|
|
|
2013-07-18 10:59:11 +02:00
|
|
|
uno::Reference< XInterface > SAL_CALL OResultSet::getStatement()
|
|
|
|
throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
2013-07-17 21:03:16 +02:00
|
|
|
return m_xStatement;
|
2013-05-10 18:21:30 +00:00
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
|
|
|
sal_Bool SAL_CALL OResultSet::rowDeleted( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL OResultSet::rowInserted( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL OResultSet::rowUpdated( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
|
|
|
sal_Bool SAL_CALL OResultSet::wasNull( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
|
|
|
|
return m_bWasNull;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void SAL_CALL OResultSet::cancel( ) throw(RuntimeException)
|
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OResultSet::clearWarnings( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
Any SAL_CALL OResultSet::getWarnings( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return Any();
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OResultSet::insertRow( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
// you only have to implement this if you want to insert new rows
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OResultSet::updateRow( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
|
|
|
|
// only when you allow updates
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OResultSet::deleteRow( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void SAL_CALL OResultSet::cancelRowUpdates( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void SAL_CALL OResultSet::moveToInsertRow( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
|
|
|
|
// only when you allow insert's
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void SAL_CALL OResultSet::moveToCurrentRow( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void SAL_CALL OResultSet::updateNull( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) columnIndex;
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void SAL_CALL OResultSet::updateBoolean( sal_Int32 columnIndex, sal_Bool x ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) columnIndex;
|
|
|
|
(void) x;
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OResultSet::updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) columnIndex;
|
|
|
|
(void) x;
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void SAL_CALL OResultSet::updateShort( sal_Int32 columnIndex, sal_Int16 x ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) columnIndex;
|
|
|
|
(void) x;
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OResultSet::updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) columnIndex;
|
|
|
|
(void) x;
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OResultSet::updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) columnIndex;
|
|
|
|
(void) x;
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
void SAL_CALL OResultSet::updateFloat( sal_Int32 columnIndex, float x ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) columnIndex;
|
|
|
|
(void) x;
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void SAL_CALL OResultSet::updateDouble( sal_Int32 columnIndex, double x ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) columnIndex;
|
|
|
|
(void) x;
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-17 21:03:16 +02:00
|
|
|
void SAL_CALL OResultSet::updateString( sal_Int32 columnIndex, const OUString& x ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) columnIndex;
|
|
|
|
(void) x;
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OResultSet::updateBytes( sal_Int32 columnIndex, const Sequence< sal_Int8 >& x ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) columnIndex;
|
|
|
|
(void) x;
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OResultSet::updateDate( sal_Int32 columnIndex, const Date& x ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) columnIndex;
|
|
|
|
(void) x;
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void SAL_CALL OResultSet::updateTime( sal_Int32 columnIndex, const Time& x ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) columnIndex;
|
|
|
|
(void) x;
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void SAL_CALL OResultSet::updateTimestamp( sal_Int32 columnIndex, const DateTime& x ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) columnIndex;
|
|
|
|
(void) x;
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
2013-07-17 21:03:16 +02:00
|
|
|
void SAL_CALL OResultSet::updateBinaryStream( sal_Int32 columnIndex, const uno::Reference< XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) columnIndex;
|
|
|
|
(void) x;
|
|
|
|
(void) length;
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-17 21:03:16 +02:00
|
|
|
void SAL_CALL OResultSet::updateCharacterStream( sal_Int32 columnIndex, const uno::Reference< XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) columnIndex;
|
|
|
|
(void) x;
|
|
|
|
(void) length;
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OResultSet::refreshRow( ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OResultSet::updateObject( sal_Int32 columnIndex, const Any& x ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) columnIndex;
|
|
|
|
(void) x;
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void SAL_CALL OResultSet::updateNumericObject( sal_Int32 columnIndex, const Any& x, sal_Int32 scale ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) columnIndex;
|
|
|
|
(void) x;
|
|
|
|
(void) scale;
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
// XRowLocate
|
|
|
|
Any SAL_CALL OResultSet::getBookmark( ) throw( SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
// if you don't want to support bookmark you must remove the XRowLocate interface
|
|
|
|
|
|
|
|
return Any();
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL OResultSet::moveToBookmark( const Any& bookmark ) throw( SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) bookmark;
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL OResultSet::moveRelativeToBookmark( const Any& bookmark, sal_Int32 rows ) throw( SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) bookmark;
|
|
|
|
(void) rows;
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2013-07-16 10:56:17 +02:00
|
|
|
sal_Int32 SAL_CALL OResultSet::compareBookmarks( const Any& aFirst, const Any& aSecond ) throw( SQLException, RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) aFirst;
|
|
|
|
(void) aSecond;
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
return CompareBookmark::NOT_EQUAL;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL OResultSet::hasOrderedBookmarks( ) throw( SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Int32 SAL_CALL OResultSet::hashBookmark( const Any& bookmark ) throw( SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) bookmark;
|
2013-05-10 18:21:30 +00:00
|
|
|
throw SQLException();
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
// XDeleteRows
|
|
|
|
Sequence< sal_Int32 > SAL_CALL OResultSet::deleteRows( const Sequence< Any >& rows ) throw( SQLException, RuntimeException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) rows;
|
2013-07-19 09:04:36 +02:00
|
|
|
MutexGuard aGuard(m_pConnection->getMutex());
|
2013-05-10 18:21:30 +00:00
|
|
|
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
|
|
|
|
|
|
|
|
return Sequence< sal_Int32 >();
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
IPropertyArrayHelper* OResultSet::createArrayHelper( ) const
|
|
|
|
{
|
|
|
|
Sequence< Property > aProps(6);
|
|
|
|
Property* pProperties = aProps.getArray();
|
|
|
|
sal_Int32 nPos = 0;
|
2013-07-17 21:03:16 +02:00
|
|
|
DECL_PROP1IMPL(CURSORNAME, OUString) PropertyAttribute::READONLY);
|
2013-05-10 18:21:30 +00:00
|
|
|
DECL_PROP0(FETCHDIRECTION, sal_Int32);
|
|
|
|
DECL_PROP0(FETCHSIZE, sal_Int32);
|
|
|
|
DECL_BOOL_PROP1IMPL(ISBOOKMARKABLE) PropertyAttribute::READONLY);
|
|
|
|
DECL_PROP1IMPL(RESULTSETCONCURRENCY,sal_Int32) PropertyAttribute::READONLY);
|
|
|
|
DECL_PROP1IMPL(RESULTSETTYPE, sal_Int32) PropertyAttribute::READONLY);
|
|
|
|
|
|
|
|
return new OPropertyArrayHelper(aProps);
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
IPropertyArrayHelper & OResultSet::getInfoHelper()
|
|
|
|
{
|
|
|
|
return *const_cast<OResultSet*>(this)->getArrayHelper();
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
sal_Bool OResultSet::convertFastPropertyValue(
|
|
|
|
Any & rConvertedValue,
|
|
|
|
Any & rOldValue,
|
|
|
|
sal_Int32 nHandle,
|
|
|
|
const Any& rValue )
|
|
|
|
throw (::com::sun::star::lang::IllegalArgumentException)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) rConvertedValue;
|
|
|
|
(void) rOldValue;
|
|
|
|
(void) rValue;
|
2013-05-10 18:21:30 +00:00
|
|
|
switch(nHandle)
|
|
|
|
{
|
|
|
|
case PROPERTY_ID_ISBOOKMARKABLE:
|
|
|
|
case PROPERTY_ID_CURSORNAME:
|
|
|
|
case PROPERTY_ID_RESULTSETCONCURRENCY:
|
|
|
|
case PROPERTY_ID_RESULTSETTYPE:
|
|
|
|
throw ::com::sun::star::lang::IllegalArgumentException();
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_FETCHDIRECTION:
|
|
|
|
case PROPERTY_ID_FETCHSIZE:
|
|
|
|
default:
|
|
|
|
;
|
|
|
|
}
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
void OResultSet::setFastPropertyValue_NoBroadcast(
|
|
|
|
sal_Int32 nHandle,
|
|
|
|
const Any& rValue
|
|
|
|
)
|
|
|
|
throw (Exception)
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) rValue;
|
2013-05-10 18:21:30 +00:00
|
|
|
switch(nHandle)
|
|
|
|
{
|
|
|
|
case PROPERTY_ID_ISBOOKMARKABLE:
|
|
|
|
case PROPERTY_ID_CURSORNAME:
|
|
|
|
case PROPERTY_ID_RESULTSETCONCURRENCY:
|
|
|
|
case PROPERTY_ID_RESULTSETTYPE:
|
|
|
|
throw Exception();
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_FETCHDIRECTION:
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_FETCHSIZE:
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
void OResultSet::getFastPropertyValue(
|
|
|
|
Any& rValue,
|
|
|
|
sal_Int32 nHandle
|
|
|
|
) const
|
|
|
|
{
|
2013-07-16 10:56:17 +02:00
|
|
|
(void) rValue;
|
2013-05-10 18:21:30 +00:00
|
|
|
switch(nHandle)
|
|
|
|
{
|
|
|
|
case PROPERTY_ID_ISBOOKMARKABLE:
|
|
|
|
case PROPERTY_ID_CURSORNAME:
|
|
|
|
case PROPERTY_ID_RESULTSETCONCURRENCY:
|
|
|
|
case PROPERTY_ID_RESULTSETTYPE:
|
|
|
|
case PROPERTY_ID_FETCHDIRECTION:
|
|
|
|
case PROPERTY_ID_FETCHSIZE:
|
|
|
|
;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OResultSet::acquire() throw()
|
|
|
|
{
|
|
|
|
OResultSet_BASE::acquire();
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OResultSet::release() throw()
|
|
|
|
{
|
|
|
|
OResultSet_BASE::release();
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2013-07-17 21:03:16 +02:00
|
|
|
uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OResultSet::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
|
2013-05-10 18:21:30 +00:00
|
|
|
{
|
|
|
|
return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
2013-07-17 21:03:16 +02:00
|
|
|
// ---- XServiceInfo -----------------------------------------------------------
|
|
|
|
OUString SAL_CALL OResultSet::getImplementationName() throw ( RuntimeException)
|
|
|
|
{
|
|
|
|
return OUString("com.sun.star.sdbcx.firebird.ResultSet");
|
|
|
|
}
|
|
|
|
|
|
|
|
Sequence< OUString > SAL_CALL OResultSet::getSupportedServiceNames()
|
|
|
|
throw( RuntimeException)
|
|
|
|
{
|
|
|
|
Sequence< OUString > aSupported(2);
|
|
|
|
aSupported[0] = OUString("com.sun.star.sdbc.ResultSet");
|
|
|
|
aSupported[1] = OUString("com.sun.star.sdbcx.ResultSet");
|
|
|
|
return aSupported;
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool SAL_CALL OResultSet::supportsService(const OUString& _rServiceName)
|
|
|
|
throw( RuntimeException)
|
|
|
|
{
|
|
|
|
Sequence< OUString > aSupported(getSupportedServiceNames());
|
|
|
|
const OUString* pSupported = aSupported.getConstArray();
|
|
|
|
const OUString* pEnd = pSupported + aSupported.getLength();
|
|
|
|
for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
|
|
|
|
;
|
|
|
|
|
|
|
|
return pSupported != pEnd;
|
|
|
|
}
|
2013-05-10 18:21:30 +00:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|