1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: IEnvironment.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef DBAUI_IENVIRONMENT_HXX
31 #define DBAUI_IENVIRONMENT_HXX
33 #include <com/sun/star/sdbc/SQLException.hpp>
35 #include <connectivity/standardsqlstate.hxx>
39 class SQLExceptionInfo
;
44 // interface class for a generell environment
48 /** appends an error in the current environment.
50 virtual void appendError(
51 const ::rtl::OUString
& _rErrorMessage
,
52 const ::dbtools::StandardSQLState _eSQLState
= ::dbtools::SQL_GENERAL_ERROR
,
53 const sal_Int32 _nErrorCode
= 1000
56 /** clears the error state.
58 virtual void clearError() = 0;
61 returns <TRUE/> when an error was set otherwise <FALSE/>
63 virtual sal_Bool
hasError() const = 0;
65 /** returns the current error
67 virtual const ::dbtools::SQLExceptionInfo
& getError() const = 0;
69 /** displays the current error, or does nothing if there is no current error
71 virtual void displayError() = 0;
73 /** gives access to the currently used connection
75 the currently used connection.
77 virtual const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XConnection
>& getConnection() const = 0;
80 #endif // DBAUI_IENVIRONMENT_HXX