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