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: datasourcemetadata.cxx,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 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_dbaccess.hxx"
34 #ifndef DBACCESS_DATASOURCEMETADATA_HXX
35 #include "datasourcemetadata.hxx"
38 /** === begin UNO includes === **/
39 #ifndef _COM_SUN_STAR_LANG_NULLPOINTEREXCEPTION_HPP_
40 #include <com/sun/star/lang/NullPointerException.hpp>
42 /** === end UNO includes === **/
44 #ifndef CONNECTIVITY_INC_CONNECTIVITY_DBMETADATA_HXX
45 #include <connectivity/dbmetadata.hxx>
48 //........................................................................
51 //........................................................................
53 /** === begin UNO using === **/
54 using ::com::sun::star::uno::Reference
;
55 using ::com::sun::star::sdbc::XConnection
;
56 using ::com::sun::star::lang::NullPointerException
;
57 using ::com::sun::star::uno::RuntimeException
;
58 /** === end UNO using === **/
60 //====================================================================
61 //= DataSourceMetaData_Impl
62 //====================================================================
63 struct DataSourceMetaData_Impl
67 //====================================================================
68 //= DataSourceMetaData
69 //====================================================================
70 //--------------------------------------------------------------------
71 DataSourceMetaData::DataSourceMetaData( const ::comphelper::ComponentContext
& _rContext
, const Reference
< XConnection
>& _rxConnection
)
72 :ConnectionDependentComponent( _rContext
)
73 ,m_pImpl( new DataSourceMetaData_Impl
)
75 if ( !_rxConnection
.is() )
76 throw NullPointerException();
77 setWeakConnection( _rxConnection
);
80 //--------------------------------------------------------------------
81 DataSourceMetaData::~DataSourceMetaData()
85 //--------------------------------------------------------------------
86 ::sal_Bool SAL_CALL
DataSourceMetaData::supportsQueriesInFrom( ) throw (RuntimeException
)
88 EntryGuard
aGuard( *this );
89 ::dbtools::DatabaseMetaData
aMeta( getConnection() );
90 return aMeta
.supportsSubqueriesInFrom();
93 //........................................................................
94 } // namespace sdbtools
95 //........................................................................