196de5490SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
396de5490SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
496de5490SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
596de5490SAndrew Rist  * distributed with this work for additional information
696de5490SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
796de5490SAndrew Rist  * to you under the Apache License, Version 2.0 (the
896de5490SAndrew Rist  * "License"); you may not use this file except in compliance
996de5490SAndrew Rist  * with the License.  You may obtain a copy of the License at
1096de5490SAndrew Rist  *
1196de5490SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
1296de5490SAndrew Rist  *
1396de5490SAndrew Rist  * Unless required by applicable law or agreed to in writing,
1496de5490SAndrew Rist  * software distributed under the License is distributed on an
1596de5490SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1696de5490SAndrew Rist  * KIND, either express or implied.  See the License for the
1796de5490SAndrew Rist  * specific language governing permissions and limitations
1896de5490SAndrew Rist  * under the License.
1996de5490SAndrew Rist  *
2096de5490SAndrew Rist  *************************************************************/
2196de5490SAndrew Rist 
2296de5490SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_dbaccess.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "connection.hxx"
28cdf0e10cSrcweir #include "dbastrings.hrc"
29cdf0e10cSrcweir #include "datasource.hxx"
30cdf0e10cSrcweir #include "core_resource.hrc"
31cdf0e10cSrcweir #include "core_resource.hxx"
32cdf0e10cSrcweir #include "statement.hxx"
33cdf0e10cSrcweir #include "preparedstatement.hxx"
34cdf0e10cSrcweir #include "callablestatement.hxx"
35cdf0e10cSrcweir #include "ContainerMediator.hxx"
36cdf0e10cSrcweir #include "SingleSelectQueryComposer.hxx"
37cdf0e10cSrcweir #include "querycomposer.hxx"
38cdf0e10cSrcweir #include "sdbcoretools.hxx"
39cdf0e10cSrcweir 
40cdf0e10cSrcweir /** === begin UNO includes === **/
41cdf0e10cSrcweir #include <com/sun/star/sdb/CommandType.hpp>
42cdf0e10cSrcweir #include <com/sun/star/sdbc/XDriverAccess.hpp>
43cdf0e10cSrcweir #include <com/sun/star/sdbcx/XDataDefinitionSupplier.hpp>
44cdf0e10cSrcweir #include <com/sun/star/reflection/XProxyFactory.hpp>
45cdf0e10cSrcweir #include <com/sun/star/beans/NamedValue.hpp>
46cdf0e10cSrcweir /** === end UNO includes === **/
47cdf0e10cSrcweir #include <connectivity/dbtools.hxx>
48cdf0e10cSrcweir #include <connectivity/dbmetadata.hxx>
49cdf0e10cSrcweir #include <connectivity/dbexception.hxx>
50cdf0e10cSrcweir #include <tools/debug.hxx>
51cdf0e10cSrcweir #include <tools/diagnose_ex.h>
52cdf0e10cSrcweir #include <comphelper/extract.hxx>
53cdf0e10cSrcweir #include <comphelper/uno3.hxx>
54cdf0e10cSrcweir #include <comphelper/sequence.hxx>
55cdf0e10cSrcweir #include <cppuhelper/typeprovider.hxx>
56cdf0e10cSrcweir #include <rtl/logfile.hxx>
57*b63233d8Sdamjan #include "SharedConnection.hxx"
58cdf0e10cSrcweir 
59cdf0e10cSrcweir using namespace ::com::sun::star::uno;
60cdf0e10cSrcweir using namespace ::com::sun::star::lang;
61cdf0e10cSrcweir using namespace ::com::sun::star::util;
62cdf0e10cSrcweir using namespace ::com::sun::star::sdb;
63cdf0e10cSrcweir using namespace ::com::sun::star::sdb::application;
64cdf0e10cSrcweir using namespace ::com::sun::star::sdbc;
65cdf0e10cSrcweir using namespace ::com::sun::star::sdbcx;
66cdf0e10cSrcweir using namespace ::com::sun::star::beans;
67cdf0e10cSrcweir using namespace ::com::sun::star::reflection;
68cdf0e10cSrcweir using namespace ::com::sun::star::container;
69cdf0e10cSrcweir using namespace ::com::sun::star::graphic;
70cdf0e10cSrcweir using namespace ::osl;
71cdf0e10cSrcweir using namespace ::comphelper;
72cdf0e10cSrcweir using namespace ::cppu;
73cdf0e10cSrcweir using namespace ::dbtools;
74cdf0e10cSrcweir 
75cdf0e10cSrcweir using ::com::sun::star::sdb::tools::XTableName;
76cdf0e10cSrcweir using ::com::sun::star::sdb::tools::XObjectNames;
77cdf0e10cSrcweir using ::com::sun::star::sdb::tools::XDataSourceMetaData;
78cdf0e10cSrcweir 
79cdf0e10cSrcweir //........................................................................
80cdf0e10cSrcweir namespace dbaccess
81cdf0e10cSrcweir {
82cdf0e10cSrcweir //........................................................................
83*b63233d8Sdamjan #ifdef IMPLEMENT_GET_IMPLEMENTATION_ID
84*b63233d8Sdamjan 	IMPLEMENT_GET_IMPLEMENTATION_ID( OSharedConnection );
85*b63233d8Sdamjan #endif
86cdf0e10cSrcweir 
87cdf0e10cSrcweir //==========================================================================
88cdf0e10cSrcweir // XServiceInfo
89cdf0e10cSrcweir //------------------------------------------------------------------------------
getImplementationName()90cdf0e10cSrcweir rtl::OUString OConnection::getImplementationName(  ) throw(RuntimeException)
91cdf0e10cSrcweir {
92cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getImplementationName" );
93cdf0e10cSrcweir 	return rtl::OUString::createFromAscii("com.sun.star.comp.dbaccess.Connection");
94cdf0e10cSrcweir }
95cdf0e10cSrcweir //------------------------------------------------------------------------------
supportsService(const::rtl::OUString & _rServiceName)96cdf0e10cSrcweir sal_Bool OConnection::supportsService( const ::rtl::OUString& _rServiceName ) throw (RuntimeException)
97cdf0e10cSrcweir {
98cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::supportsService" );
99cdf0e10cSrcweir 	return findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0;
100cdf0e10cSrcweir }
101cdf0e10cSrcweir 
102cdf0e10cSrcweir //------------------------------------------------------------------------------
getSupportedServiceNames()103cdf0e10cSrcweir Sequence< ::rtl::OUString > OConnection::getSupportedServiceNames(  ) throw (RuntimeException)
104cdf0e10cSrcweir {
105cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getSupportedServiceNames" );
106cdf0e10cSrcweir 	Sequence< ::rtl::OUString > aSupported = OConnectionWrapper::getSupportedServiceNames();
107cdf0e10cSrcweir 
108cdf0e10cSrcweir 	if ( 0 == findValue( aSupported, SERVICE_SDB_CONNECTION, sal_True ).getLength() )
109cdf0e10cSrcweir 	{
110cdf0e10cSrcweir 		sal_Int32 nLen = aSupported.getLength();
111cdf0e10cSrcweir 		aSupported.realloc( nLen + 1 );
112cdf0e10cSrcweir 		aSupported[ nLen ] = SERVICE_SDB_CONNECTION;
113cdf0e10cSrcweir 	}
114cdf0e10cSrcweir 
115cdf0e10cSrcweir 	return aSupported;
116cdf0e10cSrcweir }
117cdf0e10cSrcweir 
118cdf0e10cSrcweir // XCloseable
119cdf0e10cSrcweir //------------------------------------------------------------------------------
close(void)120cdf0e10cSrcweir void OConnection::close(void) throw( SQLException, RuntimeException )
121cdf0e10cSrcweir {
122cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::close" );
123cdf0e10cSrcweir 	// being closed is the same as being disposed
124cdf0e10cSrcweir 	dispose();
125cdf0e10cSrcweir }
126cdf0e10cSrcweir 
127cdf0e10cSrcweir //------------------------------------------------------------------------------
isClosed(void)128cdf0e10cSrcweir sal_Bool OConnection::isClosed(void) throw( SQLException, RuntimeException )
129cdf0e10cSrcweir {
130cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::isClosed" );
131cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
132cdf0e10cSrcweir 	return !m_xMasterConnection.is();
133cdf0e10cSrcweir }
134cdf0e10cSrcweir 
135cdf0e10cSrcweir // XConnection
136cdf0e10cSrcweir //------------------------------------------------------------------------------
createStatement(void)137cdf0e10cSrcweir Reference< XStatement >  OConnection::createStatement(void) throw( SQLException, RuntimeException )
138cdf0e10cSrcweir {
139cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::createStatement" );
140cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
141cdf0e10cSrcweir 	checkDisposed();
142cdf0e10cSrcweir 
143cdf0e10cSrcweir 	Reference< XStatement > xStatement;
144cdf0e10cSrcweir 	Reference< XStatement > xMasterStatement = m_xMasterConnection->createStatement();
145cdf0e10cSrcweir 	if ( xMasterStatement.is() )
146cdf0e10cSrcweir 	{
147cdf0e10cSrcweir 		xStatement = new OStatement(this, xMasterStatement);
148cdf0e10cSrcweir 		m_aStatements.push_back(WeakReferenceHelper(xStatement));
149cdf0e10cSrcweir 	}
150cdf0e10cSrcweir 	return xStatement;
151cdf0e10cSrcweir }
152cdf0e10cSrcweir //------------------------------------------------------------------------------
prepareStatement(const rtl::OUString & sql)153cdf0e10cSrcweir Reference< XPreparedStatement >  OConnection::prepareStatement(const rtl::OUString& sql) throw( SQLException, RuntimeException )
154cdf0e10cSrcweir {
155cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::prepareStatement" );
156cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
157cdf0e10cSrcweir 	checkDisposed();
158cdf0e10cSrcweir 
159cdf0e10cSrcweir 	// TODO convert the SQL to SQL the driver understands
160cdf0e10cSrcweir 	Reference< XPreparedStatement > xStatement;
161cdf0e10cSrcweir 	Reference< XPreparedStatement > xMasterStatement = m_xMasterConnection->prepareStatement(sql);
162cdf0e10cSrcweir 	if ( xMasterStatement.is() )
163cdf0e10cSrcweir 	{
164cdf0e10cSrcweir 		xStatement = new OPreparedStatement(this, xMasterStatement);
165cdf0e10cSrcweir 		m_aStatements.push_back(WeakReferenceHelper(xStatement));
166cdf0e10cSrcweir 	}
167cdf0e10cSrcweir 	return xStatement;
168cdf0e10cSrcweir }
169cdf0e10cSrcweir 
170cdf0e10cSrcweir //------------------------------------------------------------------------------
prepareCall(const rtl::OUString & sql)171cdf0e10cSrcweir Reference< XPreparedStatement >  OConnection::prepareCall(const rtl::OUString& sql) throw( SQLException, RuntimeException )
172cdf0e10cSrcweir {
173cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::prepareCall" );
174cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
175cdf0e10cSrcweir 	checkDisposed();
176cdf0e10cSrcweir 
177cdf0e10cSrcweir 	Reference< XPreparedStatement > xStatement;
178cdf0e10cSrcweir 	Reference< XPreparedStatement > xMasterStatement = m_xMasterConnection->prepareCall(sql);
179cdf0e10cSrcweir 	if ( xMasterStatement.is() )
180cdf0e10cSrcweir 	{
181cdf0e10cSrcweir 		xStatement = new OCallableStatement(this, xMasterStatement);
182cdf0e10cSrcweir 		m_aStatements.push_back(WeakReferenceHelper(xStatement));
183cdf0e10cSrcweir 	}
184cdf0e10cSrcweir 	return xStatement;
185cdf0e10cSrcweir }
186cdf0e10cSrcweir 
187cdf0e10cSrcweir //------------------------------------------------------------------------------
nativeSQL(const rtl::OUString & sql)188cdf0e10cSrcweir rtl::OUString OConnection::nativeSQL(const rtl::OUString& sql) throw( SQLException, RuntimeException )
189cdf0e10cSrcweir {
190cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::nativeSQL" );
191cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
192cdf0e10cSrcweir 	checkDisposed();
193cdf0e10cSrcweir 	return m_xMasterConnection->nativeSQL(sql);
194cdf0e10cSrcweir }
195cdf0e10cSrcweir 
196cdf0e10cSrcweir //------------------------------------------------------------------------------
setAutoCommit(sal_Bool autoCommit)197cdf0e10cSrcweir void OConnection::setAutoCommit(sal_Bool autoCommit) throw( SQLException, RuntimeException )
198cdf0e10cSrcweir {
199cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::setAutoCommit" );
200cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
201cdf0e10cSrcweir 	checkDisposed();
202cdf0e10cSrcweir 	m_xMasterConnection->setAutoCommit(autoCommit);
203cdf0e10cSrcweir }
204cdf0e10cSrcweir 
205cdf0e10cSrcweir //------------------------------------------------------------------------------
getAutoCommit(void)206cdf0e10cSrcweir sal_Bool OConnection::getAutoCommit(void) throw( SQLException, RuntimeException )
207cdf0e10cSrcweir {
208cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getAutoCommit" );
209cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
210cdf0e10cSrcweir 	checkDisposed();
211cdf0e10cSrcweir 	return m_xMasterConnection->getAutoCommit();
212cdf0e10cSrcweir }
213cdf0e10cSrcweir 
214cdf0e10cSrcweir //------------------------------------------------------------------------------
commit(void)215cdf0e10cSrcweir void OConnection::commit(void) throw( SQLException, RuntimeException )
216cdf0e10cSrcweir {
217cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::commit" );
218cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
219cdf0e10cSrcweir 	checkDisposed();
220cdf0e10cSrcweir 	m_xMasterConnection->commit();
221cdf0e10cSrcweir }
222cdf0e10cSrcweir 
223cdf0e10cSrcweir //------------------------------------------------------------------------------
rollback(void)224cdf0e10cSrcweir void OConnection::rollback(void) throw( SQLException, RuntimeException )
225cdf0e10cSrcweir {
226cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::rollback" );
227cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
228cdf0e10cSrcweir 	checkDisposed();
229cdf0e10cSrcweir 	m_xMasterConnection->rollback();
230cdf0e10cSrcweir }
231cdf0e10cSrcweir 
232cdf0e10cSrcweir //------------------------------------------------------------------------------
getMetaData(void)233cdf0e10cSrcweir Reference< XDatabaseMetaData >  OConnection::getMetaData(void) throw( SQLException, RuntimeException )
234cdf0e10cSrcweir {
235cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getMetaData" );
236cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
237cdf0e10cSrcweir 	checkDisposed();
238cdf0e10cSrcweir 	return m_xMasterConnection->getMetaData();
239cdf0e10cSrcweir }
240cdf0e10cSrcweir 
241cdf0e10cSrcweir //------------------------------------------------------------------------------
setReadOnly(sal_Bool readOnly)242cdf0e10cSrcweir void OConnection::setReadOnly(sal_Bool readOnly) throw( SQLException, RuntimeException )
243cdf0e10cSrcweir {
244cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::setReadOnly" );
245cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
246cdf0e10cSrcweir 	checkDisposed();
247cdf0e10cSrcweir 	m_xMasterConnection->setReadOnly(readOnly);
248cdf0e10cSrcweir }
249cdf0e10cSrcweir 
250cdf0e10cSrcweir //------------------------------------------------------------------------------
isReadOnly(void)251cdf0e10cSrcweir sal_Bool OConnection::isReadOnly(void) throw( SQLException, RuntimeException )
252cdf0e10cSrcweir {
253cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::isReadOnly" );
254cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
255cdf0e10cSrcweir 	checkDisposed();
256cdf0e10cSrcweir 	return m_xMasterConnection->isReadOnly();
257cdf0e10cSrcweir }
258cdf0e10cSrcweir 
259cdf0e10cSrcweir //------------------------------------------------------------------------------
setCatalog(const rtl::OUString & catalog)260cdf0e10cSrcweir void OConnection::setCatalog(const rtl::OUString& catalog) throw( SQLException, RuntimeException )
261cdf0e10cSrcweir {
262cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::setCatalog" );
263cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
264cdf0e10cSrcweir 	checkDisposed();
265cdf0e10cSrcweir 	m_xMasterConnection->setCatalog(catalog);
266cdf0e10cSrcweir }
267cdf0e10cSrcweir 
268cdf0e10cSrcweir //------------------------------------------------------------------------------
getCatalog(void)269cdf0e10cSrcweir rtl::OUString OConnection::getCatalog(void) throw( SQLException, RuntimeException )
270cdf0e10cSrcweir {
271cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getCatalog" );
272cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
273cdf0e10cSrcweir 	checkDisposed();
274cdf0e10cSrcweir 	return m_xMasterConnection->getCatalog();
275cdf0e10cSrcweir }
276cdf0e10cSrcweir 
277cdf0e10cSrcweir //------------------------------------------------------------------------------
setTransactionIsolation(sal_Int32 level)278cdf0e10cSrcweir void OConnection::setTransactionIsolation(sal_Int32 level) throw( SQLException, RuntimeException )
279cdf0e10cSrcweir {
280cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::setTransactionIsolation" );
281cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
282cdf0e10cSrcweir 	checkDisposed();
283cdf0e10cSrcweir 	m_xMasterConnection->setTransactionIsolation(level);
284cdf0e10cSrcweir }
285cdf0e10cSrcweir 
286cdf0e10cSrcweir //------------------------------------------------------------------------------
getTransactionIsolation(void)287cdf0e10cSrcweir sal_Int32 OConnection::getTransactionIsolation(void) throw( SQLException, RuntimeException )
288cdf0e10cSrcweir {
289cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getTransactionIsolation" );
290cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
291cdf0e10cSrcweir 	checkDisposed();
292cdf0e10cSrcweir 	return m_xMasterConnection->getTransactionIsolation();
293cdf0e10cSrcweir }
294cdf0e10cSrcweir 
295cdf0e10cSrcweir //------------------------------------------------------------------------------
getTypeMap(void)296cdf0e10cSrcweir Reference< XNameAccess >  OConnection::getTypeMap(void) throw( SQLException, RuntimeException )
297cdf0e10cSrcweir {
298cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getTypeMap" );
299cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
300cdf0e10cSrcweir 	checkDisposed();
301cdf0e10cSrcweir 	return m_xMasterConnection->getTypeMap();
302cdf0e10cSrcweir }
303cdf0e10cSrcweir 
304cdf0e10cSrcweir //------------------------------------------------------------------------------
setTypeMap(const Reference<XNameAccess> & typeMap)305cdf0e10cSrcweir void OConnection::setTypeMap(const Reference< XNameAccess > & typeMap) throw( SQLException, RuntimeException )
306cdf0e10cSrcweir {
307cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::setTypeMap" );
308cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
309cdf0e10cSrcweir 	checkDisposed();
310cdf0e10cSrcweir 	m_xMasterConnection->setTypeMap(typeMap);
311cdf0e10cSrcweir }
312cdf0e10cSrcweir //==========================================================================
313cdf0e10cSrcweir //= OConnection
314cdf0e10cSrcweir //==========================================================================
DBG_NAME(OConnection)315cdf0e10cSrcweir DBG_NAME(OConnection)
316cdf0e10cSrcweir //--------------------------------------------------------------------------
317cdf0e10cSrcweir OConnection::OConnection(ODatabaseSource& _rDB
318cdf0e10cSrcweir 						 , Reference< XConnection >& _rxMaster
319cdf0e10cSrcweir 						 , const Reference< XMultiServiceFactory >& _rxORB)
320cdf0e10cSrcweir 			:OSubComponent(m_aMutex, static_cast< OWeakObject* >(&_rDB))
321cdf0e10cSrcweir 				// as the queries reroute their refcounting to us, this m_aMutex is okey. If the queries
32207a3d7f1SPedro Giffuni 				// container would do it's own refcounting, it would have to acquire m_pMutex
323cdf0e10cSrcweir 				// same for tables
324cdf0e10cSrcweir 			,m_aTableFilter(_rDB.m_pImpl->m_aTableFilter)
325cdf0e10cSrcweir 			,m_aTableTypeFilter(_rDB.m_pImpl->m_aTableTypeFilter)
326cdf0e10cSrcweir 			,m_aContext( _rxORB )
327cdf0e10cSrcweir 			,m_xMasterConnection(_rxMaster)
328cdf0e10cSrcweir 			,m_pTables(NULL)
329cdf0e10cSrcweir 			,m_pViews(NULL)
330cdf0e10cSrcweir             ,m_aWarnings( Reference< XWarningsSupplier >( _rxMaster, UNO_QUERY ) )
331cdf0e10cSrcweir             ,m_nInAppend(0)
332cdf0e10cSrcweir 			,m_bSupportsViews(sal_False)
333cdf0e10cSrcweir 			,m_bSupportsUsers(sal_False)
334cdf0e10cSrcweir 			,m_bSupportsGroups(sal_False)
335cdf0e10cSrcweir {
336cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::OConnection" );
337cdf0e10cSrcweir 	DBG_CTOR(OConnection,NULL);
338cdf0e10cSrcweir 	osl_incrementInterlockedCount(&m_refCount);
339cdf0e10cSrcweir 
340cdf0e10cSrcweir 	try
341cdf0e10cSrcweir 	{
342cdf0e10cSrcweir 		Reference< XProxyFactory > xProxyFactory(
343cdf0e10cSrcweir 				_rxORB->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.ProxyFactory"))),UNO_QUERY);
344cdf0e10cSrcweir 		Reference<XAggregation> xAgg = xProxyFactory->createProxy(_rxMaster.get());
345cdf0e10cSrcweir 		setDelegation(xAgg,m_refCount);
346cdf0e10cSrcweir 		DBG_ASSERT(m_xConnection.is(), "OConnection::OConnection : invalid master connection !");
347cdf0e10cSrcweir 	}
348cdf0e10cSrcweir 	catch(const Exception&)
349cdf0e10cSrcweir 	{
350cdf0e10cSrcweir         DBG_UNHANDLED_EXCEPTION();
351cdf0e10cSrcweir 	}
352cdf0e10cSrcweir 
353cdf0e10cSrcweir     m_xTableUIProvider = m_xTableUIProvider.query( m_xMasterConnection );
354cdf0e10cSrcweir 
355cdf0e10cSrcweir 	try
356cdf0e10cSrcweir 	{
357cdf0e10cSrcweir 		m_xQueries = new OQueryContainer(Reference< XNameContainer >(_rDB.getQueryDefinitions( ),UNO_QUERY), this,_rxORB, &m_aWarnings);
358cdf0e10cSrcweir 
359cdf0e10cSrcweir 		sal_Bool bCase = sal_True;
360cdf0e10cSrcweir 		Reference<XDatabaseMetaData> xMeta;
361cdf0e10cSrcweir 		try
362cdf0e10cSrcweir 		{
363cdf0e10cSrcweir 			xMeta = getMetaData();
364cdf0e10cSrcweir 			bCase = xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers();
365cdf0e10cSrcweir 		}
366cdf0e10cSrcweir 		catch(SQLException&)
367cdf0e10cSrcweir 		{
368cdf0e10cSrcweir 		}
369cdf0e10cSrcweir 		Reference< XNameContainer > xTableDefinitions(_rDB.getTables(),UNO_QUERY);
370cdf0e10cSrcweir 		m_pTables = new OTableContainer( *this, m_aMutex, this, bCase, xTableDefinitions, this, &m_aWarnings,m_nInAppend );
371cdf0e10cSrcweir 
372cdf0e10cSrcweir 		// check if we supports types
373cdf0e10cSrcweir 		if ( xMeta.is() )
374cdf0e10cSrcweir 		{
375cdf0e10cSrcweir 			Reference<XResultSet> xRes = xMeta->getTableTypes();
376cdf0e10cSrcweir 			if(xRes.is())
377cdf0e10cSrcweir 			{
378cdf0e10cSrcweir 				::rtl::OUString sView(RTL_CONSTASCII_USTRINGPARAM("VIEW"));
379cdf0e10cSrcweir 				Reference<XRow> xRow(xRes,UNO_QUERY);
380cdf0e10cSrcweir 				while(xRes->next())
381cdf0e10cSrcweir 				{
382cdf0e10cSrcweir 					::rtl::OUString sValue = xRow->getString(1);
383cdf0e10cSrcweir 					if( !xRow->wasNull() && sValue == sView)
384cdf0e10cSrcweir 					{
385cdf0e10cSrcweir 						m_bSupportsViews = sal_True;
386cdf0e10cSrcweir 						break;
387cdf0e10cSrcweir 					}
388cdf0e10cSrcweir 				}
389cdf0e10cSrcweir 			}
390cdf0e10cSrcweir 			// some dbs don't support this type so we should ask if a XViewsSupplier is supported
391cdf0e10cSrcweir 			if(!m_bSupportsViews)
392cdf0e10cSrcweir 			{
393cdf0e10cSrcweir 				Reference< XViewsSupplier > xMaster(getMasterTables(),UNO_QUERY);
394cdf0e10cSrcweir 
395cdf0e10cSrcweir 				if (xMaster.is() && xMaster->getViews().is())
396cdf0e10cSrcweir 					m_bSupportsViews = sal_True;
397cdf0e10cSrcweir 			}
398cdf0e10cSrcweir 			if(m_bSupportsViews)
399cdf0e10cSrcweir 			{
400cdf0e10cSrcweir 				m_pViews = new OViewContainer(*this, m_aMutex, this, bCase,this,&m_aWarnings,m_nInAppend);
401cdf0e10cSrcweir 				m_pViews->addContainerListener(m_pTables);
402cdf0e10cSrcweir 				m_pTables->addContainerListener(m_pViews);
403cdf0e10cSrcweir 			}
404cdf0e10cSrcweir 			m_bSupportsUsers = Reference< XUsersSupplier> (getMasterTables(),UNO_QUERY).is();
405cdf0e10cSrcweir 			m_bSupportsGroups = Reference< XGroupsSupplier> (getMasterTables(),UNO_QUERY).is();
406cdf0e10cSrcweir 
407cdf0e10cSrcweir             impl_checkTableQueryNames_nothrow();
408cdf0e10cSrcweir 		}
409cdf0e10cSrcweir 	}
410cdf0e10cSrcweir 	catch(const Exception& )
411cdf0e10cSrcweir 	{
412cdf0e10cSrcweir         DBG_UNHANDLED_EXCEPTION();
413cdf0e10cSrcweir 	}
414cdf0e10cSrcweir 	osl_decrementInterlockedCount( &m_refCount );
415cdf0e10cSrcweir }
416cdf0e10cSrcweir 
417cdf0e10cSrcweir //--------------------------------------------------------------------------
~OConnection()418cdf0e10cSrcweir OConnection::~OConnection()
419cdf0e10cSrcweir {
420cdf0e10cSrcweir 	delete m_pTables;
421cdf0e10cSrcweir 	delete m_pViews;
422cdf0e10cSrcweir 	DBG_DTOR(OConnection,NULL);
423cdf0e10cSrcweir }
424cdf0e10cSrcweir 
425cdf0e10cSrcweir 
426cdf0e10cSrcweir // XWarningsSupplier
427cdf0e10cSrcweir //--------------------------------------------------------------------------
getWarnings()428cdf0e10cSrcweir Any SAL_CALL OConnection::getWarnings() throw(SQLException, RuntimeException)
429cdf0e10cSrcweir {
430cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getWarnings" );
431cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
432cdf0e10cSrcweir 	checkDisposed();
433cdf0e10cSrcweir     return m_aWarnings.getWarnings();
434cdf0e10cSrcweir }
435cdf0e10cSrcweir 
436cdf0e10cSrcweir //--------------------------------------------------------------------------
clearWarnings()437cdf0e10cSrcweir void SAL_CALL OConnection::clearWarnings(  ) throw(SQLException, RuntimeException)
438cdf0e10cSrcweir {
439cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::clearWarnings" );
440cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
441cdf0e10cSrcweir 	checkDisposed();
442cdf0e10cSrcweir     m_aWarnings.clearWarnings();
443cdf0e10cSrcweir }
444cdf0e10cSrcweir 
445cdf0e10cSrcweir //--------------------------------------------------------------------------
446cdf0e10cSrcweir namespace
447cdf0e10cSrcweir {
448cdf0e10cSrcweir     struct CompareTypeByName : public ::std::binary_function< Type, Type, bool >
449cdf0e10cSrcweir     {
operator ()dbaccess::__anon20fe79c20111::CompareTypeByName450cdf0e10cSrcweir         bool operator() ( const Type& _rLHS, const Type& _rRHS ) const
451cdf0e10cSrcweir         {
452cdf0e10cSrcweir             return _rLHS.getTypeName() < _rRHS.getTypeName();
453cdf0e10cSrcweir         }
454cdf0e10cSrcweir     };
455cdf0e10cSrcweir     typedef ::std::set< Type, CompareTypeByName > TypeBag;
456cdf0e10cSrcweir 
lcl_copyTypes(TypeBag & _out_rTypes,const Sequence<Type> & _rTypes)457cdf0e10cSrcweir     void lcl_copyTypes( TypeBag& _out_rTypes, const Sequence< Type >& _rTypes )
458cdf0e10cSrcweir     {
459cdf0e10cSrcweir         ::std::copy( _rTypes.getConstArray(), _rTypes.getConstArray() + _rTypes.getLength(),
460cdf0e10cSrcweir             ::std::insert_iterator< TypeBag >( _out_rTypes, _out_rTypes.begin() ) );
461cdf0e10cSrcweir     }
462cdf0e10cSrcweir }
463cdf0e10cSrcweir // com::sun::star::lang::XTypeProvider
464cdf0e10cSrcweir //--------------------------------------------------------------------------
getTypes()465cdf0e10cSrcweir Sequence< Type > OConnection::getTypes() throw (RuntimeException)
466cdf0e10cSrcweir {
467cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getTypes" );
468cdf0e10cSrcweir     TypeBag aNormalizedTypes;
469cdf0e10cSrcweir 
470cdf0e10cSrcweir     lcl_copyTypes( aNormalizedTypes, OSubComponent::getTypes() );
471cdf0e10cSrcweir     lcl_copyTypes( aNormalizedTypes, OConnection_Base::getTypes() );
472cdf0e10cSrcweir     lcl_copyTypes( aNormalizedTypes, ::connectivity::OConnectionWrapper::getTypes() );
473cdf0e10cSrcweir 
474cdf0e10cSrcweir     if ( !m_bSupportsViews )
475cdf0e10cSrcweir         aNormalizedTypes.erase( XViewsSupplier::static_type() );
476cdf0e10cSrcweir     if ( !m_bSupportsUsers )
477cdf0e10cSrcweir         aNormalizedTypes.erase( XUsersSupplier::static_type() );
478cdf0e10cSrcweir     if ( !m_bSupportsGroups )
479cdf0e10cSrcweir         aNormalizedTypes.erase( XGroupsSupplier::static_type() );
480cdf0e10cSrcweir 
481cdf0e10cSrcweir     Sequence< Type > aSupportedTypes( aNormalizedTypes.size() );
482cdf0e10cSrcweir     ::std::copy( aNormalizedTypes.begin(), aNormalizedTypes.end(), aSupportedTypes.getArray() );
483cdf0e10cSrcweir 	return aSupportedTypes;
484cdf0e10cSrcweir }
485cdf0e10cSrcweir 
486cdf0e10cSrcweir //--------------------------------------------------------------------------
getImplementationId()487cdf0e10cSrcweir Sequence< sal_Int8 > OConnection::getImplementationId() throw (RuntimeException)
488cdf0e10cSrcweir {
489cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getImplementationId" );
490cdf0e10cSrcweir 	return getUnoTunnelImplementationId();
491cdf0e10cSrcweir }
492cdf0e10cSrcweir 
493cdf0e10cSrcweir // com::sun::star::uno::XInterface
494cdf0e10cSrcweir //--------------------------------------------------------------------------
queryInterface(const Type & rType)495cdf0e10cSrcweir Any OConnection::queryInterface( const Type & rType ) throw (RuntimeException)
496cdf0e10cSrcweir {
497cdf0e10cSrcweir     if ( !m_bSupportsViews && rType.equals( XViewsSupplier::static_type() ) )
498cdf0e10cSrcweir 		return Any();
499cdf0e10cSrcweir 	else if ( !m_bSupportsUsers && rType.equals( XUsersSupplier::static_type() ) )
500cdf0e10cSrcweir 		return Any();
501cdf0e10cSrcweir 	else if ( !m_bSupportsGroups && rType.equals( XGroupsSupplier::static_type() ) )
502cdf0e10cSrcweir 		return Any();
503cdf0e10cSrcweir 	Any aReturn = OSubComponent::queryInterface( rType );
504cdf0e10cSrcweir 	if (!aReturn.hasValue())
505cdf0e10cSrcweir 	{
506cdf0e10cSrcweir 		aReturn = OConnection_Base::queryInterface( rType );
507cdf0e10cSrcweir 		if (!aReturn.hasValue())
508cdf0e10cSrcweir 			aReturn = OConnectionWrapper::queryInterface( rType );
509cdf0e10cSrcweir 	}
510cdf0e10cSrcweir 	return aReturn;
511cdf0e10cSrcweir }
512cdf0e10cSrcweir 
513cdf0e10cSrcweir //--------------------------------------------------------------------------
acquire()514cdf0e10cSrcweir void OConnection::acquire() throw ()
515cdf0e10cSrcweir {
516cdf0e10cSrcweir     // include this one when you want to see who calls it (call graph)
517cdf0e10cSrcweir     //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::acquire" );
518cdf0e10cSrcweir 	OSubComponent::acquire();
519cdf0e10cSrcweir }
520cdf0e10cSrcweir 
521cdf0e10cSrcweir //--------------------------------------------------------------------------
release()522cdf0e10cSrcweir void OConnection::release() throw ()
523cdf0e10cSrcweir {
524cdf0e10cSrcweir     // include this one when you want to see who calls it (call graph)
525cdf0e10cSrcweir     //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::release" );
526cdf0e10cSrcweir 	OSubComponent::release();
527cdf0e10cSrcweir }
528cdf0e10cSrcweir 
529cdf0e10cSrcweir // OSubComponent
530cdf0e10cSrcweir //------------------------------------------------------------------------------
disposing()531cdf0e10cSrcweir void OConnection::disposing()
532cdf0e10cSrcweir {
533cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::disposing" );
534cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
535cdf0e10cSrcweir 
536cdf0e10cSrcweir 	OSubComponent::disposing();
537cdf0e10cSrcweir 	OConnectionWrapper::disposing();
538cdf0e10cSrcweir 
539cdf0e10cSrcweir     OWeakRefArrayIterator aEnd = m_aStatements.end();
540cdf0e10cSrcweir 	for (OWeakRefArrayIterator i = m_aStatements.begin(); aEnd != i; ++i)
541cdf0e10cSrcweir 	{
542cdf0e10cSrcweir 		Reference<XComponent> xComp(i->get(),UNO_QUERY);
543cdf0e10cSrcweir 		::comphelper::disposeComponent(xComp);
544cdf0e10cSrcweir 	}
545cdf0e10cSrcweir 	m_aStatements.clear();
546cdf0e10cSrcweir 	m_xMasterTables = NULL;
547cdf0e10cSrcweir 
548cdf0e10cSrcweir 	if(m_pTables)
549cdf0e10cSrcweir 		m_pTables->dispose();
550cdf0e10cSrcweir 	if(m_pViews)
551cdf0e10cSrcweir 		m_pViews->dispose();
552cdf0e10cSrcweir 
553cdf0e10cSrcweir 	::comphelper::disposeComponent(m_xQueries);
554cdf0e10cSrcweir 
555cdf0e10cSrcweir     OWeakRefArrayIterator aComposerEnd = m_aComposers.end();
556cdf0e10cSrcweir 	for (OWeakRefArrayIterator j = m_aComposers.begin(); aComposerEnd != j; ++j)
557cdf0e10cSrcweir 	{
558cdf0e10cSrcweir 		Reference<XComponent> xComp(j->get(),UNO_QUERY);
559cdf0e10cSrcweir 		::comphelper::disposeComponent(xComp);
560cdf0e10cSrcweir 	}
561cdf0e10cSrcweir 
562cdf0e10cSrcweir 	m_aComposers.clear();
563cdf0e10cSrcweir 
564cdf0e10cSrcweir 	try
565cdf0e10cSrcweir 	{
566cdf0e10cSrcweir 		if (m_xMasterConnection.is())
567cdf0e10cSrcweir 			m_xMasterConnection->close();
568cdf0e10cSrcweir 	}
569cdf0e10cSrcweir 	catch(Exception)
570cdf0e10cSrcweir 	{
571cdf0e10cSrcweir 	}
572cdf0e10cSrcweir 	m_xMasterConnection = NULL;
573cdf0e10cSrcweir }
574cdf0e10cSrcweir 
575cdf0e10cSrcweir // XChild
576cdf0e10cSrcweir //------------------------------------------------------------------------------
getParent(void)577cdf0e10cSrcweir Reference< XInterface >  OConnection::getParent(void) throw( RuntimeException )
578cdf0e10cSrcweir {
579cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getParent" );
580cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
581cdf0e10cSrcweir 	checkDisposed();
582cdf0e10cSrcweir 	return m_xParent;
583cdf0e10cSrcweir }
584cdf0e10cSrcweir 
585cdf0e10cSrcweir //------------------------------------------------------------------------------
setParent(const Reference<XInterface> &)586cdf0e10cSrcweir void OConnection::setParent(const Reference< XInterface > & /*Parent*/) throw( NoSupportException, RuntimeException )
587cdf0e10cSrcweir {
588cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::setParent" );
589cdf0e10cSrcweir 	throw NoSupportException();
590cdf0e10cSrcweir }
591cdf0e10cSrcweir 
592cdf0e10cSrcweir // XSQLQueryComposerFactory
593cdf0e10cSrcweir //------------------------------------------------------------------------------
createQueryComposer(void)594cdf0e10cSrcweir Reference< XSQLQueryComposer >  OConnection::createQueryComposer(void) throw( RuntimeException )
595cdf0e10cSrcweir {
596cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::createQueryComposer" );
597cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
598cdf0e10cSrcweir 	checkDisposed();
599cdf0e10cSrcweir 
600cdf0e10cSrcweir 	//	Reference< XNumberFormatsSupplier >  xSupplier = pParent->getNumberFormatsSupplier();
601cdf0e10cSrcweir 	Reference< XSQLQueryComposer >  xComposer( new OQueryComposer( this ) );
602cdf0e10cSrcweir 	m_aComposers.push_back(WeakReferenceHelper(xComposer));
603cdf0e10cSrcweir 	return xComposer;
604cdf0e10cSrcweir }
605cdf0e10cSrcweir // -----------------------------------------------------------------------------
impl_fillTableFilter()606cdf0e10cSrcweir void OConnection::impl_fillTableFilter()
607cdf0e10cSrcweir {
608cdf0e10cSrcweir     Reference<XPropertySet> xProp(getParent(),UNO_QUERY);
609cdf0e10cSrcweir     if ( xProp.is() )
610cdf0e10cSrcweir     {
611cdf0e10cSrcweir         xProp->getPropertyValue(PROPERTY_TABLEFILTER)       >>= m_aTableFilter;
612cdf0e10cSrcweir         xProp->getPropertyValue(PROPERTY_TABLETYPEFILTER)   >>= m_aTableTypeFilter;
613cdf0e10cSrcweir     }
614cdf0e10cSrcweir }
615cdf0e10cSrcweir 
616cdf0e10cSrcweir // -----------------------------------------------------------------------------
refresh(const Reference<XNameAccess> & _rToBeRefreshed)617cdf0e10cSrcweir void OConnection::refresh(const Reference< XNameAccess >& _rToBeRefreshed)
618cdf0e10cSrcweir {
619cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::refresh" );
620cdf0e10cSrcweir 	if ( _rToBeRefreshed == Reference< XNameAccess >(m_pTables) )
621cdf0e10cSrcweir 	{
622cdf0e10cSrcweir 		if (m_pTables && !m_pTables->isInitialized())
623cdf0e10cSrcweir 		{
624cdf0e10cSrcweir             impl_fillTableFilter();
625cdf0e10cSrcweir 			// check if our "master connection" can supply tables
626cdf0e10cSrcweir 			getMasterTables();
627cdf0e10cSrcweir 
628cdf0e10cSrcweir 			if (m_xMasterTables.is() && m_xMasterTables->getTables().is())
629cdf0e10cSrcweir 			{	// yes -> wrap them
630cdf0e10cSrcweir 				m_pTables->construct(m_xMasterTables->getTables(),m_aTableFilter, m_aTableTypeFilter);
631cdf0e10cSrcweir 			}
632cdf0e10cSrcweir 			else
633cdf0e10cSrcweir 			{	// no -> use an own container
634cdf0e10cSrcweir 				m_pTables->construct(m_aTableFilter, m_aTableTypeFilter);
635cdf0e10cSrcweir 			}
636cdf0e10cSrcweir 		}
637cdf0e10cSrcweir 	}
638cdf0e10cSrcweir 	else if ( _rToBeRefreshed == Reference< XNameAccess >(m_pViews) )
639cdf0e10cSrcweir 	{
640cdf0e10cSrcweir 		if (m_pViews && !m_pViews->isInitialized())
641cdf0e10cSrcweir 		{
642cdf0e10cSrcweir             impl_fillTableFilter();
643cdf0e10cSrcweir 			// check if our "master connection" can supply tables
644cdf0e10cSrcweir 			Reference< XViewsSupplier > xMaster(getMasterTables(),UNO_QUERY);
645cdf0e10cSrcweir 
646cdf0e10cSrcweir 			if (xMaster.is() && xMaster->getViews().is())
647cdf0e10cSrcweir 				m_pViews->construct(xMaster->getViews(),m_aTableFilter, m_aTableTypeFilter);
648cdf0e10cSrcweir 			else
649cdf0e10cSrcweir 				m_pViews->construct(m_aTableFilter, m_aTableTypeFilter);
650cdf0e10cSrcweir 		}
651cdf0e10cSrcweir 	}
652cdf0e10cSrcweir }
653cdf0e10cSrcweir // -----------------------------------------------------------------------------
654cdf0e10cSrcweir 
655cdf0e10cSrcweir // XTablesSupplier
656cdf0e10cSrcweir //------------------------------------------------------------------------------
getTables()657cdf0e10cSrcweir Reference< XNameAccess >  OConnection::getTables() throw( RuntimeException )
658cdf0e10cSrcweir {
659cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getTables" );
660cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
661cdf0e10cSrcweir 	checkDisposed();
662cdf0e10cSrcweir 
663cdf0e10cSrcweir 	refresh(m_pTables);
664cdf0e10cSrcweir 
665cdf0e10cSrcweir 	return m_pTables;
666cdf0e10cSrcweir }
667cdf0e10cSrcweir // -----------------------------------------------------------------------------
getViews()668cdf0e10cSrcweir Reference< XNameAccess > SAL_CALL OConnection::getViews(  ) throw(RuntimeException)
669cdf0e10cSrcweir {
670cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getViews" );
671cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
672cdf0e10cSrcweir 	checkDisposed();
673cdf0e10cSrcweir 
674cdf0e10cSrcweir 	refresh(m_pViews);
675cdf0e10cSrcweir 
676cdf0e10cSrcweir 	return m_pViews;
677cdf0e10cSrcweir }
678cdf0e10cSrcweir // XQueriesSupplier
679cdf0e10cSrcweir //------------------------------------------------------------------------------
getQueries(void)680cdf0e10cSrcweir Reference< XNameAccess >  OConnection::getQueries(void) throw( RuntimeException )
681cdf0e10cSrcweir {
682cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getQueries" );
683cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
684cdf0e10cSrcweir 	checkDisposed();
685cdf0e10cSrcweir 
686cdf0e10cSrcweir 	return m_xQueries;
687cdf0e10cSrcweir }
688cdf0e10cSrcweir 
689cdf0e10cSrcweir // ::com::sun::star::sdb::XCommandPreparation
690cdf0e10cSrcweir //------------------------------------------------------------------------------
prepareCommand(const::rtl::OUString & command,sal_Int32 commandType)691cdf0e10cSrcweir Reference< XPreparedStatement >  SAL_CALL OConnection::prepareCommand( const ::rtl::OUString& command, sal_Int32 commandType ) throw(::com::sun::star::sdbc::SQLException, RuntimeException)
692cdf0e10cSrcweir {
693cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::prepareCommand" );
694cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
695cdf0e10cSrcweir 	checkDisposed();
696cdf0e10cSrcweir 
697cdf0e10cSrcweir 	rtl::OUString aStatement;
698cdf0e10cSrcweir 	switch (commandType)
699cdf0e10cSrcweir 	{
700cdf0e10cSrcweir 		case CommandType::TABLE:
701cdf0e10cSrcweir 			{
702cdf0e10cSrcweir 				aStatement = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SELECT * FROM "));
703cdf0e10cSrcweir 
704cdf0e10cSrcweir                 ::rtl::OUString sCatalog, sSchema, sTable;
705cdf0e10cSrcweir                 ::dbtools::qualifiedNameComponents( getMetaData(), command, sCatalog, sSchema, sTable, ::dbtools::eInDataManipulation );
706cdf0e10cSrcweir                 aStatement += ::dbtools::composeTableNameForSelect( this, sCatalog, sSchema, sTable );
707cdf0e10cSrcweir 			}
708cdf0e10cSrcweir 			break;
709cdf0e10cSrcweir 		case CommandType::QUERY:
710cdf0e10cSrcweir 			if ( m_xQueries->hasByName(command) )
711cdf0e10cSrcweir 			{
712cdf0e10cSrcweir 				Reference< XPropertySet > xQuery(m_xQueries->getByName(command),UNO_QUERY);
713cdf0e10cSrcweir 				xQuery->getPropertyValue(PROPERTY_COMMAND) >>= aStatement;
714cdf0e10cSrcweir 			}
715cdf0e10cSrcweir 			break;
716cdf0e10cSrcweir 		default:
717cdf0e10cSrcweir 			aStatement = command;
718cdf0e10cSrcweir 	}
719cdf0e10cSrcweir 	// TODO EscapeProcessing
720cdf0e10cSrcweir 	return prepareStatement(aStatement);
721cdf0e10cSrcweir }
722cdf0e10cSrcweir // -----------------------------------------------------------------------------
createInstance(const::rtl::OUString & _sServiceSpecifier)723cdf0e10cSrcweir Reference< XInterface > SAL_CALL OConnection::createInstance( const ::rtl::OUString& _sServiceSpecifier ) throw (Exception, RuntimeException)
724cdf0e10cSrcweir {
725cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::createInstance" );
726cdf0e10cSrcweir 	Reference< XServiceInfo > xRet;
727cdf0e10cSrcweir 	if  (  ( SERVICE_NAME_SINGLESELECTQUERYCOMPOSER == _sServiceSpecifier )
728cdf0e10cSrcweir         || ( _sServiceSpecifier.equalsAscii( "com.sun.star.sdb.SingleSelectQueryAnalyzer" ) )
729cdf0e10cSrcweir         )
730cdf0e10cSrcweir 	{
731cdf0e10cSrcweir 		xRet = new OSingleSelectQueryComposer( getTables(),this, m_aContext );
732cdf0e10cSrcweir 		m_aComposers.push_back(WeakReferenceHelper(xRet));
733cdf0e10cSrcweir 	}
734cdf0e10cSrcweir     else
735cdf0e10cSrcweir     {
736cdf0e10cSrcweir         if ( _sServiceSpecifier.getLength() )
737cdf0e10cSrcweir         {
738cdf0e10cSrcweir             TSupportServices::iterator aFind = m_aSupportServices.find(_sServiceSpecifier);
739cdf0e10cSrcweir             if ( aFind == m_aSupportServices.end() )
740cdf0e10cSrcweir             {
741cdf0e10cSrcweir                 Sequence<Any> aArgs(1);
742cdf0e10cSrcweir                 Reference<XConnection> xMy(this);
743cdf0e10cSrcweir                 aArgs[0] <<= NamedValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ActiveConnection")),makeAny(xMy));
744cdf0e10cSrcweir                 aFind = m_aSupportServices.insert(TSupportServices::value_type(_sServiceSpecifier,m_aContext.createComponentWithArguments(_sServiceSpecifier,aArgs))).first;
745cdf0e10cSrcweir             }
746cdf0e10cSrcweir             return aFind->second;
747cdf0e10cSrcweir         }
748cdf0e10cSrcweir     }
749cdf0e10cSrcweir 	return Reference< XInterface >(xRet,UNO_QUERY);
750cdf0e10cSrcweir }
751cdf0e10cSrcweir // -----------------------------------------------------------------------------
createInstanceWithArguments(const::rtl::OUString & _sServiceSpecifier,const Sequence<Any> &)752cdf0e10cSrcweir Reference< XInterface > SAL_CALL OConnection::createInstanceWithArguments( const ::rtl::OUString& _sServiceSpecifier, const Sequence< Any >& /*Arguments*/ ) throw (Exception, RuntimeException)
753cdf0e10cSrcweir {
754cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::createInstanceWithArguments" );
755cdf0e10cSrcweir 	return createInstance(_sServiceSpecifier);
756cdf0e10cSrcweir }
757cdf0e10cSrcweir // -----------------------------------------------------------------------------
getAvailableServiceNames()758cdf0e10cSrcweir Sequence< ::rtl::OUString > SAL_CALL OConnection::getAvailableServiceNames(  ) throw (RuntimeException)
759cdf0e10cSrcweir {
760cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getAvailableServiceNames" );
761cdf0e10cSrcweir 	Sequence< ::rtl::OUString > aRet(1);
762cdf0e10cSrcweir 	aRet[0] = SERVICE_NAME_SINGLESELECTQUERYCOMPOSER;
763cdf0e10cSrcweir 	return aRet;
764cdf0e10cSrcweir }
765cdf0e10cSrcweir // -----------------------------------------------------------------------------
getMasterTables()766cdf0e10cSrcweir Reference< XTablesSupplier > OConnection::getMasterTables()
767cdf0e10cSrcweir {
768cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getMasterTables" );
769cdf0e10cSrcweir // check if out "master connection" can supply tables
770cdf0e10cSrcweir 	if(!m_xMasterTables.is())
771cdf0e10cSrcweir 	{
772cdf0e10cSrcweir 		try
773cdf0e10cSrcweir 		{
774cdf0e10cSrcweir 			Reference<XDatabaseMetaData> xMeta = getMetaData();
775cdf0e10cSrcweir 			if ( xMeta.is() )
776cdf0e10cSrcweir 				m_xMasterTables = ::dbtools::getDataDefinitionByURLAndConnection( xMeta->getURL(), m_xMasterConnection, m_aContext.getLegacyServiceFactory() );
777cdf0e10cSrcweir 		}
778cdf0e10cSrcweir 		catch(SQLException&)
779cdf0e10cSrcweir 		{
780cdf0e10cSrcweir 		}
781cdf0e10cSrcweir 	}
782cdf0e10cSrcweir 	return m_xMasterTables;
783cdf0e10cSrcweir }
784cdf0e10cSrcweir // -----------------------------------------------------------------------------
785cdf0e10cSrcweir // XUsersSupplier
getUsers()786cdf0e10cSrcweir Reference< XNameAccess > SAL_CALL OConnection::getUsers(  ) throw(RuntimeException)
787cdf0e10cSrcweir {
788cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getUsers" );
789cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
790cdf0e10cSrcweir 	checkDisposed();
791cdf0e10cSrcweir 
792cdf0e10cSrcweir 	Reference<XUsersSupplier> xUsr(getMasterTables(),UNO_QUERY);
793cdf0e10cSrcweir 	return xUsr.is() ? xUsr->getUsers() : Reference< XNameAccess >();
794cdf0e10cSrcweir }
795cdf0e10cSrcweir // -----------------------------------------------------------------------------
796cdf0e10cSrcweir // XGroupsSupplier
getGroups()797cdf0e10cSrcweir Reference< XNameAccess > SAL_CALL OConnection::getGroups(  ) throw(RuntimeException)
798cdf0e10cSrcweir {
799cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getGroups" );
800cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
801cdf0e10cSrcweir 	checkDisposed();
802cdf0e10cSrcweir 	Reference<XGroupsSupplier> xGrp(getMasterTables(),UNO_QUERY);
803cdf0e10cSrcweir 	return xGrp.is() ? xGrp->getGroups() : Reference< XNameAccess >();
804cdf0e10cSrcweir }
805cdf0e10cSrcweir 
806cdf0e10cSrcweir // -----------------------------------------------------------------------------
impl_loadConnectionTools_throw()807cdf0e10cSrcweir void OConnection::impl_loadConnectionTools_throw()
808cdf0e10cSrcweir {
809cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::impl_loadConnectionTools_throw" );
810cdf0e10cSrcweir     Sequence< Any > aArguments( 1 );
811cdf0e10cSrcweir     aArguments[0] <<= NamedValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Connection" ) ), makeAny( Reference< XConnection >( this ) ) );
812cdf0e10cSrcweir 
813cdf0e10cSrcweir     if ( !m_aContext.createComponentWithArguments( "com.sun.star.sdb.tools.ConnectionTools", aArguments, m_xConnectionTools ) )
814cdf0e10cSrcweir         throw RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "service not registered: com.sun.star.sdb.tools.ConnectionTools" ) ), *this );
815cdf0e10cSrcweir }
816cdf0e10cSrcweir 
817cdf0e10cSrcweir // -----------------------------------------------------------------------------
createTableName()818cdf0e10cSrcweir Reference< XTableName > SAL_CALL OConnection::createTableName(  ) throw (RuntimeException)
819cdf0e10cSrcweir {
820cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::createTableName" );
821cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
822cdf0e10cSrcweir 	checkDisposed();
823cdf0e10cSrcweir     impl_loadConnectionTools_throw();
824cdf0e10cSrcweir 
825cdf0e10cSrcweir     return m_xConnectionTools->createTableName();
826cdf0e10cSrcweir }
827cdf0e10cSrcweir 
828cdf0e10cSrcweir // -----------------------------------------------------------------------------
getObjectNames()829cdf0e10cSrcweir Reference< XObjectNames > SAL_CALL OConnection::getObjectNames(  ) throw (RuntimeException)
830cdf0e10cSrcweir {
831cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getObjectNames" );
832cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
833cdf0e10cSrcweir 	checkDisposed();
834cdf0e10cSrcweir     impl_loadConnectionTools_throw();
835cdf0e10cSrcweir 
836cdf0e10cSrcweir     return m_xConnectionTools->getObjectNames();
837cdf0e10cSrcweir }
838cdf0e10cSrcweir 
839cdf0e10cSrcweir // -----------------------------------------------------------------------------
getDataSourceMetaData()840cdf0e10cSrcweir Reference< XDataSourceMetaData > SAL_CALL OConnection::getDataSourceMetaData(  ) throw (RuntimeException)
841cdf0e10cSrcweir {
842cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getDataSourceMetaData" );
843cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
844cdf0e10cSrcweir 	checkDisposed();
845cdf0e10cSrcweir     impl_loadConnectionTools_throw();
846cdf0e10cSrcweir 
847cdf0e10cSrcweir     return m_xConnectionTools->getDataSourceMetaData();
848cdf0e10cSrcweir }
849cdf0e10cSrcweir // -----------------------------------------------------------------------------
getFieldsByCommandDescriptor(::sal_Int32 commandType,const::rtl::OUString & command,::com::sun::star::uno::Reference<::com::sun::star::lang::XComponent> & keepFieldsAlive)850cdf0e10cSrcweir Reference< ::com::sun::star::container::XNameAccess > SAL_CALL OConnection::getFieldsByCommandDescriptor( ::sal_Int32 commandType, const ::rtl::OUString& command, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& keepFieldsAlive ) throw (::com::sun::star::sdbc::SQLException, RuntimeException)
851cdf0e10cSrcweir {
852cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getFieldsByCommandDescriptor" );
853cdf0e10cSrcweir 	MutexGuard aGuard(m_aMutex);
854cdf0e10cSrcweir 	checkDisposed();
855cdf0e10cSrcweir     impl_loadConnectionTools_throw();
856cdf0e10cSrcweir 
857cdf0e10cSrcweir     return m_xConnectionTools->getFieldsByCommandDescriptor(commandType,command,keepFieldsAlive);
858cdf0e10cSrcweir }
859cdf0e10cSrcweir //--------------------------------------------------------------------
getComposer(::sal_Int32 commandType,const::rtl::OUString & command)860cdf0e10cSrcweir Reference< XSingleSelectQueryComposer > SAL_CALL OConnection::getComposer( ::sal_Int32 commandType, const ::rtl::OUString& command ) throw (::com::sun::star::uno::RuntimeException)
861cdf0e10cSrcweir {
862cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getComposer" );
863cdf0e10cSrcweir     MutexGuard aGuard(m_aMutex);
864cdf0e10cSrcweir 	checkDisposed();
865cdf0e10cSrcweir     impl_loadConnectionTools_throw();
866cdf0e10cSrcweir 
867cdf0e10cSrcweir     return m_xConnectionTools->getComposer(commandType,command);
868cdf0e10cSrcweir }
869cdf0e10cSrcweir 
870cdf0e10cSrcweir // -----------------------------------------------------------------------------
impl_checkTableQueryNames_nothrow()871cdf0e10cSrcweir void OConnection::impl_checkTableQueryNames_nothrow()
872cdf0e10cSrcweir {
873cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::impl_checkTableQueryNames_nothrow" );
874cdf0e10cSrcweir     DatabaseMetaData aMeta( static_cast< XConnection* >( this ) );
875cdf0e10cSrcweir     if ( !aMeta.supportsSubqueriesInFrom() )
876cdf0e10cSrcweir         // nothing to do
877cdf0e10cSrcweir         return;
878cdf0e10cSrcweir 
879cdf0e10cSrcweir     try
880cdf0e10cSrcweir     {
881cdf0e10cSrcweir         Reference< XNameAccess > xTables( getTables() );
882cdf0e10cSrcweir         Sequence< ::rtl::OUString > aTableNames( xTables->getElementNames() );
883cdf0e10cSrcweir         ::std::set< ::rtl::OUString > aSortedTableNames( aTableNames.getConstArray(), aTableNames.getConstArray() + aTableNames.getLength() );
884cdf0e10cSrcweir 
885cdf0e10cSrcweir         Reference< XNameAccess > xQueries( getQueries() );
886cdf0e10cSrcweir         Sequence< ::rtl::OUString > aQueryNames( xQueries->getElementNames() );
887cdf0e10cSrcweir 
888cdf0e10cSrcweir         for (   const ::rtl::OUString* pQueryName = aQueryNames.getConstArray();
889cdf0e10cSrcweir                 pQueryName != aQueryNames.getConstArray() + aQueryNames.getLength();
890cdf0e10cSrcweir                 ++pQueryName
891cdf0e10cSrcweir             )
892cdf0e10cSrcweir         {
893cdf0e10cSrcweir             if ( aSortedTableNames.find( *pQueryName ) != aSortedTableNames.end() )
894cdf0e10cSrcweir             {
895cdf0e10cSrcweir                 ::rtl::OUString sConflictWarning( DBACORE_RESSTRING( RID_STR_CONFLICTING_NAMES ) );
896cdf0e10cSrcweir                 m_aWarnings.appendWarning( sConflictWarning, "01SB0", *this );
897cdf0e10cSrcweir             }
898cdf0e10cSrcweir         }
899cdf0e10cSrcweir     }
900cdf0e10cSrcweir     catch( const Exception& )
901cdf0e10cSrcweir     {
902cdf0e10cSrcweir     	DBG_UNHANDLED_EXCEPTION();
903cdf0e10cSrcweir     }
904cdf0e10cSrcweir }
905cdf0e10cSrcweir 
906cdf0e10cSrcweir // -----------------------------------------------------------------------------
getTableIcon(const::rtl::OUString & _TableName,::sal_Int32 _ColorMode)907cdf0e10cSrcweir Reference< XGraphic > SAL_CALL OConnection::getTableIcon( const ::rtl::OUString& _TableName, ::sal_Int32 _ColorMode ) throw (RuntimeException)
908cdf0e10cSrcweir {
909cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getTableIcon" );
910cdf0e10cSrcweir     Reference< XGraphic > xReturn;
911cdf0e10cSrcweir 
912cdf0e10cSrcweir     // ask our aggregate
913cdf0e10cSrcweir     if ( m_xTableUIProvider.is() )
914cdf0e10cSrcweir         xReturn = m_xTableUIProvider->getTableIcon( _TableName, _ColorMode );
915cdf0e10cSrcweir 
916cdf0e10cSrcweir     // ask ourself
917cdf0e10cSrcweir     // well, we don't have own functionality here ...
918cdf0e10cSrcweir     // In the future, we might decide to delegate the complete handling to this interface.
919cdf0e10cSrcweir     // In this case, we would need to load the icon here.
920cdf0e10cSrcweir 
921cdf0e10cSrcweir     return xReturn;
922cdf0e10cSrcweir }
923cdf0e10cSrcweir 
924cdf0e10cSrcweir // -----------------------------------------------------------------------------
getTableEditor(const Reference<XDatabaseDocumentUI> & _DocumentUI,const::rtl::OUString & _TableName)925cdf0e10cSrcweir Reference< XInterface > SAL_CALL OConnection::getTableEditor( const Reference< XDatabaseDocumentUI >& _DocumentUI, const ::rtl::OUString& _TableName ) throw (IllegalArgumentException, WrappedTargetException, RuntimeException)
926cdf0e10cSrcweir {
927cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getTableEditor" );
928cdf0e10cSrcweir     Reference< XInterface > xReturn;
929cdf0e10cSrcweir 
930cdf0e10cSrcweir     // ask our aggregate
931cdf0e10cSrcweir     if ( m_xTableUIProvider.is() )
932cdf0e10cSrcweir         xReturn = m_xTableUIProvider->getTableEditor( _DocumentUI, _TableName );
933cdf0e10cSrcweir 
934cdf0e10cSrcweir     // ask ourself
935cdf0e10cSrcweir     // well, we don't have own functionality here ...
936cdf0e10cSrcweir     // In the future, we might decide to delegate the complete handling to this interface.
937cdf0e10cSrcweir     // In this case, we would need to instantiate an css.sdb.TableDesign here.
938cdf0e10cSrcweir 
939cdf0e10cSrcweir     return xReturn;
940cdf0e10cSrcweir }
941cdf0e10cSrcweir 
942cdf0e10cSrcweir 
943cdf0e10cSrcweir //........................................................................
944cdf0e10cSrcweir }	// namespace dbaccess
945cdf0e10cSrcweir //........................................................................
946cdf0e10cSrcweir 
947