1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_connectivity.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include "MacabDatabaseMetaData.hxx"
32*cdf0e10cSrcweir #include "MacabAddressBook.hxx"
33*cdf0e10cSrcweir #include "MacabHeader.hxx"
34*cdf0e10cSrcweir #include "MacabGroup.hxx"
35*cdf0e10cSrcweir #include "macabutilities.hxx"
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir #ifndef CONNECTIVITY_MACAB_DRIVER_HXX_
38*cdf0e10cSrcweir #include "MacabDriver.hxx"
39*cdf0e10cSrcweir #endif
40*cdf0e10cSrcweir #include "FDatabaseMetaDataResultSet.hxx"
41*cdf0e10cSrcweir #include "OTypeInfo.hxx"
42*cdf0e10cSrcweir #include <com/sun/star/sdbc/ColumnValue.hpp>
43*cdf0e10cSrcweir #include <com/sun/star/sdbc/ResultSetType.hpp>
44*cdf0e10cSrcweir #include <com/sun/star/sdbc/TransactionIsolation.hpp>
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir #include <vector>
47*cdf0e10cSrcweir 
48*cdf0e10cSrcweir using namespace connectivity::macab;
49*cdf0e10cSrcweir using namespace com::sun::star::uno;
50*cdf0e10cSrcweir using namespace com::sun::star::lang;
51*cdf0e10cSrcweir using namespace com::sun::star::beans;
52*cdf0e10cSrcweir using namespace com::sun::star::sdbc;
53*cdf0e10cSrcweir 
54*cdf0e10cSrcweir MacabDatabaseMetaData::MacabDatabaseMetaData(MacabConnection* _pCon)
55*cdf0e10cSrcweir 		: m_xConnection(_pCon),
56*cdf0e10cSrcweir 		  m_bUseCatalog(sal_True)
57*cdf0e10cSrcweir {
58*cdf0e10cSrcweir 	OSL_ENSURE(_pCon,"MacabDatabaseMetaData::MacabDatabaseMetaData: No connection set!");
59*cdf0e10cSrcweir 
60*cdf0e10cSrcweir 	osl_incrementInterlockedCount( &m_refCount );
61*cdf0e10cSrcweir 	m_bUseCatalog	= !(usesLocalFiles() || usesLocalFilePerTable());
62*cdf0e10cSrcweir 	osl_decrementInterlockedCount( &m_refCount );
63*cdf0e10cSrcweir }
64*cdf0e10cSrcweir // -------------------------------------------------------------------------
65*cdf0e10cSrcweir MacabDatabaseMetaData::~MacabDatabaseMetaData()
66*cdf0e10cSrcweir {
67*cdf0e10cSrcweir }
68*cdf0e10cSrcweir // -------------------------------------------------------------------------
69*cdf0e10cSrcweir ::rtl::OUString SAL_CALL MacabDatabaseMetaData::getCatalogSeparator(  ) throw(SQLException, RuntimeException)
70*cdf0e10cSrcweir {
71*cdf0e10cSrcweir 	::rtl::OUString aVal;
72*cdf0e10cSrcweir 	if (m_bUseCatalog)
73*cdf0e10cSrcweir 	{ // do some special here for you database
74*cdf0e10cSrcweir 	}
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir 	return aVal;
77*cdf0e10cSrcweir }
78*cdf0e10cSrcweir // -------------------------------------------------------------------------
79*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxBinaryLiteralLength(  ) throw(SQLException, RuntimeException)
80*cdf0e10cSrcweir {
81*cdf0e10cSrcweir 	sal_Int32 nValue = 0; // 0 means no limit
82*cdf0e10cSrcweir 	return nValue;
83*cdf0e10cSrcweir }
84*cdf0e10cSrcweir // -------------------------------------------------------------------------
85*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxRowSize(  ) throw(SQLException, RuntimeException)
86*cdf0e10cSrcweir {
87*cdf0e10cSrcweir 	sal_Int32 nValue = 0; // 0 means no limit
88*cdf0e10cSrcweir 	return nValue;
89*cdf0e10cSrcweir }
90*cdf0e10cSrcweir // -------------------------------------------------------------------------
91*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxCatalogNameLength(  ) throw(SQLException, RuntimeException)
92*cdf0e10cSrcweir {
93*cdf0e10cSrcweir 	sal_Int32 nValue = 0; // 0 means no limit
94*cdf0e10cSrcweir 	return nValue;
95*cdf0e10cSrcweir }
96*cdf0e10cSrcweir // -------------------------------------------------------------------------
97*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxCharLiteralLength(  ) throw(SQLException, RuntimeException)
98*cdf0e10cSrcweir {
99*cdf0e10cSrcweir 	sal_Int32 nValue = 0; // 0 means no limit
100*cdf0e10cSrcweir 	return nValue;
101*cdf0e10cSrcweir }
102*cdf0e10cSrcweir // -------------------------------------------------------------------------
103*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxColumnNameLength(  ) throw(SQLException, RuntimeException)
104*cdf0e10cSrcweir {
105*cdf0e10cSrcweir 	sal_Int32 nValue = 0; // 0 means no limit
106*cdf0e10cSrcweir 	return nValue;
107*cdf0e10cSrcweir }
108*cdf0e10cSrcweir // -------------------------------------------------------------------------
109*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxColumnsInIndex(  ) throw(SQLException, RuntimeException)
110*cdf0e10cSrcweir {
111*cdf0e10cSrcweir 	sal_Int32 nValue = 0; // 0 means no limit
112*cdf0e10cSrcweir 	return nValue;
113*cdf0e10cSrcweir }
114*cdf0e10cSrcweir // -------------------------------------------------------------------------
115*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxCursorNameLength(  ) throw(SQLException, RuntimeException)
116*cdf0e10cSrcweir {
117*cdf0e10cSrcweir 	sal_Int32 nValue = 0; // 0 means no limit
118*cdf0e10cSrcweir 	return nValue;
119*cdf0e10cSrcweir }
120*cdf0e10cSrcweir // -------------------------------------------------------------------------
121*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxConnections(  ) throw(SQLException, RuntimeException)
122*cdf0e10cSrcweir {
123*cdf0e10cSrcweir 	sal_Int32 nValue = 0; // 0 means no limit
124*cdf0e10cSrcweir 	return nValue;
125*cdf0e10cSrcweir }
126*cdf0e10cSrcweir // -------------------------------------------------------------------------
127*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxColumnsInTable(  ) throw(SQLException, RuntimeException)
128*cdf0e10cSrcweir {
129*cdf0e10cSrcweir 	sal_Int32 nValue = 0; // 0 means no limit
130*cdf0e10cSrcweir 	return nValue;
131*cdf0e10cSrcweir }
132*cdf0e10cSrcweir // -------------------------------------------------------------------------
133*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxStatementLength(  ) throw(SQLException, RuntimeException)
134*cdf0e10cSrcweir {
135*cdf0e10cSrcweir 	sal_Int32 nValue = 0; // 0 means no limit
136*cdf0e10cSrcweir 	return nValue;
137*cdf0e10cSrcweir }
138*cdf0e10cSrcweir // -------------------------------------------------------------------------
139*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxTableNameLength(  ) throw(SQLException, RuntimeException)
140*cdf0e10cSrcweir {
141*cdf0e10cSrcweir 	sal_Int32 nValue = 0; // 0 means no limit
142*cdf0e10cSrcweir 	return nValue;
143*cdf0e10cSrcweir }
144*cdf0e10cSrcweir // -------------------------------------------------------------------------
145*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxTablesInSelect(  ) throw(SQLException, RuntimeException)
146*cdf0e10cSrcweir {
147*cdf0e10cSrcweir 	// MaxTablesInSelect describes how many tables can participate in the FROM part of a given SELECT statement,
148*cdf0e10cSrcweir 	// currently, the resultset/statement implementations can cope with one table only
149*cdf0e10cSrcweir 	sal_Int32 nValue = 1;
150*cdf0e10cSrcweir 	return nValue;
151*cdf0e10cSrcweir }
152*cdf0e10cSrcweir // -------------------------------------------------------------------------
153*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::doesMaxRowSizeIncludeBlobs(  ) throw(SQLException, RuntimeException)
154*cdf0e10cSrcweir {
155*cdf0e10cSrcweir 	return sal_False;
156*cdf0e10cSrcweir }
157*cdf0e10cSrcweir // -------------------------------------------------------------------------
158*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::storesLowerCaseQuotedIdentifiers(  ) throw(SQLException, RuntimeException)
159*cdf0e10cSrcweir {
160*cdf0e10cSrcweir 	return sal_False;
161*cdf0e10cSrcweir }
162*cdf0e10cSrcweir // -------------------------------------------------------------------------
163*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::storesLowerCaseIdentifiers(  ) throw(SQLException, RuntimeException)
164*cdf0e10cSrcweir {
165*cdf0e10cSrcweir 	return sal_False;
166*cdf0e10cSrcweir }
167*cdf0e10cSrcweir // -------------------------------------------------------------------------
168*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::storesMixedCaseQuotedIdentifiers(  ) throw(SQLException, RuntimeException)
169*cdf0e10cSrcweir {
170*cdf0e10cSrcweir 	return sal_False;
171*cdf0e10cSrcweir }
172*cdf0e10cSrcweir // -------------------------------------------------------------------------
173*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::storesMixedCaseIdentifiers(  ) throw(SQLException, RuntimeException)
174*cdf0e10cSrcweir {
175*cdf0e10cSrcweir 	return sal_False;
176*cdf0e10cSrcweir }
177*cdf0e10cSrcweir // -------------------------------------------------------------------------
178*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::storesUpperCaseQuotedIdentifiers(  ) throw(SQLException, RuntimeException)
179*cdf0e10cSrcweir {
180*cdf0e10cSrcweir 	return sal_False;
181*cdf0e10cSrcweir }
182*cdf0e10cSrcweir // -------------------------------------------------------------------------
183*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::storesUpperCaseIdentifiers(  ) throw(SQLException, RuntimeException)
184*cdf0e10cSrcweir {
185*cdf0e10cSrcweir 	return sal_False;
186*cdf0e10cSrcweir }
187*cdf0e10cSrcweir // -------------------------------------------------------------------------
188*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsAlterTableWithAddColumn(  ) throw(SQLException, RuntimeException)
189*cdf0e10cSrcweir {
190*cdf0e10cSrcweir 	return sal_False;
191*cdf0e10cSrcweir }
192*cdf0e10cSrcweir // -------------------------------------------------------------------------
193*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsAlterTableWithDropColumn(  ) throw(SQLException, RuntimeException)
194*cdf0e10cSrcweir {
195*cdf0e10cSrcweir 	return sal_False;
196*cdf0e10cSrcweir }
197*cdf0e10cSrcweir // -------------------------------------------------------------------------
198*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxIndexLength(  ) throw(SQLException, RuntimeException)
199*cdf0e10cSrcweir {
200*cdf0e10cSrcweir 	sal_Int32 nValue = 0; // 0 means no limit
201*cdf0e10cSrcweir 	return nValue;
202*cdf0e10cSrcweir }
203*cdf0e10cSrcweir // -------------------------------------------------------------------------
204*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsNonNullableColumns(  ) throw(SQLException, RuntimeException)
205*cdf0e10cSrcweir {
206*cdf0e10cSrcweir 	return sal_False;
207*cdf0e10cSrcweir }
208*cdf0e10cSrcweir // -------------------------------------------------------------------------
209*cdf0e10cSrcweir ::rtl::OUString SAL_CALL MacabDatabaseMetaData::getCatalogTerm(  ) throw(SQLException, RuntimeException)
210*cdf0e10cSrcweir {
211*cdf0e10cSrcweir 	::rtl::OUString aVal;
212*cdf0e10cSrcweir 	if (m_bUseCatalog)
213*cdf0e10cSrcweir 	{
214*cdf0e10cSrcweir 	}
215*cdf0e10cSrcweir 	return aVal;
216*cdf0e10cSrcweir }
217*cdf0e10cSrcweir // -------------------------------------------------------------------------
218*cdf0e10cSrcweir ::rtl::OUString SAL_CALL MacabDatabaseMetaData::getIdentifierQuoteString(  ) throw(SQLException, RuntimeException)
219*cdf0e10cSrcweir {
220*cdf0e10cSrcweir 	// normally this is "
221*cdf0e10cSrcweir 	::rtl::OUString aVal = ::rtl::OUString::createFromAscii("\"");
222*cdf0e10cSrcweir 	return aVal;
223*cdf0e10cSrcweir }
224*cdf0e10cSrcweir // -------------------------------------------------------------------------
225*cdf0e10cSrcweir ::rtl::OUString SAL_CALL MacabDatabaseMetaData::getExtraNameCharacters(  ) throw(SQLException, RuntimeException)
226*cdf0e10cSrcweir {
227*cdf0e10cSrcweir 	::rtl::OUString aVal;
228*cdf0e10cSrcweir 	return aVal;
229*cdf0e10cSrcweir }
230*cdf0e10cSrcweir // -------------------------------------------------------------------------
231*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsDifferentTableCorrelationNames(  ) throw(SQLException, RuntimeException)
232*cdf0e10cSrcweir {
233*cdf0e10cSrcweir 	return sal_False;
234*cdf0e10cSrcweir }
235*cdf0e10cSrcweir // -------------------------------------------------------------------------
236*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::isCatalogAtStart(  ) throw(SQLException, RuntimeException)
237*cdf0e10cSrcweir {
238*cdf0e10cSrcweir 	sal_Bool bValue = sal_False;
239*cdf0e10cSrcweir 	if (m_bUseCatalog)
240*cdf0e10cSrcweir 	{
241*cdf0e10cSrcweir 	}
242*cdf0e10cSrcweir 	return bValue;
243*cdf0e10cSrcweir }
244*cdf0e10cSrcweir // -------------------------------------------------------------------------
245*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::dataDefinitionIgnoredInTransactions(  ) throw(SQLException, RuntimeException)
246*cdf0e10cSrcweir {
247*cdf0e10cSrcweir 	return sal_True;
248*cdf0e10cSrcweir }
249*cdf0e10cSrcweir // -------------------------------------------------------------------------
250*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::dataDefinitionCausesTransactionCommit(  ) throw(SQLException, RuntimeException)
251*cdf0e10cSrcweir {
252*cdf0e10cSrcweir 	return sal_True;
253*cdf0e10cSrcweir }
254*cdf0e10cSrcweir // -------------------------------------------------------------------------
255*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsDataManipulationTransactionsOnly(  ) throw(SQLException, RuntimeException)
256*cdf0e10cSrcweir {
257*cdf0e10cSrcweir 	return sal_True;
258*cdf0e10cSrcweir }
259*cdf0e10cSrcweir // -------------------------------------------------------------------------
260*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions(  ) throw(SQLException, RuntimeException)
261*cdf0e10cSrcweir {
262*cdf0e10cSrcweir 	return sal_True;
263*cdf0e10cSrcweir }
264*cdf0e10cSrcweir // -------------------------------------------------------------------------
265*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsPositionedDelete(  ) throw(SQLException, RuntimeException)
266*cdf0e10cSrcweir {
267*cdf0e10cSrcweir 	return sal_False;
268*cdf0e10cSrcweir }
269*cdf0e10cSrcweir // -------------------------------------------------------------------------
270*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsPositionedUpdate(  ) throw(SQLException, RuntimeException)
271*cdf0e10cSrcweir {
272*cdf0e10cSrcweir 	return sal_False;
273*cdf0e10cSrcweir }
274*cdf0e10cSrcweir // -------------------------------------------------------------------------
275*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsOpenStatementsAcrossRollback(  ) throw(SQLException, RuntimeException)
276*cdf0e10cSrcweir {
277*cdf0e10cSrcweir 	return sal_False;
278*cdf0e10cSrcweir }
279*cdf0e10cSrcweir // -------------------------------------------------------------------------
280*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsOpenStatementsAcrossCommit(  ) throw(SQLException, RuntimeException)
281*cdf0e10cSrcweir {
282*cdf0e10cSrcweir 	return sal_False;
283*cdf0e10cSrcweir }
284*cdf0e10cSrcweir // -------------------------------------------------------------------------
285*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsOpenCursorsAcrossCommit(  ) throw(SQLException, RuntimeException)
286*cdf0e10cSrcweir {
287*cdf0e10cSrcweir 	return sal_False;
288*cdf0e10cSrcweir }
289*cdf0e10cSrcweir // -------------------------------------------------------------------------
290*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsOpenCursorsAcrossRollback(  ) throw(SQLException, RuntimeException)
291*cdf0e10cSrcweir {
292*cdf0e10cSrcweir 	return sal_False;
293*cdf0e10cSrcweir }
294*cdf0e10cSrcweir // -------------------------------------------------------------------------
295*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsTransactionIsolationLevel( sal_Int32 ) throw(SQLException, RuntimeException)
296*cdf0e10cSrcweir {
297*cdf0e10cSrcweir 	return sal_False;
298*cdf0e10cSrcweir }
299*cdf0e10cSrcweir // -------------------------------------------------------------------------
300*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsSchemasInDataManipulation(  ) throw(SQLException, RuntimeException)
301*cdf0e10cSrcweir {
302*cdf0e10cSrcweir 	return sal_False;
303*cdf0e10cSrcweir }
304*cdf0e10cSrcweir // -------------------------------------------------------------------------
305*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsANSI92FullSQL(  ) throw(SQLException, RuntimeException)
306*cdf0e10cSrcweir {
307*cdf0e10cSrcweir 	return sal_False;
308*cdf0e10cSrcweir }
309*cdf0e10cSrcweir // -------------------------------------------------------------------------
310*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsANSI92EntryLevelSQL(  ) throw(SQLException, RuntimeException)
311*cdf0e10cSrcweir {
312*cdf0e10cSrcweir 	return sal_True; // should be supported at least
313*cdf0e10cSrcweir }
314*cdf0e10cSrcweir // -------------------------------------------------------------------------
315*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsIntegrityEnhancementFacility(  ) throw(SQLException, RuntimeException)
316*cdf0e10cSrcweir {
317*cdf0e10cSrcweir 	return sal_False;
318*cdf0e10cSrcweir }
319*cdf0e10cSrcweir // -------------------------------------------------------------------------
320*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsSchemasInIndexDefinitions(  ) throw(SQLException, RuntimeException)
321*cdf0e10cSrcweir {
322*cdf0e10cSrcweir 	return sal_False;
323*cdf0e10cSrcweir }
324*cdf0e10cSrcweir // -------------------------------------------------------------------------
325*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsSchemasInTableDefinitions(  ) throw(SQLException, RuntimeException)
326*cdf0e10cSrcweir {
327*cdf0e10cSrcweir 	return sal_False;
328*cdf0e10cSrcweir }
329*cdf0e10cSrcweir // -------------------------------------------------------------------------
330*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsCatalogsInTableDefinitions(  ) throw(SQLException, RuntimeException)
331*cdf0e10cSrcweir {
332*cdf0e10cSrcweir 	return sal_False;
333*cdf0e10cSrcweir }
334*cdf0e10cSrcweir // -------------------------------------------------------------------------
335*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsCatalogsInIndexDefinitions(  ) throw(SQLException, RuntimeException)
336*cdf0e10cSrcweir {
337*cdf0e10cSrcweir 	return sal_False;
338*cdf0e10cSrcweir }
339*cdf0e10cSrcweir // -------------------------------------------------------------------------
340*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsCatalogsInDataManipulation(  ) throw(SQLException, RuntimeException)
341*cdf0e10cSrcweir {
342*cdf0e10cSrcweir 	return sal_False;
343*cdf0e10cSrcweir }
344*cdf0e10cSrcweir // -------------------------------------------------------------------------
345*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsOuterJoins(  ) throw(SQLException, RuntimeException)
346*cdf0e10cSrcweir {
347*cdf0e10cSrcweir 	return sal_False;
348*cdf0e10cSrcweir }
349*cdf0e10cSrcweir // -------------------------------------------------------------------------
350*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxStatements(  ) throw(SQLException, RuntimeException)
351*cdf0e10cSrcweir {
352*cdf0e10cSrcweir 	sal_Int32 nValue = 0; // 0 means no limit
353*cdf0e10cSrcweir 	return nValue;
354*cdf0e10cSrcweir }
355*cdf0e10cSrcweir // -------------------------------------------------------------------------
356*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxProcedureNameLength(  ) throw(SQLException, RuntimeException)
357*cdf0e10cSrcweir {
358*cdf0e10cSrcweir 	sal_Int32 nValue = 0; // 0 means no limit
359*cdf0e10cSrcweir 	return nValue;
360*cdf0e10cSrcweir }
361*cdf0e10cSrcweir // -------------------------------------------------------------------------
362*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxSchemaNameLength(  ) throw(SQLException, RuntimeException)
363*cdf0e10cSrcweir {
364*cdf0e10cSrcweir 	sal_Int32 nValue = 0; // 0 means no limit
365*cdf0e10cSrcweir 	return nValue;
366*cdf0e10cSrcweir }
367*cdf0e10cSrcweir // -------------------------------------------------------------------------
368*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsTransactions(  ) throw(SQLException, RuntimeException)
369*cdf0e10cSrcweir {
370*cdf0e10cSrcweir 	return sal_False;
371*cdf0e10cSrcweir }
372*cdf0e10cSrcweir // -------------------------------------------------------------------------
373*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::allProceduresAreCallable(  ) throw(SQLException, RuntimeException)
374*cdf0e10cSrcweir {
375*cdf0e10cSrcweir 	return sal_False;
376*cdf0e10cSrcweir }
377*cdf0e10cSrcweir // -------------------------------------------------------------------------
378*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsStoredProcedures(  ) throw(SQLException, RuntimeException)
379*cdf0e10cSrcweir {
380*cdf0e10cSrcweir 	return sal_False;
381*cdf0e10cSrcweir }
382*cdf0e10cSrcweir // -------------------------------------------------------------------------
383*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsSelectForUpdate(  ) throw(SQLException, RuntimeException)
384*cdf0e10cSrcweir {
385*cdf0e10cSrcweir 	return sal_False;
386*cdf0e10cSrcweir }
387*cdf0e10cSrcweir // -------------------------------------------------------------------------
388*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::allTablesAreSelectable(  ) throw(SQLException, RuntimeException)
389*cdf0e10cSrcweir {
390*cdf0e10cSrcweir 	return sal_False;
391*cdf0e10cSrcweir }
392*cdf0e10cSrcweir // -------------------------------------------------------------------------
393*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::isReadOnly(  ) throw(SQLException, RuntimeException)
394*cdf0e10cSrcweir {
395*cdf0e10cSrcweir 	// for the moment, we have read-only addresses, but this might change in the future
396*cdf0e10cSrcweir 	return sal_True;
397*cdf0e10cSrcweir }
398*cdf0e10cSrcweir // -------------------------------------------------------------------------
399*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::usesLocalFiles(  ) throw(SQLException, RuntimeException)
400*cdf0e10cSrcweir {
401*cdf0e10cSrcweir 	return sal_False;
402*cdf0e10cSrcweir }
403*cdf0e10cSrcweir // -------------------------------------------------------------------------
404*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::usesLocalFilePerTable(  ) throw(SQLException, RuntimeException)
405*cdf0e10cSrcweir {
406*cdf0e10cSrcweir 	return sal_False;
407*cdf0e10cSrcweir }
408*cdf0e10cSrcweir // -------------------------------------------------------------------------
409*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsTypeConversion(  ) throw(SQLException, RuntimeException)
410*cdf0e10cSrcweir {
411*cdf0e10cSrcweir 	return sal_False;
412*cdf0e10cSrcweir }
413*cdf0e10cSrcweir // -------------------------------------------------------------------------
414*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::nullPlusNonNullIsNull(  ) throw(SQLException, RuntimeException)
415*cdf0e10cSrcweir {
416*cdf0e10cSrcweir 	return sal_False;
417*cdf0e10cSrcweir }
418*cdf0e10cSrcweir // -------------------------------------------------------------------------
419*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsColumnAliasing(  ) throw(SQLException, RuntimeException)
420*cdf0e10cSrcweir {
421*cdf0e10cSrcweir 	return sal_False;
422*cdf0e10cSrcweir }
423*cdf0e10cSrcweir // -------------------------------------------------------------------------
424*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsTableCorrelationNames(  ) throw(SQLException, RuntimeException)
425*cdf0e10cSrcweir {
426*cdf0e10cSrcweir 	return sal_False;
427*cdf0e10cSrcweir }
428*cdf0e10cSrcweir // -------------------------------------------------------------------------
429*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsConvert( sal_Int32, sal_Int32 ) throw(SQLException, RuntimeException)
430*cdf0e10cSrcweir {
431*cdf0e10cSrcweir 	return sal_False;
432*cdf0e10cSrcweir }
433*cdf0e10cSrcweir // -------------------------------------------------------------------------
434*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsExpressionsInOrderBy(  ) throw(SQLException, RuntimeException)
435*cdf0e10cSrcweir {
436*cdf0e10cSrcweir 	return sal_False;
437*cdf0e10cSrcweir }
438*cdf0e10cSrcweir // -------------------------------------------------------------------------
439*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsGroupBy(  ) throw(SQLException, RuntimeException)
440*cdf0e10cSrcweir {
441*cdf0e10cSrcweir 	return sal_False;
442*cdf0e10cSrcweir }
443*cdf0e10cSrcweir // -------------------------------------------------------------------------
444*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsGroupByBeyondSelect(  ) throw(SQLException, RuntimeException)
445*cdf0e10cSrcweir {
446*cdf0e10cSrcweir 	return sal_False;
447*cdf0e10cSrcweir }
448*cdf0e10cSrcweir // -------------------------------------------------------------------------
449*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsGroupByUnrelated(  ) throw(SQLException, RuntimeException)
450*cdf0e10cSrcweir {
451*cdf0e10cSrcweir 	return sal_False;
452*cdf0e10cSrcweir }
453*cdf0e10cSrcweir // -------------------------------------------------------------------------
454*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsMultipleTransactions(  ) throw(SQLException, RuntimeException)
455*cdf0e10cSrcweir {
456*cdf0e10cSrcweir 	return sal_False;
457*cdf0e10cSrcweir }
458*cdf0e10cSrcweir // -------------------------------------------------------------------------
459*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsMultipleResultSets(  ) throw(SQLException, RuntimeException)
460*cdf0e10cSrcweir {
461*cdf0e10cSrcweir 	return sal_False;
462*cdf0e10cSrcweir }
463*cdf0e10cSrcweir // -------------------------------------------------------------------------
464*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsLikeEscapeClause(  ) throw(SQLException, RuntimeException)
465*cdf0e10cSrcweir {
466*cdf0e10cSrcweir 	return sal_False;
467*cdf0e10cSrcweir }
468*cdf0e10cSrcweir // -------------------------------------------------------------------------
469*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsOrderByUnrelated(  ) throw(SQLException, RuntimeException)
470*cdf0e10cSrcweir {
471*cdf0e10cSrcweir 	return sal_False;
472*cdf0e10cSrcweir }
473*cdf0e10cSrcweir // -------------------------------------------------------------------------
474*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsUnion(  ) throw(SQLException, RuntimeException)
475*cdf0e10cSrcweir {
476*cdf0e10cSrcweir 	return sal_False;
477*cdf0e10cSrcweir }
478*cdf0e10cSrcweir // -------------------------------------------------------------------------
479*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsUnionAll(  ) throw(SQLException, RuntimeException)
480*cdf0e10cSrcweir {
481*cdf0e10cSrcweir 	return sal_False;
482*cdf0e10cSrcweir }
483*cdf0e10cSrcweir // -------------------------------------------------------------------------
484*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsMixedCaseIdentifiers(  ) throw(SQLException, RuntimeException)
485*cdf0e10cSrcweir {
486*cdf0e10cSrcweir 	return sal_False;
487*cdf0e10cSrcweir }
488*cdf0e10cSrcweir // -------------------------------------------------------------------------
489*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsMixedCaseQuotedIdentifiers(  ) throw(SQLException, RuntimeException)
490*cdf0e10cSrcweir {
491*cdf0e10cSrcweir 	return sal_False;
492*cdf0e10cSrcweir }
493*cdf0e10cSrcweir // -------------------------------------------------------------------------
494*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::nullsAreSortedAtEnd(  ) throw(SQLException, RuntimeException)
495*cdf0e10cSrcweir {
496*cdf0e10cSrcweir 	return sal_False;
497*cdf0e10cSrcweir }
498*cdf0e10cSrcweir // -------------------------------------------------------------------------
499*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::nullsAreSortedAtStart(  ) throw(SQLException, RuntimeException)
500*cdf0e10cSrcweir {
501*cdf0e10cSrcweir 	return sal_False;
502*cdf0e10cSrcweir }
503*cdf0e10cSrcweir // -------------------------------------------------------------------------
504*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::nullsAreSortedHigh(  ) throw(SQLException, RuntimeException)
505*cdf0e10cSrcweir {
506*cdf0e10cSrcweir 	return sal_False;
507*cdf0e10cSrcweir }
508*cdf0e10cSrcweir // -------------------------------------------------------------------------
509*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::nullsAreSortedLow(  ) throw(SQLException, RuntimeException)
510*cdf0e10cSrcweir {
511*cdf0e10cSrcweir 	return sal_False;
512*cdf0e10cSrcweir }
513*cdf0e10cSrcweir // -------------------------------------------------------------------------
514*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsSchemasInProcedureCalls(  ) throw(SQLException, RuntimeException)
515*cdf0e10cSrcweir {
516*cdf0e10cSrcweir 	return sal_False;
517*cdf0e10cSrcweir }
518*cdf0e10cSrcweir // -------------------------------------------------------------------------
519*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsSchemasInPrivilegeDefinitions(  ) throw(SQLException, RuntimeException)
520*cdf0e10cSrcweir {
521*cdf0e10cSrcweir 	return sal_False;
522*cdf0e10cSrcweir }
523*cdf0e10cSrcweir // -------------------------------------------------------------------------
524*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsCatalogsInProcedureCalls(  ) throw(SQLException, RuntimeException)
525*cdf0e10cSrcweir {
526*cdf0e10cSrcweir 	return sal_False;
527*cdf0e10cSrcweir }
528*cdf0e10cSrcweir // -------------------------------------------------------------------------
529*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsCatalogsInPrivilegeDefinitions(  ) throw(SQLException, RuntimeException)
530*cdf0e10cSrcweir {
531*cdf0e10cSrcweir 	return sal_False;
532*cdf0e10cSrcweir }
533*cdf0e10cSrcweir // -------------------------------------------------------------------------
534*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsCorrelatedSubqueries(  ) throw(SQLException, RuntimeException)
535*cdf0e10cSrcweir {
536*cdf0e10cSrcweir 	return sal_False;
537*cdf0e10cSrcweir }
538*cdf0e10cSrcweir // -------------------------------------------------------------------------
539*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsSubqueriesInComparisons(  ) throw(SQLException, RuntimeException)
540*cdf0e10cSrcweir {
541*cdf0e10cSrcweir 	return sal_False;
542*cdf0e10cSrcweir }
543*cdf0e10cSrcweir // -------------------------------------------------------------------------
544*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsSubqueriesInExists(  ) throw(SQLException, RuntimeException)
545*cdf0e10cSrcweir {
546*cdf0e10cSrcweir 	return sal_False;
547*cdf0e10cSrcweir }
548*cdf0e10cSrcweir // -------------------------------------------------------------------------
549*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsSubqueriesInIns(  ) throw(SQLException, RuntimeException)
550*cdf0e10cSrcweir {
551*cdf0e10cSrcweir 	return sal_False;
552*cdf0e10cSrcweir }
553*cdf0e10cSrcweir // -------------------------------------------------------------------------
554*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsSubqueriesInQuantifieds(  ) throw(SQLException, RuntimeException)
555*cdf0e10cSrcweir {
556*cdf0e10cSrcweir 	return sal_False;
557*cdf0e10cSrcweir }
558*cdf0e10cSrcweir // -------------------------------------------------------------------------
559*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsANSI92IntermediateSQL(  ) throw(SQLException, RuntimeException)
560*cdf0e10cSrcweir {
561*cdf0e10cSrcweir 	return sal_False;
562*cdf0e10cSrcweir }
563*cdf0e10cSrcweir // -------------------------------------------------------------------------
564*cdf0e10cSrcweir ::rtl::OUString SAL_CALL MacabDatabaseMetaData::getURL(  ) throw(SQLException, RuntimeException)
565*cdf0e10cSrcweir {
566*cdf0e10cSrcweir 	// if someday we support more than the default address book,
567*cdf0e10cSrcweir 	// this method should return the URL which was used to create it
568*cdf0e10cSrcweir 	::rtl::OUString aValue = ::rtl::OUString::createFromAscii("sdbc:address:macab:");
569*cdf0e10cSrcweir 	return aValue;
570*cdf0e10cSrcweir }
571*cdf0e10cSrcweir // -------------------------------------------------------------------------
572*cdf0e10cSrcweir ::rtl::OUString SAL_CALL MacabDatabaseMetaData::getUserName(  ) throw(SQLException, RuntimeException)
573*cdf0e10cSrcweir {
574*cdf0e10cSrcweir 	::rtl::OUString aValue;
575*cdf0e10cSrcweir 	return aValue;
576*cdf0e10cSrcweir }
577*cdf0e10cSrcweir // -------------------------------------------------------------------------
578*cdf0e10cSrcweir ::rtl::OUString SAL_CALL MacabDatabaseMetaData::getDriverName(  ) throw(SQLException, RuntimeException)
579*cdf0e10cSrcweir {
580*cdf0e10cSrcweir 	::rtl::OUString aValue = ::rtl::OUString::createFromAscii("macab");
581*cdf0e10cSrcweir 	return aValue;
582*cdf0e10cSrcweir }
583*cdf0e10cSrcweir // -------------------------------------------------------------------------
584*cdf0e10cSrcweir ::rtl::OUString SAL_CALL MacabDatabaseMetaData::getDriverVersion() throw(SQLException, RuntimeException)
585*cdf0e10cSrcweir {
586*cdf0e10cSrcweir 	::rtl::OUString aValue = ::rtl::OUString::createFromAscii(MACAB_DRIVER_VERSION);
587*cdf0e10cSrcweir 	return aValue;
588*cdf0e10cSrcweir }
589*cdf0e10cSrcweir // -------------------------------------------------------------------------
590*cdf0e10cSrcweir ::rtl::OUString SAL_CALL MacabDatabaseMetaData::getDatabaseProductVersion(  ) throw(SQLException, RuntimeException)
591*cdf0e10cSrcweir {
592*cdf0e10cSrcweir 	::rtl::OUString aValue;
593*cdf0e10cSrcweir 	return aValue;
594*cdf0e10cSrcweir }
595*cdf0e10cSrcweir // -------------------------------------------------------------------------
596*cdf0e10cSrcweir ::rtl::OUString SAL_CALL MacabDatabaseMetaData::getDatabaseProductName(  ) throw(SQLException, RuntimeException)
597*cdf0e10cSrcweir {
598*cdf0e10cSrcweir 	::rtl::OUString aValue;
599*cdf0e10cSrcweir 	return aValue;
600*cdf0e10cSrcweir }
601*cdf0e10cSrcweir // -------------------------------------------------------------------------
602*cdf0e10cSrcweir ::rtl::OUString SAL_CALL MacabDatabaseMetaData::getProcedureTerm(  ) throw(SQLException, RuntimeException)
603*cdf0e10cSrcweir {
604*cdf0e10cSrcweir 	::rtl::OUString aValue;
605*cdf0e10cSrcweir 	return aValue;
606*cdf0e10cSrcweir }
607*cdf0e10cSrcweir // -------------------------------------------------------------------------
608*cdf0e10cSrcweir ::rtl::OUString SAL_CALL MacabDatabaseMetaData::getSchemaTerm(  ) throw(SQLException, RuntimeException)
609*cdf0e10cSrcweir {
610*cdf0e10cSrcweir 	::rtl::OUString aValue;
611*cdf0e10cSrcweir 	return aValue;
612*cdf0e10cSrcweir }
613*cdf0e10cSrcweir // -------------------------------------------------------------------------
614*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabDatabaseMetaData::getDriverMajorVersion(  ) throw(RuntimeException)
615*cdf0e10cSrcweir {
616*cdf0e10cSrcweir 	return MACAB_DRIVER_VERSION_MAJOR;
617*cdf0e10cSrcweir }
618*cdf0e10cSrcweir // -------------------------------------------------------------------------
619*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabDatabaseMetaData::getDefaultTransactionIsolation(  ) throw(SQLException, RuntimeException)
620*cdf0e10cSrcweir {
621*cdf0e10cSrcweir 	return TransactionIsolation::NONE;
622*cdf0e10cSrcweir }
623*cdf0e10cSrcweir // -------------------------------------------------------------------------
624*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabDatabaseMetaData::getDriverMinorVersion(  ) throw(RuntimeException)
625*cdf0e10cSrcweir {
626*cdf0e10cSrcweir 	return MACAB_DRIVER_VERSION_MINOR;
627*cdf0e10cSrcweir }
628*cdf0e10cSrcweir // -------------------------------------------------------------------------
629*cdf0e10cSrcweir ::rtl::OUString SAL_CALL MacabDatabaseMetaData::getSQLKeywords(  ) throw(SQLException, RuntimeException)
630*cdf0e10cSrcweir {
631*cdf0e10cSrcweir 	::rtl::OUString aValue;
632*cdf0e10cSrcweir 	return aValue;
633*cdf0e10cSrcweir }
634*cdf0e10cSrcweir // -------------------------------------------------------------------------
635*cdf0e10cSrcweir ::rtl::OUString SAL_CALL MacabDatabaseMetaData::getSearchStringEscape(  ) throw(SQLException, RuntimeException)
636*cdf0e10cSrcweir {
637*cdf0e10cSrcweir 	::rtl::OUString aValue;
638*cdf0e10cSrcweir 	return aValue;
639*cdf0e10cSrcweir }
640*cdf0e10cSrcweir // -------------------------------------------------------------------------
641*cdf0e10cSrcweir ::rtl::OUString SAL_CALL MacabDatabaseMetaData::getStringFunctions(  ) throw(SQLException, RuntimeException)
642*cdf0e10cSrcweir {
643*cdf0e10cSrcweir 	return ::rtl::OUString();
644*cdf0e10cSrcweir }
645*cdf0e10cSrcweir // -------------------------------------------------------------------------
646*cdf0e10cSrcweir ::rtl::OUString SAL_CALL MacabDatabaseMetaData::getTimeDateFunctions(  ) throw(SQLException, RuntimeException)
647*cdf0e10cSrcweir {
648*cdf0e10cSrcweir 	return ::rtl::OUString();
649*cdf0e10cSrcweir }
650*cdf0e10cSrcweir // -------------------------------------------------------------------------
651*cdf0e10cSrcweir ::rtl::OUString SAL_CALL MacabDatabaseMetaData::getSystemFunctions(  ) throw(SQLException, RuntimeException)
652*cdf0e10cSrcweir {
653*cdf0e10cSrcweir 	return ::rtl::OUString();
654*cdf0e10cSrcweir }
655*cdf0e10cSrcweir // -------------------------------------------------------------------------
656*cdf0e10cSrcweir ::rtl::OUString SAL_CALL MacabDatabaseMetaData::getNumericFunctions(  ) throw(SQLException, RuntimeException)
657*cdf0e10cSrcweir {
658*cdf0e10cSrcweir 	return ::rtl::OUString();
659*cdf0e10cSrcweir }
660*cdf0e10cSrcweir // -------------------------------------------------------------------------
661*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsExtendedSQLGrammar(  ) throw(SQLException, RuntimeException)
662*cdf0e10cSrcweir {
663*cdf0e10cSrcweir 	return sal_False;
664*cdf0e10cSrcweir }
665*cdf0e10cSrcweir // -------------------------------------------------------------------------
666*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsCoreSQLGrammar(  ) throw(SQLException, RuntimeException)
667*cdf0e10cSrcweir {
668*cdf0e10cSrcweir 	return sal_False;
669*cdf0e10cSrcweir }
670*cdf0e10cSrcweir // -------------------------------------------------------------------------
671*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsMinimumSQLGrammar(  ) throw(SQLException, RuntimeException)
672*cdf0e10cSrcweir {
673*cdf0e10cSrcweir 	return sal_True;
674*cdf0e10cSrcweir }
675*cdf0e10cSrcweir // -------------------------------------------------------------------------
676*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsFullOuterJoins(  ) throw(SQLException, RuntimeException)
677*cdf0e10cSrcweir {
678*cdf0e10cSrcweir 	return sal_False;
679*cdf0e10cSrcweir }
680*cdf0e10cSrcweir // -------------------------------------------------------------------------
681*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsLimitedOuterJoins(  ) throw(SQLException, RuntimeException)
682*cdf0e10cSrcweir {
683*cdf0e10cSrcweir 	return sal_False;
684*cdf0e10cSrcweir }
685*cdf0e10cSrcweir // -------------------------------------------------------------------------
686*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxColumnsInGroupBy(  ) throw(SQLException, RuntimeException)
687*cdf0e10cSrcweir {
688*cdf0e10cSrcweir 	sal_Int32 nValue = 0; // 0 means no limit
689*cdf0e10cSrcweir 	return nValue;
690*cdf0e10cSrcweir }
691*cdf0e10cSrcweir // -------------------------------------------------------------------------
692*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxColumnsInOrderBy(  ) throw(SQLException, RuntimeException)
693*cdf0e10cSrcweir {
694*cdf0e10cSrcweir 	sal_Int32 nValue = 0; // 0 means no limit
695*cdf0e10cSrcweir 	return nValue;
696*cdf0e10cSrcweir }
697*cdf0e10cSrcweir // -------------------------------------------------------------------------
698*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxColumnsInSelect(  ) throw(SQLException, RuntimeException)
699*cdf0e10cSrcweir {
700*cdf0e10cSrcweir 	sal_Int32 nValue = 0; // 0 means no limit
701*cdf0e10cSrcweir 	return nValue;
702*cdf0e10cSrcweir }
703*cdf0e10cSrcweir // -------------------------------------------------------------------------
704*cdf0e10cSrcweir sal_Int32 SAL_CALL MacabDatabaseMetaData::getMaxUserNameLength(  ) throw(SQLException, RuntimeException)
705*cdf0e10cSrcweir {
706*cdf0e10cSrcweir 	sal_Int32 nValue = 0; // 0 means no limit
707*cdf0e10cSrcweir 	return nValue;
708*cdf0e10cSrcweir }
709*cdf0e10cSrcweir // -------------------------------------------------------------------------
710*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsResultSetType( sal_Int32 setType ) throw(SQLException, RuntimeException)
711*cdf0e10cSrcweir {
712*cdf0e10cSrcweir 	switch (setType)
713*cdf0e10cSrcweir 	{
714*cdf0e10cSrcweir 		case ResultSetType::FORWARD_ONLY:
715*cdf0e10cSrcweir 		case ResultSetType::SCROLL_INSENSITIVE:
716*cdf0e10cSrcweir 			return sal_True;
717*cdf0e10cSrcweir 	}
718*cdf0e10cSrcweir 	return sal_False;
719*cdf0e10cSrcweir }
720*cdf0e10cSrcweir // -------------------------------------------------------------------------
721*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 ) throw(SQLException, RuntimeException)
722*cdf0e10cSrcweir {
723*cdf0e10cSrcweir 	switch (setType)
724*cdf0e10cSrcweir 	{
725*cdf0e10cSrcweir 		case ResultSetType::FORWARD_ONLY:
726*cdf0e10cSrcweir 		case ResultSetType::SCROLL_INSENSITIVE:
727*cdf0e10cSrcweir 			return sal_True;
728*cdf0e10cSrcweir 	}
729*cdf0e10cSrcweir 	return sal_False;
730*cdf0e10cSrcweir }
731*cdf0e10cSrcweir // -------------------------------------------------------------------------
732*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::ownUpdatesAreVisible( sal_Int32 ) throw(SQLException, RuntimeException)
733*cdf0e10cSrcweir {
734*cdf0e10cSrcweir 	return sal_False;
735*cdf0e10cSrcweir }
736*cdf0e10cSrcweir // -------------------------------------------------------------------------
737*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::ownDeletesAreVisible( sal_Int32 ) throw(SQLException, RuntimeException)
738*cdf0e10cSrcweir {
739*cdf0e10cSrcweir 	return sal_False;
740*cdf0e10cSrcweir }
741*cdf0e10cSrcweir // -------------------------------------------------------------------------
742*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::ownInsertsAreVisible( sal_Int32 ) throw(SQLException, RuntimeException)
743*cdf0e10cSrcweir {
744*cdf0e10cSrcweir 	return sal_False;
745*cdf0e10cSrcweir }
746*cdf0e10cSrcweir // -------------------------------------------------------------------------
747*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::othersUpdatesAreVisible( sal_Int32 ) throw(SQLException, RuntimeException)
748*cdf0e10cSrcweir {
749*cdf0e10cSrcweir 	return sal_False;
750*cdf0e10cSrcweir }
751*cdf0e10cSrcweir // -------------------------------------------------------------------------
752*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::othersDeletesAreVisible( sal_Int32 ) throw(SQLException, RuntimeException)
753*cdf0e10cSrcweir {
754*cdf0e10cSrcweir 	return sal_False;
755*cdf0e10cSrcweir }
756*cdf0e10cSrcweir // -------------------------------------------------------------------------
757*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::othersInsertsAreVisible( sal_Int32 ) throw(SQLException, RuntimeException)
758*cdf0e10cSrcweir {
759*cdf0e10cSrcweir 	return sal_False;
760*cdf0e10cSrcweir }
761*cdf0e10cSrcweir // -------------------------------------------------------------------------
762*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::updatesAreDetected( sal_Int32 ) throw(SQLException, RuntimeException)
763*cdf0e10cSrcweir {
764*cdf0e10cSrcweir 	return sal_False;
765*cdf0e10cSrcweir }
766*cdf0e10cSrcweir // -------------------------------------------------------------------------
767*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::deletesAreDetected( sal_Int32 ) throw(SQLException, RuntimeException)
768*cdf0e10cSrcweir {
769*cdf0e10cSrcweir 	return sal_False;
770*cdf0e10cSrcweir }
771*cdf0e10cSrcweir // -------------------------------------------------------------------------
772*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::insertsAreDetected( sal_Int32 ) throw(SQLException, RuntimeException)
773*cdf0e10cSrcweir {
774*cdf0e10cSrcweir 	return sal_False;
775*cdf0e10cSrcweir }
776*cdf0e10cSrcweir // -------------------------------------------------------------------------
777*cdf0e10cSrcweir sal_Bool SAL_CALL MacabDatabaseMetaData::supportsBatchUpdates(  ) throw(SQLException, RuntimeException)
778*cdf0e10cSrcweir {
779*cdf0e10cSrcweir 	return sal_False;
780*cdf0e10cSrcweir }
781*cdf0e10cSrcweir // -------------------------------------------------------------------------
782*cdf0e10cSrcweir Reference< XConnection > SAL_CALL MacabDatabaseMetaData::getConnection(  ) throw(SQLException, RuntimeException)
783*cdf0e10cSrcweir {
784*cdf0e10cSrcweir 	return (Reference< XConnection >) m_xConnection.get();
785*cdf0e10cSrcweir }
786*cdf0e10cSrcweir // -------------------------------------------------------------------------
787*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getTableTypes(  ) throw(SQLException, RuntimeException)
788*cdf0e10cSrcweir {
789*cdf0e10cSrcweir 	::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(ODatabaseMetaDataResultSet::eTableTypes);
790*cdf0e10cSrcweir 	Reference< XResultSet > xRef = pResult;
791*cdf0e10cSrcweir 
792*cdf0e10cSrcweir 	static ODatabaseMetaDataResultSet::ORows aRows;
793*cdf0e10cSrcweir 	static const ::rtl::OUString aTable(::rtl::OUString::createFromAscii("TABLE"));
794*cdf0e10cSrcweir 
795*cdf0e10cSrcweir 	if (aRows.empty())
796*cdf0e10cSrcweir 	{
797*cdf0e10cSrcweir 		ODatabaseMetaDataResultSet::ORow aRow(2);
798*cdf0e10cSrcweir 		aRow[0] = ODatabaseMetaDataResultSet::getEmptyValue();
799*cdf0e10cSrcweir 		aRow[1] = new ORowSetValueDecorator(aTable);
800*cdf0e10cSrcweir 		aRows.push_back(aRow);
801*cdf0e10cSrcweir 	}
802*cdf0e10cSrcweir 	pResult->setRows(aRows);
803*cdf0e10cSrcweir 	return xRef;
804*cdf0e10cSrcweir }
805*cdf0e10cSrcweir // -------------------------------------------------------------------------
806*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getTypeInfo(  ) throw(SQLException, RuntimeException)
807*cdf0e10cSrcweir {
808*cdf0e10cSrcweir 	ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(ODatabaseMetaDataResultSet::eTypeInfo);
809*cdf0e10cSrcweir 	Reference< XResultSet > xRef = pResult;
810*cdf0e10cSrcweir 
811*cdf0e10cSrcweir 	static ODatabaseMetaDataResultSet::ORows aRows;
812*cdf0e10cSrcweir 	if (aRows.empty())
813*cdf0e10cSrcweir 	{
814*cdf0e10cSrcweir 		ODatabaseMetaDataResultSet::ORow aRow(19);
815*cdf0e10cSrcweir 
816*cdf0e10cSrcweir 		// We support four types: char, timestamp, integer, float
817*cdf0e10cSrcweir 		aRow[0] = ODatabaseMetaDataResultSet::getEmptyValue();
818*cdf0e10cSrcweir 		aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("CHAR"));
819*cdf0e10cSrcweir 		aRow[2] = new ORowSetValueDecorator(DataType::CHAR);
820*cdf0e10cSrcweir 		aRow[3] = new ORowSetValueDecorator((sal_Int32) 254);
821*cdf0e10cSrcweir 		aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue();
822*cdf0e10cSrcweir 		aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue();
823*cdf0e10cSrcweir 		aRow[6] = ODatabaseMetaDataResultSet::getEmptyValue();
824*cdf0e10cSrcweir 		aRow[7] = new ORowSetValueDecorator((sal_Int32) ColumnValue::NULLABLE);
825*cdf0e10cSrcweir 		aRow[8] = ODatabaseMetaDataResultSet::get1Value();
826*cdf0e10cSrcweir 		aRow[9] = new ORowSetValueDecorator((sal_Int32) ColumnSearch::CHAR);
827*cdf0e10cSrcweir 		aRow[10] = ODatabaseMetaDataResultSet::get1Value();
828*cdf0e10cSrcweir 		aRow[11] = ODatabaseMetaDataResultSet::get0Value();
829*cdf0e10cSrcweir 		aRow[12] = ODatabaseMetaDataResultSet::get0Value();
830*cdf0e10cSrcweir 		aRow[13] = ODatabaseMetaDataResultSet::getEmptyValue();
831*cdf0e10cSrcweir 		aRow[14] = ODatabaseMetaDataResultSet::get0Value();
832*cdf0e10cSrcweir 		aRow[15] = ODatabaseMetaDataResultSet::get0Value();
833*cdf0e10cSrcweir 		aRow[16] = ODatabaseMetaDataResultSet::getEmptyValue();
834*cdf0e10cSrcweir 		aRow[17] = ODatabaseMetaDataResultSet::getEmptyValue();
835*cdf0e10cSrcweir 		aRow[18] = new ORowSetValueDecorator((sal_Int32) 10);
836*cdf0e10cSrcweir 
837*cdf0e10cSrcweir 		aRows.push_back(aRow);
838*cdf0e10cSrcweir 
839*cdf0e10cSrcweir 		aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("TIMESTAMP"));
840*cdf0e10cSrcweir 		aRow[2] = new ORowSetValueDecorator(DataType::TIMESTAMP);
841*cdf0e10cSrcweir 		aRow[3] = new ORowSetValueDecorator((sal_Int32)19);
842*cdf0e10cSrcweir 		aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue();
843*cdf0e10cSrcweir 		aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue();
844*cdf0e10cSrcweir 		aRows.push_back(aRow);
845*cdf0e10cSrcweir 
846*cdf0e10cSrcweir 		aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("INTEGER"));
847*cdf0e10cSrcweir 		aRow[2] = new ORowSetValueDecorator(DataType::INTEGER);
848*cdf0e10cSrcweir 		aRow[3] = new ORowSetValueDecorator((sal_Int32)20);
849*cdf0e10cSrcweir 		aRow[15] = new ORowSetValueDecorator((sal_Int32)20);
850*cdf0e10cSrcweir 		aRows.push_back(aRow);
851*cdf0e10cSrcweir 
852*cdf0e10cSrcweir 		aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("FLOAT"));
853*cdf0e10cSrcweir 		aRow[2] = new ORowSetValueDecorator(DataType::FLOAT);
854*cdf0e10cSrcweir 		aRow[3] = new ORowSetValueDecorator((sal_Int32)20);
855*cdf0e10cSrcweir 		aRow[15] = new ORowSetValueDecorator((sal_Int32)15);
856*cdf0e10cSrcweir 		aRows.push_back(aRow);
857*cdf0e10cSrcweir 	}
858*cdf0e10cSrcweir 	pResult->setRows(aRows);
859*cdf0e10cSrcweir 	return xRef;
860*cdf0e10cSrcweir }
861*cdf0e10cSrcweir // -------------------------------------------------------------------------
862*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getCatalogs(  ) throw(SQLException, RuntimeException)
863*cdf0e10cSrcweir {
864*cdf0e10cSrcweir     return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eCatalogs );
865*cdf0e10cSrcweir }
866*cdf0e10cSrcweir // -----------------------------------------------------------------------------
867*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getSchemas(  ) throw(SQLException, RuntimeException)
868*cdf0e10cSrcweir {
869*cdf0e10cSrcweir     return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eSchemas );
870*cdf0e10cSrcweir }
871*cdf0e10cSrcweir // -------------------------------------------------------------------------
872*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getColumnPrivileges(
873*cdf0e10cSrcweir 	const Any&, const ::rtl::OUString&, const ::rtl::OUString&,
874*cdf0e10cSrcweir 	const ::rtl::OUString& ) throw(SQLException, RuntimeException)
875*cdf0e10cSrcweir {
876*cdf0e10cSrcweir     return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eColumnPrivileges );
877*cdf0e10cSrcweir }
878*cdf0e10cSrcweir // -------------------------------------------------------------------------
879*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getColumns(
880*cdf0e10cSrcweir 	const Any&,
881*cdf0e10cSrcweir 	const ::rtl::OUString&,
882*cdf0e10cSrcweir 	const ::rtl::OUString& tableNamePattern,
883*cdf0e10cSrcweir 	const ::rtl::OUString& columnNamePattern) throw(SQLException, RuntimeException)
884*cdf0e10cSrcweir {
885*cdf0e10cSrcweir 	::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eColumns);
886*cdf0e10cSrcweir 	Reference< XResultSet > xRef = pResult;
887*cdf0e10cSrcweir 	MacabRecords *aRecords;
888*cdf0e10cSrcweir 	::rtl::OUString sTableName;
889*cdf0e10cSrcweir 
890*cdf0e10cSrcweir 	aRecords = m_xConnection->getAddressBook()->getMacabRecordsMatch(tableNamePattern);
891*cdf0e10cSrcweir 
892*cdf0e10cSrcweir 	ODatabaseMetaDataResultSet::ORows aRows;
893*cdf0e10cSrcweir 	if(aRecords != NULL)
894*cdf0e10cSrcweir 	{
895*cdf0e10cSrcweir 		MacabHeader *aHeader = aRecords->getHeader();
896*cdf0e10cSrcweir 		sTableName = aRecords->getName();
897*cdf0e10cSrcweir 
898*cdf0e10cSrcweir 		ODatabaseMetaDataResultSet::ORow aRow(19);
899*cdf0e10cSrcweir 
900*cdf0e10cSrcweir 		aRow[0] = ODatabaseMetaDataResultSet::getEmptyValue();
901*cdf0e10cSrcweir 		aRow[1] = ODatabaseMetaDataResultSet::getEmptyValue();
902*cdf0e10cSrcweir 		aRow[2] = ODatabaseMetaDataResultSet::getEmptyValue();
903*cdf0e10cSrcweir 		aRow[3] = new ORowSetValueDecorator(sTableName);
904*cdf0e10cSrcweir 		aRow[8] = ODatabaseMetaDataResultSet::getEmptyValue();
905*cdf0e10cSrcweir 		aRow[9] = ODatabaseMetaDataResultSet::get0Value();
906*cdf0e10cSrcweir 		aRow[10] = new ORowSetValueDecorator((sal_Int32) 10);
907*cdf0e10cSrcweir 		aRow[11] = ODatabaseMetaDataResultSet::get1Value();
908*cdf0e10cSrcweir 		aRow[12] = ODatabaseMetaDataResultSet::getEmptyValue();
909*cdf0e10cSrcweir 		aRow[13] = ODatabaseMetaDataResultSet::getEmptyValue();
910*cdf0e10cSrcweir 		aRow[14] = ODatabaseMetaDataResultSet::getEmptyValue();
911*cdf0e10cSrcweir 		aRow[15] = ODatabaseMetaDataResultSet::getEmptyValue();
912*cdf0e10cSrcweir 		aRow[16] = new ORowSetValueDecorator((sal_Int32) 254);
913*cdf0e10cSrcweir 		aRow[18] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("YES"));
914*cdf0e10cSrcweir 
915*cdf0e10cSrcweir 		sal_Int32 nPosition = 1;
916*cdf0e10cSrcweir 		::rtl::OUString sName;
917*cdf0e10cSrcweir 
918*cdf0e10cSrcweir 		MacabHeader::iterator aField;
919*cdf0e10cSrcweir 
920*cdf0e10cSrcweir 		for (	aField = aHeader->begin();
921*cdf0e10cSrcweir 				aField != aHeader->end();
922*cdf0e10cSrcweir 				++aField, ++nPosition)
923*cdf0e10cSrcweir 		{
924*cdf0e10cSrcweir 
925*cdf0e10cSrcweir 			sName = CFStringToOUString((CFStringRef) (*aField)->value);
926*cdf0e10cSrcweir 			if (match(columnNamePattern, sName, '\0'))
927*cdf0e10cSrcweir 			{
928*cdf0e10cSrcweir 				aRow[4] = new ORowSetValueDecorator(sName);
929*cdf0e10cSrcweir 				aRow[17] = new ORowSetValueDecorator(nPosition);
930*cdf0e10cSrcweir 				switch((*aField)->type)
931*cdf0e10cSrcweir 				{
932*cdf0e10cSrcweir 					case kABStringProperty:
933*cdf0e10cSrcweir 						aRow[5] = new ORowSetValueDecorator(DataType::CHAR);
934*cdf0e10cSrcweir 						aRow[6] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("CHAR"));
935*cdf0e10cSrcweir 						aRow[7] = new ORowSetValueDecorator((sal_Int32) 256);
936*cdf0e10cSrcweir 						aRows.push_back(aRow);
937*cdf0e10cSrcweir 						break;
938*cdf0e10cSrcweir 					case kABDateProperty:
939*cdf0e10cSrcweir 						aRow[5] = new ORowSetValueDecorator(DataType::TIMESTAMP);
940*cdf0e10cSrcweir 						aRow[6] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("TIMESTAMP"));
941*cdf0e10cSrcweir 						aRows.push_back(aRow);
942*cdf0e10cSrcweir 						break;
943*cdf0e10cSrcweir 					case kABIntegerProperty:
944*cdf0e10cSrcweir 						aRow[5] = new ORowSetValueDecorator(DataType::INTEGER);
945*cdf0e10cSrcweir 						aRow[6] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("INTEGER"));
946*cdf0e10cSrcweir 						aRow[7] = new ORowSetValueDecorator((sal_Int32) 20);
947*cdf0e10cSrcweir 						aRows.push_back(aRow);
948*cdf0e10cSrcweir 						break;
949*cdf0e10cSrcweir 					case kABRealProperty:
950*cdf0e10cSrcweir 						aRow[5] = new ORowSetValueDecorator(DataType::FLOAT);
951*cdf0e10cSrcweir 						aRow[6] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("FLOAT"));
952*cdf0e10cSrcweir 						aRow[7] = new ORowSetValueDecorator((sal_Int32) 15);
953*cdf0e10cSrcweir 						aRows.push_back(aRow);
954*cdf0e10cSrcweir 						break;
955*cdf0e10cSrcweir 					default:
956*cdf0e10cSrcweir 						;
957*cdf0e10cSrcweir 						// shouldn't happen -- throw an error...?
958*cdf0e10cSrcweir 				}
959*cdf0e10cSrcweir 			}
960*cdf0e10cSrcweir 		}
961*cdf0e10cSrcweir 	}
962*cdf0e10cSrcweir 	pResult->setRows(aRows);
963*cdf0e10cSrcweir 	return xRef;
964*cdf0e10cSrcweir }
965*cdf0e10cSrcweir // -------------------------------------------------------------------------
966*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getTables(
967*cdf0e10cSrcweir 	const Any&,
968*cdf0e10cSrcweir 	const ::rtl::OUString&,
969*cdf0e10cSrcweir 	const ::rtl::OUString&,
970*cdf0e10cSrcweir 	const Sequence< ::rtl::OUString >& types) throw(SQLException, RuntimeException)
971*cdf0e10cSrcweir {
972*cdf0e10cSrcweir 	ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTables);
973*cdf0e10cSrcweir 	Reference< XResultSet > xRef = pResult;
974*cdf0e10cSrcweir 
975*cdf0e10cSrcweir 	// check whether we have tables in the requested types
976*cdf0e10cSrcweir 	// for the moment, we answer only the "TABLE" table type
977*cdf0e10cSrcweir 	// when no types are given at all, we return all the tables
978*cdf0e10cSrcweir 	static const ::rtl::OUString aTable(::rtl::OUString::createFromAscii("TABLE"));
979*cdf0e10cSrcweir 	sal_Bool bTableFound = sal_False;
980*cdf0e10cSrcweir 	const ::rtl::OUString* p = types.getConstArray(),
981*cdf0e10cSrcweir 	                     * pEnd = p + types.getLength();
982*cdf0e10cSrcweir 
983*cdf0e10cSrcweir 	if (p == pEnd)
984*cdf0e10cSrcweir 	{
985*cdf0e10cSrcweir 		bTableFound = sal_True;
986*cdf0e10cSrcweir 	}
987*cdf0e10cSrcweir 	else while (p < pEnd)
988*cdf0e10cSrcweir 	{
989*cdf0e10cSrcweir 		if (match(*p, aTable, '\0'))
990*cdf0e10cSrcweir 		{
991*cdf0e10cSrcweir 			bTableFound = sal_True;
992*cdf0e10cSrcweir 			break;
993*cdf0e10cSrcweir 		}
994*cdf0e10cSrcweir 		p++;
995*cdf0e10cSrcweir 	}
996*cdf0e10cSrcweir 	if (!bTableFound)
997*cdf0e10cSrcweir 		return xRef;
998*cdf0e10cSrcweir 
999*cdf0e10cSrcweir 	static ODatabaseMetaDataResultSet::ORows aRows;
1000*cdf0e10cSrcweir 
1001*cdf0e10cSrcweir 	if (aRows.empty())
1002*cdf0e10cSrcweir 	{
1003*cdf0e10cSrcweir 		ODatabaseMetaDataResultSet::ORow aRow(6);
1004*cdf0e10cSrcweir 
1005*cdf0e10cSrcweir 		MacabRecords *xRecords = m_xConnection->getAddressBook()->getMacabRecords();
1006*cdf0e10cSrcweir 		::std::vector<MacabGroup *> xGroups = m_xConnection->getAddressBook()->getMacabGroups();
1007*cdf0e10cSrcweir 		sal_Int32 i, nGroups;
1008*cdf0e10cSrcweir 		nGroups = xGroups.size();
1009*cdf0e10cSrcweir 
1010*cdf0e10cSrcweir 		aRow[0] = ODatabaseMetaDataResultSet::getEmptyValue();
1011*cdf0e10cSrcweir 		aRow[1] = ODatabaseMetaDataResultSet::getEmptyValue();
1012*cdf0e10cSrcweir 		aRow[2] = ODatabaseMetaDataResultSet::getEmptyValue();
1013*cdf0e10cSrcweir 		aRow[3] = new ORowSetValueDecorator(xRecords->getName());
1014*cdf0e10cSrcweir 		aRow[4] = new ORowSetValueDecorator(aTable);
1015*cdf0e10cSrcweir 		aRow[5] = ODatabaseMetaDataResultSet::getEmptyValue();
1016*cdf0e10cSrcweir 		aRows.push_back(aRow);
1017*cdf0e10cSrcweir 
1018*cdf0e10cSrcweir 		for(i = 0; i < nGroups; i++)
1019*cdf0e10cSrcweir 		{
1020*cdf0e10cSrcweir 			aRow[3] = new ORowSetValueDecorator(xGroups[i]->getName());
1021*cdf0e10cSrcweir 			aRows.push_back(aRow);
1022*cdf0e10cSrcweir 		}
1023*cdf0e10cSrcweir 	}
1024*cdf0e10cSrcweir 	pResult->setRows(aRows);
1025*cdf0e10cSrcweir 	return xRef;
1026*cdf0e10cSrcweir }
1027*cdf0e10cSrcweir // -------------------------------------------------------------------------
1028*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getProcedureColumns(
1029*cdf0e10cSrcweir 	const Any&, const ::rtl::OUString&,
1030*cdf0e10cSrcweir 	const ::rtl::OUString&, const ::rtl::OUString& ) throw(SQLException, RuntimeException)
1031*cdf0e10cSrcweir {
1032*cdf0e10cSrcweir     return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eProcedureColumns );
1033*cdf0e10cSrcweir }
1034*cdf0e10cSrcweir // -------------------------------------------------------------------------
1035*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getProcedures(
1036*cdf0e10cSrcweir 	const Any&, const ::rtl::OUString&,
1037*cdf0e10cSrcweir 	const ::rtl::OUString& ) throw(SQLException, RuntimeException)
1038*cdf0e10cSrcweir {
1039*cdf0e10cSrcweir     return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eProcedures );
1040*cdf0e10cSrcweir }
1041*cdf0e10cSrcweir // -------------------------------------------------------------------------
1042*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getVersionColumns(
1043*cdf0e10cSrcweir 	const Any&, const ::rtl::OUString&, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
1044*cdf0e10cSrcweir {
1045*cdf0e10cSrcweir     return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eVersionColumns );
1046*cdf0e10cSrcweir 
1047*cdf0e10cSrcweir 	::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eVersionColumns);
1048*cdf0e10cSrcweir 	Reference< XResultSet > xRef = pResult;
1049*cdf0e10cSrcweir 
1050*cdf0e10cSrcweir 	ODatabaseMetaDataResultSet::ORows aRows;
1051*cdf0e10cSrcweir 
1052*cdf0e10cSrcweir 	if (m_xConnection->getAddressBook()->getMacabRecords(table) != NULL)
1053*cdf0e10cSrcweir 	{
1054*cdf0e10cSrcweir 		ODatabaseMetaDataResultSet::ORow aRow( 9 );
1055*cdf0e10cSrcweir 
1056*cdf0e10cSrcweir 		::rtl::OUString sName = CFStringToOUString(kABModificationDateProperty);
1057*cdf0e10cSrcweir 
1058*cdf0e10cSrcweir 		aRow[0] = ODatabaseMetaDataResultSet::getEmptyValue();
1059*cdf0e10cSrcweir 		aRow[1] = ODatabaseMetaDataResultSet::getEmptyValue();
1060*cdf0e10cSrcweir 		aRow[2] = new ORowSetValueDecorator(sName);
1061*cdf0e10cSrcweir 		aRow[3] = new ORowSetValueDecorator(DataType::TIMESTAMP);
1062*cdf0e10cSrcweir 		aRow[4] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("TIMESTAMP"));
1063*cdf0e10cSrcweir 
1064*cdf0e10cSrcweir 		aRow[5] = ODatabaseMetaDataResultSet::getEmptyValue();
1065*cdf0e10cSrcweir 		aRow[6] = ODatabaseMetaDataResultSet::getEmptyValue();
1066*cdf0e10cSrcweir 		aRow[7] = ODatabaseMetaDataResultSet::getEmptyValue();
1067*cdf0e10cSrcweir 		aRow[8] = ODatabaseMetaDataResultSet::getEmptyValue();
1068*cdf0e10cSrcweir 
1069*cdf0e10cSrcweir 		aRows.push_back(aRow);
1070*cdf0e10cSrcweir 	}
1071*cdf0e10cSrcweir 	pResult->setRows(aRows);
1072*cdf0e10cSrcweir 	return xRef;
1073*cdf0e10cSrcweir }
1074*cdf0e10cSrcweir // -------------------------------------------------------------------------
1075*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getExportedKeys(
1076*cdf0e10cSrcweir 	const Any&, const ::rtl::OUString&, const ::rtl::OUString& ) throw(SQLException, RuntimeException)
1077*cdf0e10cSrcweir {
1078*cdf0e10cSrcweir     return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eExportedKeys );
1079*cdf0e10cSrcweir }
1080*cdf0e10cSrcweir // -------------------------------------------------------------------------
1081*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getImportedKeys(
1082*cdf0e10cSrcweir 	const Any&, const ::rtl::OUString&, const ::rtl::OUString& ) throw(SQLException, RuntimeException)
1083*cdf0e10cSrcweir {
1084*cdf0e10cSrcweir     return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eImportedKeys );
1085*cdf0e10cSrcweir }
1086*cdf0e10cSrcweir // -------------------------------------------------------------------------
1087*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getPrimaryKeys(
1088*cdf0e10cSrcweir 	const Any&, const ::rtl::OUString&, const ::rtl::OUString& ) throw(SQLException, RuntimeException)
1089*cdf0e10cSrcweir {
1090*cdf0e10cSrcweir     return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::ePrimaryKeys );
1091*cdf0e10cSrcweir }
1092*cdf0e10cSrcweir // -------------------------------------------------------------------------
1093*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getIndexInfo(
1094*cdf0e10cSrcweir 	const Any&, const ::rtl::OUString&, const ::rtl::OUString&,
1095*cdf0e10cSrcweir 	sal_Bool, sal_Bool ) throw(SQLException, RuntimeException)
1096*cdf0e10cSrcweir {
1097*cdf0e10cSrcweir     return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eIndexInfo );
1098*cdf0e10cSrcweir }
1099*cdf0e10cSrcweir // -------------------------------------------------------------------------
1100*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getBestRowIdentifier(
1101*cdf0e10cSrcweir 	const Any&, const ::rtl::OUString&, const ::rtl::OUString&, sal_Int32,
1102*cdf0e10cSrcweir 	sal_Bool ) throw(SQLException, RuntimeException)
1103*cdf0e10cSrcweir {
1104*cdf0e10cSrcweir     return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eBestRowIdentifier );
1105*cdf0e10cSrcweir }
1106*cdf0e10cSrcweir // -------------------------------------------------------------------------
1107*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getTablePrivileges(
1108*cdf0e10cSrcweir 	const Any&, const ::rtl::OUString&, const ::rtl::OUString& ) throw(SQLException, RuntimeException)
1109*cdf0e10cSrcweir {
1110*cdf0e10cSrcweir     return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eTablePrivileges );
1111*cdf0e10cSrcweir }
1112*cdf0e10cSrcweir // -------------------------------------------------------------------------
1113*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getCrossReference(
1114*cdf0e10cSrcweir 	const Any&, const ::rtl::OUString&,
1115*cdf0e10cSrcweir 	const ::rtl::OUString&, const Any&,
1116*cdf0e10cSrcweir 	const ::rtl::OUString&, const ::rtl::OUString& ) throw(SQLException, RuntimeException)
1117*cdf0e10cSrcweir {
1118*cdf0e10cSrcweir     return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eCrossReference );
1119*cdf0e10cSrcweir }
1120*cdf0e10cSrcweir // -------------------------------------------------------------------------
1121*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getUDTs( const Any&, const ::rtl::OUString&, const ::rtl::OUString&, const Sequence< sal_Int32 >& ) throw(SQLException, RuntimeException)
1122*cdf0e10cSrcweir {
1123*cdf0e10cSrcweir 	OSL_ENSURE(0,"Not implemented yet!");
1124*cdf0e10cSrcweir 	throw SQLException();
1125*cdf0e10cSrcweir }
1126*cdf0e10cSrcweir // -----------------------------------------------------------------------------
1127