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