1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: MacabDatabaseMetaData.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_connectivity.hxx"
34 #include "MacabDatabaseMetaData.hxx"
35 #include "MacabAddressBook.hxx"
36 #include "MacabHeader.hxx"
37 #include "MacabGroup.hxx"
38 #include "macabutilities.hxx"
40 #ifndef CONNECTIVITY_MACAB_DRIVER_HXX_
41 #include "MacabDriver.hxx"
43 #include "FDatabaseMetaDataResultSet.hxx"
44 #include "OTypeInfo.hxx"
45 #include <com/sun/star/sdbc/ColumnValue.hpp>
46 #include <com/sun/star/sdbc/ResultSetType.hpp>
47 #include <com/sun/star/sdbc/TransactionIsolation.hpp>
51 using namespace connectivity::macab
;
52 using namespace com::sun::star::uno
;
53 using namespace com::sun::star::lang
;
54 using namespace com::sun::star::beans
;
55 using namespace com::sun::star::sdbc
;
57 MacabDatabaseMetaData::MacabDatabaseMetaData(MacabConnection
* _pCon
)
58 : m_xConnection(_pCon
),
59 m_bUseCatalog(sal_True
)
61 OSL_ENSURE(_pCon
,"MacabDatabaseMetaData::MacabDatabaseMetaData: No connection set!");
63 osl_incrementInterlockedCount( &m_refCount
);
64 m_bUseCatalog
= !(usesLocalFiles() || usesLocalFilePerTable());
65 osl_decrementInterlockedCount( &m_refCount
);
67 // -------------------------------------------------------------------------
68 MacabDatabaseMetaData::~MacabDatabaseMetaData()
71 // -------------------------------------------------------------------------
72 ::rtl::OUString SAL_CALL
MacabDatabaseMetaData::getCatalogSeparator( ) throw(SQLException
, RuntimeException
)
76 { // do some special here for you database
81 // -------------------------------------------------------------------------
82 sal_Int32 SAL_CALL
MacabDatabaseMetaData::getMaxBinaryLiteralLength( ) throw(SQLException
, RuntimeException
)
84 sal_Int32 nValue
= 0; // 0 means no limit
87 // -------------------------------------------------------------------------
88 sal_Int32 SAL_CALL
MacabDatabaseMetaData::getMaxRowSize( ) throw(SQLException
, RuntimeException
)
90 sal_Int32 nValue
= 0; // 0 means no limit
93 // -------------------------------------------------------------------------
94 sal_Int32 SAL_CALL
MacabDatabaseMetaData::getMaxCatalogNameLength( ) throw(SQLException
, RuntimeException
)
96 sal_Int32 nValue
= 0; // 0 means no limit
99 // -------------------------------------------------------------------------
100 sal_Int32 SAL_CALL
MacabDatabaseMetaData::getMaxCharLiteralLength( ) throw(SQLException
, RuntimeException
)
102 sal_Int32 nValue
= 0; // 0 means no limit
105 // -------------------------------------------------------------------------
106 sal_Int32 SAL_CALL
MacabDatabaseMetaData::getMaxColumnNameLength( ) throw(SQLException
, RuntimeException
)
108 sal_Int32 nValue
= 0; // 0 means no limit
111 // -------------------------------------------------------------------------
112 sal_Int32 SAL_CALL
MacabDatabaseMetaData::getMaxColumnsInIndex( ) throw(SQLException
, RuntimeException
)
114 sal_Int32 nValue
= 0; // 0 means no limit
117 // -------------------------------------------------------------------------
118 sal_Int32 SAL_CALL
MacabDatabaseMetaData::getMaxCursorNameLength( ) throw(SQLException
, RuntimeException
)
120 sal_Int32 nValue
= 0; // 0 means no limit
123 // -------------------------------------------------------------------------
124 sal_Int32 SAL_CALL
MacabDatabaseMetaData::getMaxConnections( ) throw(SQLException
, RuntimeException
)
126 sal_Int32 nValue
= 0; // 0 means no limit
129 // -------------------------------------------------------------------------
130 sal_Int32 SAL_CALL
MacabDatabaseMetaData::getMaxColumnsInTable( ) throw(SQLException
, RuntimeException
)
132 sal_Int32 nValue
= 0; // 0 means no limit
135 // -------------------------------------------------------------------------
136 sal_Int32 SAL_CALL
MacabDatabaseMetaData::getMaxStatementLength( ) throw(SQLException
, RuntimeException
)
138 sal_Int32 nValue
= 0; // 0 means no limit
141 // -------------------------------------------------------------------------
142 sal_Int32 SAL_CALL
MacabDatabaseMetaData::getMaxTableNameLength( ) throw(SQLException
, RuntimeException
)
144 sal_Int32 nValue
= 0; // 0 means no limit
147 // -------------------------------------------------------------------------
148 sal_Int32 SAL_CALL
MacabDatabaseMetaData::getMaxTablesInSelect( ) throw(SQLException
, RuntimeException
)
150 // MaxTablesInSelect describes how many tables can participate in the FROM part of a given SELECT statement,
151 // currently, the resultset/statement implementations can cope with one table only
152 sal_Int32 nValue
= 1;
155 // -------------------------------------------------------------------------
156 sal_Bool SAL_CALL
MacabDatabaseMetaData::doesMaxRowSizeIncludeBlobs( ) throw(SQLException
, RuntimeException
)
160 // -------------------------------------------------------------------------
161 sal_Bool SAL_CALL
MacabDatabaseMetaData::storesLowerCaseQuotedIdentifiers( ) throw(SQLException
, RuntimeException
)
165 // -------------------------------------------------------------------------
166 sal_Bool SAL_CALL
MacabDatabaseMetaData::storesLowerCaseIdentifiers( ) throw(SQLException
, RuntimeException
)
170 // -------------------------------------------------------------------------
171 sal_Bool SAL_CALL
MacabDatabaseMetaData::storesMixedCaseQuotedIdentifiers( ) throw(SQLException
, RuntimeException
)
175 // -------------------------------------------------------------------------
176 sal_Bool SAL_CALL
MacabDatabaseMetaData::storesMixedCaseIdentifiers( ) throw(SQLException
, RuntimeException
)
180 // -------------------------------------------------------------------------
181 sal_Bool SAL_CALL
MacabDatabaseMetaData::storesUpperCaseQuotedIdentifiers( ) throw(SQLException
, RuntimeException
)
185 // -------------------------------------------------------------------------
186 sal_Bool SAL_CALL
MacabDatabaseMetaData::storesUpperCaseIdentifiers( ) throw(SQLException
, RuntimeException
)
190 // -------------------------------------------------------------------------
191 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsAlterTableWithAddColumn( ) throw(SQLException
, RuntimeException
)
195 // -------------------------------------------------------------------------
196 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsAlterTableWithDropColumn( ) throw(SQLException
, RuntimeException
)
200 // -------------------------------------------------------------------------
201 sal_Int32 SAL_CALL
MacabDatabaseMetaData::getMaxIndexLength( ) throw(SQLException
, RuntimeException
)
203 sal_Int32 nValue
= 0; // 0 means no limit
206 // -------------------------------------------------------------------------
207 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsNonNullableColumns( ) throw(SQLException
, RuntimeException
)
211 // -------------------------------------------------------------------------
212 ::rtl::OUString SAL_CALL
MacabDatabaseMetaData::getCatalogTerm( ) throw(SQLException
, RuntimeException
)
214 ::rtl::OUString aVal
;
220 // -------------------------------------------------------------------------
221 ::rtl::OUString SAL_CALL
MacabDatabaseMetaData::getIdentifierQuoteString( ) throw(SQLException
, RuntimeException
)
223 // normally this is "
224 ::rtl::OUString aVal
= ::rtl::OUString::createFromAscii("\"");
227 // -------------------------------------------------------------------------
228 ::rtl::OUString SAL_CALL
MacabDatabaseMetaData::getExtraNameCharacters( ) throw(SQLException
, RuntimeException
)
230 ::rtl::OUString aVal
;
233 // -------------------------------------------------------------------------
234 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsDifferentTableCorrelationNames( ) throw(SQLException
, RuntimeException
)
238 // -------------------------------------------------------------------------
239 sal_Bool SAL_CALL
MacabDatabaseMetaData::isCatalogAtStart( ) throw(SQLException
, RuntimeException
)
241 sal_Bool bValue
= sal_False
;
247 // -------------------------------------------------------------------------
248 sal_Bool SAL_CALL
MacabDatabaseMetaData::dataDefinitionIgnoredInTransactions( ) throw(SQLException
, RuntimeException
)
252 // -------------------------------------------------------------------------
253 sal_Bool SAL_CALL
MacabDatabaseMetaData::dataDefinitionCausesTransactionCommit( ) throw(SQLException
, RuntimeException
)
257 // -------------------------------------------------------------------------
258 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsDataManipulationTransactionsOnly( ) throw(SQLException
, RuntimeException
)
262 // -------------------------------------------------------------------------
263 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions( ) throw(SQLException
, RuntimeException
)
267 // -------------------------------------------------------------------------
268 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsPositionedDelete( ) throw(SQLException
, RuntimeException
)
272 // -------------------------------------------------------------------------
273 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsPositionedUpdate( ) throw(SQLException
, RuntimeException
)
277 // -------------------------------------------------------------------------
278 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsOpenStatementsAcrossRollback( ) throw(SQLException
, RuntimeException
)
282 // -------------------------------------------------------------------------
283 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsOpenStatementsAcrossCommit( ) throw(SQLException
, RuntimeException
)
287 // -------------------------------------------------------------------------
288 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsOpenCursorsAcrossCommit( ) throw(SQLException
, RuntimeException
)
292 // -------------------------------------------------------------------------
293 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsOpenCursorsAcrossRollback( ) throw(SQLException
, RuntimeException
)
297 // -------------------------------------------------------------------------
298 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsTransactionIsolationLevel( sal_Int32
) throw(SQLException
, RuntimeException
)
302 // -------------------------------------------------------------------------
303 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsSchemasInDataManipulation( ) throw(SQLException
, RuntimeException
)
307 // -------------------------------------------------------------------------
308 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsANSI92FullSQL( ) throw(SQLException
, RuntimeException
)
312 // -------------------------------------------------------------------------
313 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsANSI92EntryLevelSQL( ) throw(SQLException
, RuntimeException
)
315 return sal_True
; // should be supported at least
317 // -------------------------------------------------------------------------
318 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsIntegrityEnhancementFacility( ) throw(SQLException
, RuntimeException
)
322 // -------------------------------------------------------------------------
323 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsSchemasInIndexDefinitions( ) throw(SQLException
, RuntimeException
)
327 // -------------------------------------------------------------------------
328 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsSchemasInTableDefinitions( ) throw(SQLException
, RuntimeException
)
332 // -------------------------------------------------------------------------
333 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsCatalogsInTableDefinitions( ) throw(SQLException
, RuntimeException
)
337 // -------------------------------------------------------------------------
338 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsCatalogsInIndexDefinitions( ) throw(SQLException
, RuntimeException
)
342 // -------------------------------------------------------------------------
343 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsCatalogsInDataManipulation( ) throw(SQLException
, RuntimeException
)
347 // -------------------------------------------------------------------------
348 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsOuterJoins( ) throw(SQLException
, RuntimeException
)
352 // -------------------------------------------------------------------------
353 sal_Int32 SAL_CALL
MacabDatabaseMetaData::getMaxStatements( ) throw(SQLException
, RuntimeException
)
355 sal_Int32 nValue
= 0; // 0 means no limit
358 // -------------------------------------------------------------------------
359 sal_Int32 SAL_CALL
MacabDatabaseMetaData::getMaxProcedureNameLength( ) throw(SQLException
, RuntimeException
)
361 sal_Int32 nValue
= 0; // 0 means no limit
364 // -------------------------------------------------------------------------
365 sal_Int32 SAL_CALL
MacabDatabaseMetaData::getMaxSchemaNameLength( ) throw(SQLException
, RuntimeException
)
367 sal_Int32 nValue
= 0; // 0 means no limit
370 // -------------------------------------------------------------------------
371 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsTransactions( ) throw(SQLException
, RuntimeException
)
375 // -------------------------------------------------------------------------
376 sal_Bool SAL_CALL
MacabDatabaseMetaData::allProceduresAreCallable( ) throw(SQLException
, RuntimeException
)
380 // -------------------------------------------------------------------------
381 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsStoredProcedures( ) throw(SQLException
, RuntimeException
)
385 // -------------------------------------------------------------------------
386 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsSelectForUpdate( ) throw(SQLException
, RuntimeException
)
390 // -------------------------------------------------------------------------
391 sal_Bool SAL_CALL
MacabDatabaseMetaData::allTablesAreSelectable( ) throw(SQLException
, RuntimeException
)
395 // -------------------------------------------------------------------------
396 sal_Bool SAL_CALL
MacabDatabaseMetaData::isReadOnly( ) throw(SQLException
, RuntimeException
)
398 // for the moment, we have read-only addresses, but this might change in the future
401 // -------------------------------------------------------------------------
402 sal_Bool SAL_CALL
MacabDatabaseMetaData::usesLocalFiles( ) throw(SQLException
, RuntimeException
)
406 // -------------------------------------------------------------------------
407 sal_Bool SAL_CALL
MacabDatabaseMetaData::usesLocalFilePerTable( ) throw(SQLException
, RuntimeException
)
411 // -------------------------------------------------------------------------
412 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsTypeConversion( ) throw(SQLException
, RuntimeException
)
416 // -------------------------------------------------------------------------
417 sal_Bool SAL_CALL
MacabDatabaseMetaData::nullPlusNonNullIsNull( ) throw(SQLException
, RuntimeException
)
421 // -------------------------------------------------------------------------
422 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsColumnAliasing( ) throw(SQLException
, RuntimeException
)
426 // -------------------------------------------------------------------------
427 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsTableCorrelationNames( ) throw(SQLException
, RuntimeException
)
431 // -------------------------------------------------------------------------
432 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsConvert( sal_Int32
, sal_Int32
) throw(SQLException
, RuntimeException
)
436 // -------------------------------------------------------------------------
437 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsExpressionsInOrderBy( ) throw(SQLException
, RuntimeException
)
441 // -------------------------------------------------------------------------
442 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsGroupBy( ) throw(SQLException
, RuntimeException
)
446 // -------------------------------------------------------------------------
447 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsGroupByBeyondSelect( ) throw(SQLException
, RuntimeException
)
451 // -------------------------------------------------------------------------
452 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsGroupByUnrelated( ) throw(SQLException
, RuntimeException
)
456 // -------------------------------------------------------------------------
457 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsMultipleTransactions( ) throw(SQLException
, RuntimeException
)
461 // -------------------------------------------------------------------------
462 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsMultipleResultSets( ) throw(SQLException
, RuntimeException
)
466 // -------------------------------------------------------------------------
467 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsLikeEscapeClause( ) throw(SQLException
, RuntimeException
)
471 // -------------------------------------------------------------------------
472 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsOrderByUnrelated( ) throw(SQLException
, RuntimeException
)
476 // -------------------------------------------------------------------------
477 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsUnion( ) throw(SQLException
, RuntimeException
)
481 // -------------------------------------------------------------------------
482 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsUnionAll( ) throw(SQLException
, RuntimeException
)
486 // -------------------------------------------------------------------------
487 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsMixedCaseIdentifiers( ) throw(SQLException
, RuntimeException
)
491 // -------------------------------------------------------------------------
492 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsMixedCaseQuotedIdentifiers( ) throw(SQLException
, RuntimeException
)
496 // -------------------------------------------------------------------------
497 sal_Bool SAL_CALL
MacabDatabaseMetaData::nullsAreSortedAtEnd( ) throw(SQLException
, RuntimeException
)
501 // -------------------------------------------------------------------------
502 sal_Bool SAL_CALL
MacabDatabaseMetaData::nullsAreSortedAtStart( ) throw(SQLException
, RuntimeException
)
506 // -------------------------------------------------------------------------
507 sal_Bool SAL_CALL
MacabDatabaseMetaData::nullsAreSortedHigh( ) throw(SQLException
, RuntimeException
)
511 // -------------------------------------------------------------------------
512 sal_Bool SAL_CALL
MacabDatabaseMetaData::nullsAreSortedLow( ) throw(SQLException
, RuntimeException
)
516 // -------------------------------------------------------------------------
517 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsSchemasInProcedureCalls( ) throw(SQLException
, RuntimeException
)
521 // -------------------------------------------------------------------------
522 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsSchemasInPrivilegeDefinitions( ) throw(SQLException
, RuntimeException
)
526 // -------------------------------------------------------------------------
527 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsCatalogsInProcedureCalls( ) throw(SQLException
, RuntimeException
)
531 // -------------------------------------------------------------------------
532 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsCatalogsInPrivilegeDefinitions( ) throw(SQLException
, RuntimeException
)
536 // -------------------------------------------------------------------------
537 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsCorrelatedSubqueries( ) throw(SQLException
, RuntimeException
)
541 // -------------------------------------------------------------------------
542 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsSubqueriesInComparisons( ) throw(SQLException
, RuntimeException
)
546 // -------------------------------------------------------------------------
547 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsSubqueriesInExists( ) throw(SQLException
, RuntimeException
)
551 // -------------------------------------------------------------------------
552 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsSubqueriesInIns( ) throw(SQLException
, RuntimeException
)
556 // -------------------------------------------------------------------------
557 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsSubqueriesInQuantifieds( ) throw(SQLException
, RuntimeException
)
561 // -------------------------------------------------------------------------
562 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsANSI92IntermediateSQL( ) throw(SQLException
, RuntimeException
)
566 // -------------------------------------------------------------------------
567 ::rtl::OUString SAL_CALL
MacabDatabaseMetaData::getURL( ) throw(SQLException
, RuntimeException
)
569 // if someday we support more than the default address book,
570 // this method should return the URL which was used to create it
571 ::rtl::OUString aValue
= ::rtl::OUString::createFromAscii("sdbc:address:macab:");
574 // -------------------------------------------------------------------------
575 ::rtl::OUString SAL_CALL
MacabDatabaseMetaData::getUserName( ) throw(SQLException
, RuntimeException
)
577 ::rtl::OUString aValue
;
580 // -------------------------------------------------------------------------
581 ::rtl::OUString SAL_CALL
MacabDatabaseMetaData::getDriverName( ) throw(SQLException
, RuntimeException
)
583 ::rtl::OUString aValue
= ::rtl::OUString::createFromAscii("macab");
586 // -------------------------------------------------------------------------
587 ::rtl::OUString SAL_CALL
MacabDatabaseMetaData::getDriverVersion() throw(SQLException
, RuntimeException
)
589 ::rtl::OUString aValue
= ::rtl::OUString::createFromAscii(MACAB_DRIVER_VERSION
);
592 // -------------------------------------------------------------------------
593 ::rtl::OUString SAL_CALL
MacabDatabaseMetaData::getDatabaseProductVersion( ) throw(SQLException
, RuntimeException
)
595 ::rtl::OUString aValue
;
598 // -------------------------------------------------------------------------
599 ::rtl::OUString SAL_CALL
MacabDatabaseMetaData::getDatabaseProductName( ) throw(SQLException
, RuntimeException
)
601 ::rtl::OUString aValue
;
604 // -------------------------------------------------------------------------
605 ::rtl::OUString SAL_CALL
MacabDatabaseMetaData::getProcedureTerm( ) throw(SQLException
, RuntimeException
)
607 ::rtl::OUString aValue
;
610 // -------------------------------------------------------------------------
611 ::rtl::OUString SAL_CALL
MacabDatabaseMetaData::getSchemaTerm( ) throw(SQLException
, RuntimeException
)
613 ::rtl::OUString aValue
;
616 // -------------------------------------------------------------------------
617 sal_Int32 SAL_CALL
MacabDatabaseMetaData::getDriverMajorVersion( ) throw(RuntimeException
)
619 return MACAB_DRIVER_VERSION_MAJOR
;
621 // -------------------------------------------------------------------------
622 sal_Int32 SAL_CALL
MacabDatabaseMetaData::getDefaultTransactionIsolation( ) throw(SQLException
, RuntimeException
)
624 return TransactionIsolation::NONE
;
626 // -------------------------------------------------------------------------
627 sal_Int32 SAL_CALL
MacabDatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeException
)
629 return MACAB_DRIVER_VERSION_MINOR
;
631 // -------------------------------------------------------------------------
632 ::rtl::OUString SAL_CALL
MacabDatabaseMetaData::getSQLKeywords( ) throw(SQLException
, RuntimeException
)
634 ::rtl::OUString aValue
;
637 // -------------------------------------------------------------------------
638 ::rtl::OUString SAL_CALL
MacabDatabaseMetaData::getSearchStringEscape( ) throw(SQLException
, RuntimeException
)
640 ::rtl::OUString aValue
;
643 // -------------------------------------------------------------------------
644 ::rtl::OUString SAL_CALL
MacabDatabaseMetaData::getStringFunctions( ) throw(SQLException
, RuntimeException
)
646 return ::rtl::OUString();
648 // -------------------------------------------------------------------------
649 ::rtl::OUString SAL_CALL
MacabDatabaseMetaData::getTimeDateFunctions( ) throw(SQLException
, RuntimeException
)
651 return ::rtl::OUString();
653 // -------------------------------------------------------------------------
654 ::rtl::OUString SAL_CALL
MacabDatabaseMetaData::getSystemFunctions( ) throw(SQLException
, RuntimeException
)
656 return ::rtl::OUString();
658 // -------------------------------------------------------------------------
659 ::rtl::OUString SAL_CALL
MacabDatabaseMetaData::getNumericFunctions( ) throw(SQLException
, RuntimeException
)
661 return ::rtl::OUString();
663 // -------------------------------------------------------------------------
664 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsExtendedSQLGrammar( ) throw(SQLException
, RuntimeException
)
668 // -------------------------------------------------------------------------
669 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsCoreSQLGrammar( ) throw(SQLException
, RuntimeException
)
673 // -------------------------------------------------------------------------
674 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsMinimumSQLGrammar( ) throw(SQLException
, RuntimeException
)
678 // -------------------------------------------------------------------------
679 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsFullOuterJoins( ) throw(SQLException
, RuntimeException
)
683 // -------------------------------------------------------------------------
684 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsLimitedOuterJoins( ) throw(SQLException
, RuntimeException
)
688 // -------------------------------------------------------------------------
689 sal_Int32 SAL_CALL
MacabDatabaseMetaData::getMaxColumnsInGroupBy( ) throw(SQLException
, RuntimeException
)
691 sal_Int32 nValue
= 0; // 0 means no limit
694 // -------------------------------------------------------------------------
695 sal_Int32 SAL_CALL
MacabDatabaseMetaData::getMaxColumnsInOrderBy( ) throw(SQLException
, RuntimeException
)
697 sal_Int32 nValue
= 0; // 0 means no limit
700 // -------------------------------------------------------------------------
701 sal_Int32 SAL_CALL
MacabDatabaseMetaData::getMaxColumnsInSelect( ) throw(SQLException
, RuntimeException
)
703 sal_Int32 nValue
= 0; // 0 means no limit
706 // -------------------------------------------------------------------------
707 sal_Int32 SAL_CALL
MacabDatabaseMetaData::getMaxUserNameLength( ) throw(SQLException
, RuntimeException
)
709 sal_Int32 nValue
= 0; // 0 means no limit
712 // -------------------------------------------------------------------------
713 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsResultSetType( sal_Int32 setType
) throw(SQLException
, RuntimeException
)
717 case ResultSetType::FORWARD_ONLY
:
718 case ResultSetType::SCROLL_INSENSITIVE
:
723 // -------------------------------------------------------------------------
724 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsResultSetConcurrency( sal_Int32 setType
, sal_Int32
) throw(SQLException
, RuntimeException
)
728 case ResultSetType::FORWARD_ONLY
:
729 case ResultSetType::SCROLL_INSENSITIVE
:
734 // -------------------------------------------------------------------------
735 sal_Bool SAL_CALL
MacabDatabaseMetaData::ownUpdatesAreVisible( sal_Int32
) throw(SQLException
, RuntimeException
)
739 // -------------------------------------------------------------------------
740 sal_Bool SAL_CALL
MacabDatabaseMetaData::ownDeletesAreVisible( sal_Int32
) throw(SQLException
, RuntimeException
)
744 // -------------------------------------------------------------------------
745 sal_Bool SAL_CALL
MacabDatabaseMetaData::ownInsertsAreVisible( sal_Int32
) throw(SQLException
, RuntimeException
)
749 // -------------------------------------------------------------------------
750 sal_Bool SAL_CALL
MacabDatabaseMetaData::othersUpdatesAreVisible( sal_Int32
) throw(SQLException
, RuntimeException
)
754 // -------------------------------------------------------------------------
755 sal_Bool SAL_CALL
MacabDatabaseMetaData::othersDeletesAreVisible( sal_Int32
) throw(SQLException
, RuntimeException
)
759 // -------------------------------------------------------------------------
760 sal_Bool SAL_CALL
MacabDatabaseMetaData::othersInsertsAreVisible( sal_Int32
) throw(SQLException
, RuntimeException
)
764 // -------------------------------------------------------------------------
765 sal_Bool SAL_CALL
MacabDatabaseMetaData::updatesAreDetected( sal_Int32
) throw(SQLException
, RuntimeException
)
769 // -------------------------------------------------------------------------
770 sal_Bool SAL_CALL
MacabDatabaseMetaData::deletesAreDetected( sal_Int32
) throw(SQLException
, RuntimeException
)
774 // -------------------------------------------------------------------------
775 sal_Bool SAL_CALL
MacabDatabaseMetaData::insertsAreDetected( sal_Int32
) throw(SQLException
, RuntimeException
)
779 // -------------------------------------------------------------------------
780 sal_Bool SAL_CALL
MacabDatabaseMetaData::supportsBatchUpdates( ) throw(SQLException
, RuntimeException
)
784 // -------------------------------------------------------------------------
785 Reference
< XConnection
> SAL_CALL
MacabDatabaseMetaData::getConnection( ) throw(SQLException
, RuntimeException
)
787 return (Reference
< XConnection
>) m_xConnection
.get();
789 // -------------------------------------------------------------------------
790 Reference
< XResultSet
> SAL_CALL
MacabDatabaseMetaData::getTableTypes( ) throw(SQLException
, RuntimeException
)
792 ::connectivity::ODatabaseMetaDataResultSet
* pResult
= new ::connectivity::ODatabaseMetaDataResultSet(ODatabaseMetaDataResultSet::eTableTypes
);
793 Reference
< XResultSet
> xRef
= pResult
;
795 static ODatabaseMetaDataResultSet::ORows aRows
;
796 static const ::rtl::OUString
aTable(::rtl::OUString::createFromAscii("TABLE"));
800 ODatabaseMetaDataResultSet::ORow
aRow(2);
801 aRow
[0] = ODatabaseMetaDataResultSet::getEmptyValue();
802 aRow
[1] = new ORowSetValueDecorator(aTable
);
803 aRows
.push_back(aRow
);
805 pResult
->setRows(aRows
);
808 // -------------------------------------------------------------------------
809 Reference
< XResultSet
> SAL_CALL
MacabDatabaseMetaData::getTypeInfo( ) throw(SQLException
, RuntimeException
)
811 ODatabaseMetaDataResultSet
* pResult
= new ODatabaseMetaDataResultSet(ODatabaseMetaDataResultSet::eTypeInfo
);
812 Reference
< XResultSet
> xRef
= pResult
;
814 static ODatabaseMetaDataResultSet::ORows aRows
;
817 ODatabaseMetaDataResultSet::ORow
aRow(19);
819 // We support four types: char, timestamp, integer, float
820 aRow
[0] = ODatabaseMetaDataResultSet::getEmptyValue();
821 aRow
[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("CHAR"));
822 aRow
[2] = new ORowSetValueDecorator(DataType::CHAR
);
823 aRow
[3] = new ORowSetValueDecorator((sal_Int32
) 254);
824 aRow
[4] = ODatabaseMetaDataResultSet::getQuoteValue();
825 aRow
[5] = ODatabaseMetaDataResultSet::getQuoteValue();
826 aRow
[6] = ODatabaseMetaDataResultSet::getEmptyValue();
827 aRow
[7] = new ORowSetValueDecorator((sal_Int32
) ColumnValue::NULLABLE
);
828 aRow
[8] = ODatabaseMetaDataResultSet::get1Value();
829 aRow
[9] = new ORowSetValueDecorator((sal_Int32
) ColumnSearch::CHAR
);
830 aRow
[10] = ODatabaseMetaDataResultSet::get1Value();
831 aRow
[11] = ODatabaseMetaDataResultSet::get0Value();
832 aRow
[12] = ODatabaseMetaDataResultSet::get0Value();
833 aRow
[13] = ODatabaseMetaDataResultSet::getEmptyValue();
834 aRow
[14] = ODatabaseMetaDataResultSet::get0Value();
835 aRow
[15] = ODatabaseMetaDataResultSet::get0Value();
836 aRow
[16] = ODatabaseMetaDataResultSet::getEmptyValue();
837 aRow
[17] = ODatabaseMetaDataResultSet::getEmptyValue();
838 aRow
[18] = new ORowSetValueDecorator((sal_Int32
) 10);
840 aRows
.push_back(aRow
);
842 aRow
[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("TIMESTAMP"));
843 aRow
[2] = new ORowSetValueDecorator(DataType::TIMESTAMP
);
844 aRow
[3] = new ORowSetValueDecorator((sal_Int32
)19);
845 aRow
[4] = ODatabaseMetaDataResultSet::getQuoteValue();
846 aRow
[5] = ODatabaseMetaDataResultSet::getQuoteValue();
847 aRows
.push_back(aRow
);
849 aRow
[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("INTEGER"));
850 aRow
[2] = new ORowSetValueDecorator(DataType::INTEGER
);
851 aRow
[3] = new ORowSetValueDecorator((sal_Int32
)20);
852 aRow
[15] = new ORowSetValueDecorator((sal_Int32
)20);
853 aRows
.push_back(aRow
);
855 aRow
[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("FLOAT"));
856 aRow
[2] = new ORowSetValueDecorator(DataType::FLOAT
);
857 aRow
[3] = new ORowSetValueDecorator((sal_Int32
)20);
858 aRow
[15] = new ORowSetValueDecorator((sal_Int32
)15);
859 aRows
.push_back(aRow
);
861 pResult
->setRows(aRows
);
864 // -------------------------------------------------------------------------
865 Reference
< XResultSet
> SAL_CALL
MacabDatabaseMetaData::getCatalogs( ) throw(SQLException
, RuntimeException
)
867 return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eCatalogs
);
869 // -----------------------------------------------------------------------------
870 Reference
< XResultSet
> SAL_CALL
MacabDatabaseMetaData::getSchemas( ) throw(SQLException
, RuntimeException
)
872 return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eSchemas
);
874 // -------------------------------------------------------------------------
875 Reference
< XResultSet
> SAL_CALL
MacabDatabaseMetaData::getColumnPrivileges(
876 const Any
&, const ::rtl::OUString
&, const ::rtl::OUString
&,
877 const ::rtl::OUString
& ) throw(SQLException
, RuntimeException
)
879 return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eColumnPrivileges
);
881 // -------------------------------------------------------------------------
882 Reference
< XResultSet
> SAL_CALL
MacabDatabaseMetaData::getColumns(
884 const ::rtl::OUString
&,
885 const ::rtl::OUString
& tableNamePattern
,
886 const ::rtl::OUString
& columnNamePattern
) throw(SQLException
, RuntimeException
)
888 ::connectivity::ODatabaseMetaDataResultSet
* pResult
= new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eColumns
);
889 Reference
< XResultSet
> xRef
= pResult
;
890 MacabRecords
*aRecords
;
891 ::rtl::OUString sTableName
;
893 aRecords
= m_xConnection
->getAddressBook()->getMacabRecordsMatch(tableNamePattern
);
895 ODatabaseMetaDataResultSet::ORows aRows
;
898 MacabHeader
*aHeader
= aRecords
->getHeader();
899 sTableName
= aRecords
->getName();
901 ODatabaseMetaDataResultSet::ORow
aRow(19);
903 aRow
[0] = ODatabaseMetaDataResultSet::getEmptyValue();
904 aRow
[1] = ODatabaseMetaDataResultSet::getEmptyValue();
905 aRow
[2] = ODatabaseMetaDataResultSet::getEmptyValue();
906 aRow
[3] = new ORowSetValueDecorator(sTableName
);
907 aRow
[8] = ODatabaseMetaDataResultSet::getEmptyValue();
908 aRow
[9] = ODatabaseMetaDataResultSet::get0Value();
909 aRow
[10] = new ORowSetValueDecorator((sal_Int32
) 10);
910 aRow
[11] = ODatabaseMetaDataResultSet::get1Value();
911 aRow
[12] = ODatabaseMetaDataResultSet::getEmptyValue();
912 aRow
[13] = ODatabaseMetaDataResultSet::getEmptyValue();
913 aRow
[14] = ODatabaseMetaDataResultSet::getEmptyValue();
914 aRow
[15] = ODatabaseMetaDataResultSet::getEmptyValue();
915 aRow
[16] = new ORowSetValueDecorator((sal_Int32
) 254);
916 aRow
[18] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("YES"));
918 sal_Int32 nPosition
= 1;
919 ::rtl::OUString sName
;
921 MacabHeader::iterator aField
;
923 for ( aField
= aHeader
->begin();
924 aField
!= aHeader
->end();
925 ++aField
, ++nPosition
)
928 sName
= CFStringToOUString((CFStringRef
) (*aField
)->value
);
929 if (match(columnNamePattern
, sName
, '\0'))
931 aRow
[4] = new ORowSetValueDecorator(sName
);
932 aRow
[17] = new ORowSetValueDecorator(nPosition
);
933 switch((*aField
)->type
)
935 case kABStringProperty
:
936 aRow
[5] = new ORowSetValueDecorator(DataType::CHAR
);
937 aRow
[6] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("CHAR"));
938 aRow
[7] = new ORowSetValueDecorator((sal_Int32
) 256);
939 aRows
.push_back(aRow
);
941 case kABDateProperty
:
942 aRow
[5] = new ORowSetValueDecorator(DataType::TIMESTAMP
);
943 aRow
[6] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("TIMESTAMP"));
944 aRows
.push_back(aRow
);
946 case kABIntegerProperty
:
947 aRow
[5] = new ORowSetValueDecorator(DataType::INTEGER
);
948 aRow
[6] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("INTEGER"));
949 aRow
[7] = new ORowSetValueDecorator((sal_Int32
) 20);
950 aRows
.push_back(aRow
);
952 case kABRealProperty
:
953 aRow
[5] = new ORowSetValueDecorator(DataType::FLOAT
);
954 aRow
[6] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("FLOAT"));
955 aRow
[7] = new ORowSetValueDecorator((sal_Int32
) 15);
956 aRows
.push_back(aRow
);
960 // shouldn't happen -- throw an error...?
965 pResult
->setRows(aRows
);
968 // -------------------------------------------------------------------------
969 Reference
< XResultSet
> SAL_CALL
MacabDatabaseMetaData::getTables(
971 const ::rtl::OUString
&,
972 const ::rtl::OUString
&,
973 const Sequence
< ::rtl::OUString
>& types
) throw(SQLException
, RuntimeException
)
975 ODatabaseMetaDataResultSet
* pResult
= new ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTables
);
976 Reference
< XResultSet
> xRef
= pResult
;
978 // check whether we have tables in the requested types
979 // for the moment, we answer only the "TABLE" table type
980 // when no types are given at all, we return all the tables
981 static const ::rtl::OUString
aTable(::rtl::OUString::createFromAscii("TABLE"));
982 sal_Bool bTableFound
= sal_False
;
983 const ::rtl::OUString
* p
= types
.getConstArray(),
984 * pEnd
= p
+ types
.getLength();
988 bTableFound
= sal_True
;
990 else while (p
< pEnd
)
992 if (match(*p
, aTable
, '\0'))
994 bTableFound
= sal_True
;
1002 static ODatabaseMetaDataResultSet::ORows aRows
;
1006 ODatabaseMetaDataResultSet::ORow
aRow(6);
1008 MacabRecords
*xRecords
= m_xConnection
->getAddressBook()->getMacabRecords();
1009 ::std::vector
<MacabGroup
*> xGroups
= m_xConnection
->getAddressBook()->getMacabGroups();
1010 sal_Int32 i
, nGroups
;
1011 nGroups
= xGroups
.size();
1013 aRow
[0] = ODatabaseMetaDataResultSet::getEmptyValue();
1014 aRow
[1] = ODatabaseMetaDataResultSet::getEmptyValue();
1015 aRow
[2] = ODatabaseMetaDataResultSet::getEmptyValue();
1016 aRow
[3] = new ORowSetValueDecorator(xRecords
->getName());
1017 aRow
[4] = new ORowSetValueDecorator(aTable
);
1018 aRow
[5] = ODatabaseMetaDataResultSet::getEmptyValue();
1019 aRows
.push_back(aRow
);
1021 for(i
= 0; i
< nGroups
; i
++)
1023 aRow
[3] = new ORowSetValueDecorator(xGroups
[i
]->getName());
1024 aRows
.push_back(aRow
);
1027 pResult
->setRows(aRows
);
1030 // -------------------------------------------------------------------------
1031 Reference
< XResultSet
> SAL_CALL
MacabDatabaseMetaData::getProcedureColumns(
1032 const Any
&, const ::rtl::OUString
&,
1033 const ::rtl::OUString
&, const ::rtl::OUString
& ) throw(SQLException
, RuntimeException
)
1035 return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eProcedureColumns
);
1037 // -------------------------------------------------------------------------
1038 Reference
< XResultSet
> SAL_CALL
MacabDatabaseMetaData::getProcedures(
1039 const Any
&, const ::rtl::OUString
&,
1040 const ::rtl::OUString
& ) throw(SQLException
, RuntimeException
)
1042 return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eProcedures
);
1044 // -------------------------------------------------------------------------
1045 Reference
< XResultSet
> SAL_CALL
MacabDatabaseMetaData::getVersionColumns(
1046 const Any
&, const ::rtl::OUString
&, const ::rtl::OUString
& table
) throw(SQLException
, RuntimeException
)
1048 return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eVersionColumns
);
1050 ::connectivity::ODatabaseMetaDataResultSet
* pResult
= new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eVersionColumns
);
1051 Reference
< XResultSet
> xRef
= pResult
;
1053 ODatabaseMetaDataResultSet::ORows aRows
;
1055 if (m_xConnection
->getAddressBook()->getMacabRecords(table
) != NULL
)
1057 ODatabaseMetaDataResultSet::ORow
aRow( 9 );
1059 ::rtl::OUString sName
= CFStringToOUString(kABModificationDateProperty
);
1061 aRow
[0] = ODatabaseMetaDataResultSet::getEmptyValue();
1062 aRow
[1] = ODatabaseMetaDataResultSet::getEmptyValue();
1063 aRow
[2] = new ORowSetValueDecorator(sName
);
1064 aRow
[3] = new ORowSetValueDecorator(DataType::TIMESTAMP
);
1065 aRow
[4] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("TIMESTAMP"));
1067 aRow
[5] = ODatabaseMetaDataResultSet::getEmptyValue();
1068 aRow
[6] = ODatabaseMetaDataResultSet::getEmptyValue();
1069 aRow
[7] = ODatabaseMetaDataResultSet::getEmptyValue();
1070 aRow
[8] = ODatabaseMetaDataResultSet::getEmptyValue();
1072 aRows
.push_back(aRow
);
1074 pResult
->setRows(aRows
);
1077 // -------------------------------------------------------------------------
1078 Reference
< XResultSet
> SAL_CALL
MacabDatabaseMetaData::getExportedKeys(
1079 const Any
&, const ::rtl::OUString
&, const ::rtl::OUString
& ) throw(SQLException
, RuntimeException
)
1081 return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eExportedKeys
);
1083 // -------------------------------------------------------------------------
1084 Reference
< XResultSet
> SAL_CALL
MacabDatabaseMetaData::getImportedKeys(
1085 const Any
&, const ::rtl::OUString
&, const ::rtl::OUString
& ) throw(SQLException
, RuntimeException
)
1087 return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eImportedKeys
);
1089 // -------------------------------------------------------------------------
1090 Reference
< XResultSet
> SAL_CALL
MacabDatabaseMetaData::getPrimaryKeys(
1091 const Any
&, const ::rtl::OUString
&, const ::rtl::OUString
& ) throw(SQLException
, RuntimeException
)
1093 return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::ePrimaryKeys
);
1095 // -------------------------------------------------------------------------
1096 Reference
< XResultSet
> SAL_CALL
MacabDatabaseMetaData::getIndexInfo(
1097 const Any
&, const ::rtl::OUString
&, const ::rtl::OUString
&,
1098 sal_Bool
, sal_Bool
) throw(SQLException
, RuntimeException
)
1100 return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eIndexInfo
);
1102 // -------------------------------------------------------------------------
1103 Reference
< XResultSet
> SAL_CALL
MacabDatabaseMetaData::getBestRowIdentifier(
1104 const Any
&, const ::rtl::OUString
&, const ::rtl::OUString
&, sal_Int32
,
1105 sal_Bool
) throw(SQLException
, RuntimeException
)
1107 return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eBestRowIdentifier
);
1109 // -------------------------------------------------------------------------
1110 Reference
< XResultSet
> SAL_CALL
MacabDatabaseMetaData::getTablePrivileges(
1111 const Any
&, const ::rtl::OUString
&, const ::rtl::OUString
& ) throw(SQLException
, RuntimeException
)
1113 return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eTablePrivileges
);
1115 // -------------------------------------------------------------------------
1116 Reference
< XResultSet
> SAL_CALL
MacabDatabaseMetaData::getCrossReference(
1117 const Any
&, const ::rtl::OUString
&,
1118 const ::rtl::OUString
&, const Any
&,
1119 const ::rtl::OUString
&, const ::rtl::OUString
& ) throw(SQLException
, RuntimeException
)
1121 return new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eCrossReference
);
1123 // -------------------------------------------------------------------------
1124 Reference
< XResultSet
> SAL_CALL
MacabDatabaseMetaData::getUDTs( const Any
&, const ::rtl::OUString
&, const ::rtl::OUString
&, const Sequence
< sal_Int32
>& ) throw(SQLException
, RuntimeException
)
1126 OSL_ENSURE(0,"Not implemented yet!");
1127 throw SQLException();
1129 // -----------------------------------------------------------------------------