Kaydet (Commit) ac3c24be authored tarafından Miklos Vajna's avatar Miklos Vajna

connectivity writer driver: add PreparedStatement implementation

Gets rid of the stub warnings in OWriterConnection::prepareStatement().

Change-Id: I05db81898d8117578130e660932608fcc927edf0
Reviewed-on: https://gerrit.libreoffice.org/40092Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst a11ddfdc
......@@ -42,6 +42,7 @@ $(eval $(call gb_Library_add_exception_objects,writer,\
connectivity/source/drivers/writer/WConnection \
connectivity/source/drivers/writer/WDatabaseMetaData \
connectivity/source/drivers/writer/WDriver \
connectivity/source/drivers/writer/WPreparedStatement \
connectivity/source/drivers/writer/WTable \
connectivity/source/drivers/writer/WTables \
connectivity/source/drivers/writer/Wservices \
......
......@@ -27,6 +27,7 @@
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
#include <tools/urlobj.hxx>
#include "writer/WPreparedStatement.hxx"
#include <unotools/pathoptions.hxx>
#include <connectivity/dbexception.hxx>
#include <cppuhelper/exc_hlp.hxx>
......@@ -231,14 +232,16 @@ uno::Reference< sdbc::XStatement > SAL_CALL OWriterConnection::createStatement()
}
uno::Reference< sdbc::XPreparedStatement > SAL_CALL OWriterConnection::prepareStatement(const OUString& /*sql*/)
uno::Reference< sdbc::XPreparedStatement > SAL_CALL OWriterConnection::prepareStatement(const OUString& sql)
{
::osl::MutexGuard aGuard(m_aMutex);
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
SAL_WARN("connectivity.writer", "TODO implement OWriterConnection::prepareStatement()");
return nullptr;
OWriterPreparedStatement* pStmt = new OWriterPreparedStatement(this);
uno::Reference<sdbc::XPreparedStatement> xHoldAlive = pStmt;
pStmt->construct(sql);
m_aStatements.push_back(uno::WeakReferenceHelper(*pStmt));
return pStmt;
}
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "writer/WPreparedStatement.hxx"
using namespace com::sun::star;
namespace connectivity
{
namespace writer
{
file::OResultSet* OWriterPreparedStatement::createResultSet()
{
SAL_WARN("connectivity.writer", "TODO implement OWriterPreparedStatement::createResultSet");
return nullptr;
}
IMPLEMENT_SERVICE_INFO(OWriterPreparedStatement,"com.sun.star.sdbc.driver.writer.PreparedStatement", "com.sun.star.sdbc.PreparedStatement");
} // namespace writer
} // namespace connectivity
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_WRITER_WPREPAREDSTATEMENT_HXX
#define INCLUDED_CONNECTIVITY_SOURCE_INC_WRITER_WPREPAREDSTATEMENT_HXX
#include "file/FPreparedStatement.hxx"
namespace connectivity
{
namespace writer
{
class OConnection;
class OWriterPreparedStatement : public file::OPreparedStatement
{
protected:
virtual file::OResultSet* createResultSet() override;
public:
OWriterPreparedStatement(file::OConnection* _pConnection) : file::OPreparedStatement(_pConnection) {}
DECLARE_SERVICE_INFO();
};
} // namespace writer
} // namespace connectivity
#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_WRITER_WPREPAREDSTATEMENT_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment