xref: /trunk/main/mysqlc/source/mysqlc_databasemetadata.cxx (revision 27b2fc91b67b282ef25e5c8fc07f05afd8a62640)
1 /*************************************************************************
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3 *
4 * Copyright 2008 by Sun Microsystems, Inc.
5 *
6 * OpenOffice.org - a multi-platform office productivity suite
7 *
8 * $RCSfile: mysqlc_databasemetadata.cxx,v $
9 *
10 * $Revision: 1.1.2.5 $
11 *
12 * This file is part of OpenOffice.org.
13 *
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.
17 *
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).
23 *
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.
28 ************************************************************************/
29 #include "mysqlc_databasemetadata.hxx"
30 #include <com/sun/star/sdbc/DataType.hpp>
31 #include <com/sun/star/sdbc/ResultSetType.hpp>
32 #include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
33 #include <com/sun/star/sdbc/TransactionIsolation.hpp>
34 #include <com/sun/star/sdbc/KeyRule.hpp>
35 #include <com/sun/star/sdbc/Deferrability.hpp>
36 #include <com/sun/star/sdbc/IndexType.hpp>
37 #include <com/sun/star/sdbc/BestRowScope.hpp>
38 #include <com/sun/star/sdbc/ColumnType.hpp>
39 #include <com/sun/star/lang/XInitialization.hpp>
40 
41 
42 #include "mysqlc_general.hxx"
43 #include "mysqlc_statement.hxx"
44 #include "mysqlc_driver.hxx"
45 #include "mysqlc_preparedstatement.hxx"
46 
47 #include <stdio.h>
48 
49 using namespace connectivity::mysqlc;
50 using namespace com::sun::star::uno;
51 using namespace com::sun::star::lang;
52 using namespace com::sun::star::beans;
53 using namespace com::sun::star::sdbc;
54 using ::rtl::OUString;
55 using mysqlc_sdbc_driver::getStringFromAny;
56 
57 #include <preextstl.h>
58 #include <cppconn/connection.h>
59 #include <cppconn/resultset.h>
60 #include <cppconn/metadata.h>
61 #include <cppconn/statement.h>
62 #include <cppconn/prepared_statement.h>
63 #include <postextstl.h>
64 
65 static ext_std::string wild("%");
66 
67 using ::rtl::OUStringToOString;
68 
69 // -----------------------------------------------------------------------------
70 void lcl_setRows_throw(const Reference< XResultSet >& _xResultSet,sal_Int32 _nType,const std::vector< std::vector< Any > >& _rRows)
71 {
72     Reference< XInitialization> xIni(_xResultSet,UNO_QUERY);
73     Sequence< Any > aArgs(2);
74     aArgs[0] <<= _nType;
75 
76     Sequence< Sequence< Any > > aRows(_rRows.size());
77 
78     std::vector< std::vector< Any > >::const_iterator aIter = _rRows.begin();
79     Sequence< Any > * pRowsIter = aRows.getArray();
80     Sequence< Any > * pRowsEnd  = pRowsIter + aRows.getLength();
81     for (; pRowsIter != pRowsEnd;++pRowsIter,++aIter) {
82         if (!aIter->empty()) {
83             Sequence<Any> aSeq(&(*aIter->begin()),aIter->size());
84             (*pRowsIter) = aSeq;
85         }
86     }
87     aArgs[1] <<= aRows;
88     xIni->initialize(aArgs);
89 }
90 
91 
92 /* {{{ ODatabaseMetaData::ODatabaseMetaData() -I- */
93 ODatabaseMetaData::ODatabaseMetaData(OConnection& _rCon)
94     :m_rConnection(_rCon)
95     ,m_bUseCatalog(sal_True)
96     ,meta(_rCon.getConnectionSettings().cppConnection->getMetaData())
97     ,identifier_quote_string_set(false)
98 {
99     OSL_TRACE("ODatabaseMetaData::ODatabaseMetaData");
100     if (!m_rConnection.isCatalogUsed())
101     {
102         osl_incrementInterlockedCount(&m_refCount);
103         m_bUseCatalog = !(usesLocalFiles() || usesLocalFilePerTable());
104         osl_decrementInterlockedCount(&m_refCount);
105     }
106 }
107 /* }}} */
108 
109 
110 /* {{{ ODatabaseMetaData::~ODatabaseMetaData() -I- */
111 ODatabaseMetaData::~ODatabaseMetaData()
112 {
113     OSL_TRACE("ODatabaseMetaData::~ODatabaseMetaData");
114 }
115 /* }}} */
116 
117 
118 /* {{{ ODatabaseMetaData::impl_getStringMetaData() -I- */
119 OUString ODatabaseMetaData::impl_getStringMetaData(const sal_Char* _methodName, const ext_std::string& (sql::DatabaseMetaData::*_Method)() )
120 {
121     OSL_TRACE( "mysqlc::ODatabaseMetaData::%s", _methodName);
122     OUString stringMetaData;
123     try {
124         stringMetaData = mysqlc_sdbc_driver::convert((meta->*_Method)(), m_rConnection.getConnectionEncoding());
125     } catch (sql::MethodNotImplementedException) {
126         mysqlc_sdbc_driver::throwFeatureNotImplementedException(_methodName, *this);
127     } catch (sql::InvalidArgumentException) {
128         mysqlc_sdbc_driver::throwInvalidArgumentException(_methodName, *this);
129     } catch (const sql::SQLException& e) {
130         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_rConnection.getConnectionEncoding());
131     }
132     return stringMetaData;
133 }
134 /* }}} */
135 
136 
137 /* {{{ ODatabaseMetaData::impl_getStringMetaData() -I- */
138 OUString ODatabaseMetaData::impl_getStringMetaData(const sal_Char* _methodName, ext_std::string (sql::DatabaseMetaData::*_Method)() )
139 {
140     OSL_TRACE( "mysqlc::ODatabaseMetaData::%s", _methodName);
141     OUString stringMetaData;
142     try {
143         stringMetaData = mysqlc_sdbc_driver::convert((meta->*_Method)(), m_rConnection.getConnectionEncoding());
144     } catch (sql::MethodNotImplementedException) {
145         mysqlc_sdbc_driver::throwFeatureNotImplementedException(_methodName, *this);
146     } catch (sql::InvalidArgumentException) {
147         mysqlc_sdbc_driver::throwInvalidArgumentException(_methodName, *this);
148     } catch (const sql::SQLException& e) {
149         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_rConnection.getConnectionEncoding());
150     }
151     return stringMetaData;
152 }
153 /* }}} */
154 
155 
156 /* {{{ ODatabaseMetaData::impl_getStringMetaData() -I- */
157 OUString ODatabaseMetaData::impl_getStringMetaData(const sal_Char* _methodName, const sql::SQLString& (sql::DatabaseMetaData::*_Method)() )
158 {
159     OSL_TRACE( "mysqlc::ODatabaseMetaData::%s", _methodName);
160     OUString stringMetaData;
161     try {
162         stringMetaData = mysqlc_sdbc_driver::convert((meta->*_Method)(), m_rConnection.getConnectionEncoding());
163     } catch (sql::MethodNotImplementedException) {
164         mysqlc_sdbc_driver::throwFeatureNotImplementedException(_methodName, *this);
165     } catch (sql::InvalidArgumentException) {
166         mysqlc_sdbc_driver::throwInvalidArgumentException(_methodName, *this);
167     } catch (const sql::SQLException& e) {
168         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_rConnection.getConnectionEncoding());
169     }
170     return stringMetaData;
171 }
172 /* }}} */
173 
174 
175 /* {{{ ODatabaseMetaData::impl_getStringMetaData() -I- */
176 OUString ODatabaseMetaData::impl_getStringMetaData(const sal_Char* _methodName, sql::SQLString (sql::DatabaseMetaData::*_Method)() )
177 {
178     OSL_TRACE( "mysqlc::ODatabaseMetaData::%s", _methodName);
179     OUString stringMetaData;
180     try {
181         stringMetaData = mysqlc_sdbc_driver::convert((meta->*_Method)(), m_rConnection.getConnectionEncoding());
182     } catch (sql::MethodNotImplementedException) {
183         mysqlc_sdbc_driver::throwFeatureNotImplementedException(_methodName, *this);
184     } catch (sql::InvalidArgumentException) {
185         mysqlc_sdbc_driver::throwInvalidArgumentException(_methodName, *this);
186     } catch (const sql::SQLException& e) {
187         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_rConnection.getConnectionEncoding());
188     }
189     return stringMetaData;
190 }
191 /* }}} */
192 
193 
194 /* {{{ ODatabaseMetaData::impl_getInt32MetaData() -I- */
195 sal_Int32 ODatabaseMetaData::impl_getInt32MetaData(const sal_Char* _methodName, unsigned int (sql::DatabaseMetaData::*_Method)() )
196 {
197     OSL_TRACE( "mysqlc::ODatabaseMetaData::%s", _methodName);
198     sal_Int32 int32MetaData(0);
199     try {
200         int32MetaData = (meta->*_Method)();
201     } catch (sql::MethodNotImplementedException) {
202         mysqlc_sdbc_driver::throwFeatureNotImplementedException(_methodName, *this);
203     } catch (sql::InvalidArgumentException) {
204         mysqlc_sdbc_driver::throwInvalidArgumentException(_methodName, *this);
205     } catch (const sql::SQLException& e) {
206         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_rConnection.getConnectionEncoding());
207     }
208     return int32MetaData;
209 }
210 /* }}} */
211 
212 
213 /* {{{ ODatabaseMetaData::impl_getBoolMetaData() -I- */
214 sal_Bool ODatabaseMetaData::impl_getBoolMetaData(const sal_Char* _methodName, bool (sql::DatabaseMetaData::*_Method)() )
215 {
216     OSL_TRACE( "mysqlc::ODatabaseMetaData::%s", _methodName);
217     sal_Bool boolMetaData(0);
218     try {
219         boolMetaData = (meta->*_Method)() ? sal_True : sal_False;
220     } catch (sql::MethodNotImplementedException) {
221         mysqlc_sdbc_driver::throwFeatureNotImplementedException(_methodName, *this);
222     } catch (sql::InvalidArgumentException) {
223         mysqlc_sdbc_driver::throwInvalidArgumentException(_methodName, *this);
224     } catch (const sql::SQLException& e) {
225         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_rConnection.getConnectionEncoding());
226     }
227     return boolMetaData;
228 }
229 /* }}} */
230 
231 
232 /* {{{ ODatabaseMetaData::impl_getBoolMetaData() -I- */
233 sal_Bool ODatabaseMetaData::impl_getBoolMetaData(const sal_Char* _methodName, bool (sql::DatabaseMetaData::*_Method)(int), sal_Int32 _arg )
234 {
235     OSL_TRACE( "mysqlc::ODatabaseMetaData::%s", _methodName);
236     sal_Bool boolMetaData(0);
237     try {
238         boolMetaData = (meta->*_Method)( _arg ) ? sal_True : sal_False;
239     } catch (sql::MethodNotImplementedException) {
240         mysqlc_sdbc_driver::throwFeatureNotImplementedException(_methodName, *this);
241     } catch (sql::InvalidArgumentException) {
242         mysqlc_sdbc_driver::throwInvalidArgumentException(_methodName, *this);
243     } catch (const sql::SQLException& e) {
244         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_rConnection.getConnectionEncoding());
245     }
246     return boolMetaData;
247 }
248 /* }}} */
249 
250 
251 /* {{{ ODatabaseMetaData::impl_getRSTypeMetaData() -I- */
252 sal_Bool ODatabaseMetaData::impl_getRSTypeMetaData(const sal_Char* _methodName, bool (sql::DatabaseMetaData::*_Method)(int), sal_Int32 _resultSetType )
253 {
254     int resultSetType(sql::ResultSet::TYPE_FORWARD_ONLY);
255     switch ( _resultSetType ) {
256         case ResultSetType::SCROLL_INSENSITIVE: resultSetType = sql::ResultSet::TYPE_SCROLL_INSENSITIVE;    break;
257         case ResultSetType::SCROLL_SENSITIVE:   resultSetType = sql::ResultSet::TYPE_SCROLL_SENSITIVE;      break;
258     }
259 
260     return impl_getBoolMetaData(_methodName, _Method, resultSetType);
261 }
262 /* }}} */
263 
264 
265 /* {{{ ODatabaseMetaData::getCatalogSeparator() -I- */
266 OUString SAL_CALL ODatabaseMetaData::getCatalogSeparator()
267     throw(SQLException, RuntimeException)
268 {
269     return impl_getStringMetaData("getCatalogSeparator", &sql::DatabaseMetaData::getCatalogSeparator);
270 }
271 /* }}} */
272 
273 
274 /* {{{ ODatabaseMetaData::getMaxBinaryLiteralLength() -I- */
275 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxBinaryLiteralLength()
276     throw(SQLException, RuntimeException)
277 {
278     return impl_getInt32MetaData("getMaxBinaryLiteralLength", &sql::DatabaseMetaData::getMaxBinaryLiteralLength);
279 }
280 /* }}} */
281 
282 
283 /* {{{ ODatabaseMetaData::getMaxRowSize() -I- */
284 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxRowSize()
285     throw(SQLException, RuntimeException)
286 {
287     return impl_getInt32MetaData("getMaxRowSize", &sql::DatabaseMetaData::getMaxRowSize);
288 }
289 /* }}} */
290 
291 
292 /* {{{ ODatabaseMetaData::getMaxCatalogNameLength() -I- */
293 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCatalogNameLength()
294     throw(SQLException, RuntimeException)
295 {
296     return impl_getInt32MetaData("getMaxCatalogNameLength", &sql::DatabaseMetaData::getMaxCatalogNameLength);
297 }
298 /* }}} */
299 
300 
301 /* {{{ ODatabaseMetaData::getMaxCharLiteralLength() -I- */
302 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCharLiteralLength()
303     throw(SQLException, RuntimeException)
304 {
305     return impl_getInt32MetaData("getMaxCharLiteralLength", &sql::DatabaseMetaData::getMaxCharLiteralLength);
306 }
307 /* }}} */
308 
309 
310 /* {{{ ODatabaseMetaData::getMaxColumnNameLength() -I- */
311 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnNameLength()
312     throw(SQLException, RuntimeException)
313 {
314     return impl_getInt32MetaData("getMaxColumnNameLength", &sql::DatabaseMetaData::getMaxColumnNameLength);
315 }
316 /* }}} */
317 
318 
319 /* {{{ ODatabaseMetaData::getMaxColumnsInIndex() -I- */
320 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInIndex()
321     throw(SQLException, RuntimeException)
322 {
323     return impl_getInt32MetaData("getMaxColumnsInIndex", &sql::DatabaseMetaData::getMaxColumnsInIndex);
324 }
325 /* }}} */
326 
327 
328 /* {{{ ODatabaseMetaData::getMaxCursorNameLength() -I- */
329 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCursorNameLength()
330     throw(SQLException, RuntimeException)
331 {
332     return impl_getInt32MetaData("getMaxCursorNameLength", &sql::DatabaseMetaData::getMaxCursorNameLength);
333 }
334 /* }}} */
335 
336 
337 /* {{{ ODatabaseMetaData::getMaxConnections() -I- */
338 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxConnections()
339     throw(SQLException, RuntimeException)
340 {
341     return impl_getInt32MetaData("getMaxConnections", &sql::DatabaseMetaData::getMaxConnections);
342 }
343 /* }}} */
344 
345 
346 /* {{{ ODatabaseMetaData::getMaxColumnsInTable() -I- */
347 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInTable()
348     throw(SQLException, RuntimeException)
349 {
350     return impl_getInt32MetaData("getMaxColumnsInTable", &sql::DatabaseMetaData::getMaxColumnsInTable);
351 }
352 /* }}} */
353 
354 
355 /* {{{ ODatabaseMetaData::getMaxStatementLength() -I- */
356 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxStatementLength()
357     throw(SQLException, RuntimeException)
358 {
359     return impl_getInt32MetaData("getMaxStatementLength", &sql::DatabaseMetaData::getMaxStatementLength);
360 }
361 /* }}} */
362 
363 
364 /* {{{ ODatabaseMetaData::getMaxTableNameLength() -I- */
365 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxTableNameLength()
366     throw(SQLException, RuntimeException)
367 {
368     return impl_getInt32MetaData("getMaxTableNameLength", &sql::DatabaseMetaData::getMaxTableNameLength);
369 }
370 /* }}} */
371 
372 /* {{{ ODatabaseMetaData::getMaxTablesInSelect() -I- */
373 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxTablesInSelect()
374     throw(SQLException, RuntimeException)
375 {
376     return impl_getInt32MetaData("getMaxTablesInSelect", &sql::DatabaseMetaData::getMaxTablesInSelect);
377 }
378 /* }}} */
379 
380 
381 /* {{{ ODatabaseMetaData::doesMaxRowSizeIncludeBlobs() -I- */
382 sal_Bool SAL_CALL ODatabaseMetaData::doesMaxRowSizeIncludeBlobs()
383     throw(SQLException, RuntimeException)
384 {
385     return impl_getBoolMetaData("doesMaxRowSizeIncludeBlobs", &sql::DatabaseMetaData::doesMaxRowSizeIncludeBlobs);
386 }
387 /* }}} */
388 
389 
390 /* {{{ ODatabaseMetaData::storesLowerCaseQuotedIdentifiers() -I- */
391 sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseQuotedIdentifiers()
392     throw(SQLException, RuntimeException)
393 {
394     return impl_getBoolMetaData("storesLowerCaseQuotedIdentifiers", &sql::DatabaseMetaData::storesLowerCaseQuotedIdentifiers);
395 }
396 /* }}} */
397 
398 
399 /* {{{ ODatabaseMetaData::storesLowerCaseIdentifiers() -I- */
400 sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseIdentifiers()
401     throw(SQLException, RuntimeException)
402 {
403     return impl_getBoolMetaData("storesLowerCaseIdentifiers", &sql::DatabaseMetaData::storesLowerCaseIdentifiers);
404 }
405 /* }}} */
406 
407 
408 /* {{{ ODatabaseMetaData::storesMixedCaseQuotedIdentifiers() -I- */
409 sal_Bool SAL_CALL ODatabaseMetaData::storesMixedCaseQuotedIdentifiers()
410     throw(SQLException, RuntimeException)
411 {
412     return impl_getBoolMetaData("storesMixedCaseQuotedIdentifiers", &sql::DatabaseMetaData::storesMixedCaseQuotedIdentifiers);
413 }
414 /* }}} */
415 
416 
417 /* {{{ ODatabaseMetaData::storesMixedCaseIdentifiers() -I- */
418 sal_Bool SAL_CALL ODatabaseMetaData::storesMixedCaseIdentifiers()
419     throw(SQLException, RuntimeException)
420 {
421     return impl_getBoolMetaData("storesMixedCaseIdentifiers", &sql::DatabaseMetaData::storesMixedCaseIdentifiers);
422 }
423 /* }}} */
424 
425 
426 /* {{{ ODatabaseMetaData::storesUpperCaseQuotedIdentifiers() -I- */
427 sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseQuotedIdentifiers()
428     throw(SQLException, RuntimeException)
429 {
430     return impl_getBoolMetaData("storesUpperCaseQuotedIdentifiers", &sql::DatabaseMetaData::storesUpperCaseQuotedIdentifiers);
431 }
432 /* }}} */
433 
434 
435 /* {{{ ODatabaseMetaData::storesUpperCaseIdentifiers() -I- */
436 sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseIdentifiers()
437     throw(SQLException, RuntimeException)
438 {
439     return impl_getBoolMetaData("storesUpperCaseIdentifiers", &sql::DatabaseMetaData::storesUpperCaseIdentifiers);
440 }
441 /* }}} */
442 
443 
444 /* {{{ ODatabaseMetaData::supportsAlterTableWithAddColumn() -I- */
445 sal_Bool SAL_CALL ODatabaseMetaData::supportsAlterTableWithAddColumn()
446     throw(SQLException, RuntimeException)
447 {
448     return impl_getBoolMetaData("supportsAlterTableWithAddColumn", &sql::DatabaseMetaData::supportsAlterTableWithAddColumn);
449 }
450 /* }}} */
451 
452 
453 /* {{{ ODatabaseMetaData::supportsAlterTableWithDropColumn() -I- */
454 sal_Bool SAL_CALL ODatabaseMetaData::supportsAlterTableWithDropColumn()
455     throw(SQLException, RuntimeException)
456 {
457     return impl_getBoolMetaData("supportsAlterTableWithDropColumn", &sql::DatabaseMetaData::supportsAlterTableWithDropColumn);
458 }
459 /* }}} */
460 
461 
462 /* {{{ ODatabaseMetaData::getMaxIndexLength() -I- */
463 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxIndexLength()
464     throw(SQLException, RuntimeException)
465 {
466     return impl_getInt32MetaData("getMaxIndexLength", &sql::DatabaseMetaData::getMaxIndexLength);
467 }
468 /* }}} */
469 
470 
471 /* {{{ ODatabaseMetaData::supportsNonNullableColumns() -I- */
472 sal_Bool SAL_CALL ODatabaseMetaData::supportsNonNullableColumns()
473     throw(SQLException, RuntimeException)
474 {
475     return impl_getBoolMetaData("supportsNonNullableColumns", &sql::DatabaseMetaData::supportsNonNullableColumns);
476 }
477 /* }}} */
478 
479 
480 /* {{{ ODatabaseMetaData::getCatalogTerm() -I- */
481 OUString SAL_CALL ODatabaseMetaData::getCatalogTerm()
482     throw(SQLException, RuntimeException)
483 {
484     return impl_getStringMetaData("getCatalogTerm", &sql::DatabaseMetaData::getCatalogTerm);
485 }
486 /* }}} */
487 
488 
489 /* {{{ ODatabaseMetaData::getIdentifierQuoteString() -I- */
490 OUString SAL_CALL ODatabaseMetaData::getIdentifierQuoteString()
491     throw(SQLException, RuntimeException)
492 {
493     if (identifier_quote_string_set == false) {
494         identifier_quote_string = impl_getStringMetaData("getIdentifierQuoteString", &sql::DatabaseMetaData::getIdentifierQuoteString);
495         identifier_quote_string_set = true;
496     }
497     return identifier_quote_string;
498 }
499 /* }}} */
500 
501 
502 /* {{{ ODatabaseMetaData::getExtraNameCharacters() -I- */
503 OUString SAL_CALL ODatabaseMetaData::getExtraNameCharacters()
504     throw(SQLException, RuntimeException)
505 {
506     return impl_getStringMetaData("getExtraNameCharacters", &sql::DatabaseMetaData::getExtraNameCharacters);
507 }
508 /* }}} */
509 
510 
511 /* {{{ ODatabaseMetaData::supportsDifferentTableCorrelationNames() -I- */
512 sal_Bool SAL_CALL ODatabaseMetaData::supportsDifferentTableCorrelationNames()
513     throw(SQLException, RuntimeException)
514 {
515     return impl_getBoolMetaData("supportsDifferentTableCorrelationNames", &sql::DatabaseMetaData::supportsDifferentTableCorrelationNames);
516 }
517 /* }}} */
518 
519 
520 /* {{{ ODatabaseMetaData::isCatalogAtStart() -I- */
521 sal_Bool SAL_CALL ODatabaseMetaData::isCatalogAtStart()
522     throw(SQLException, RuntimeException)
523 {
524     return impl_getBoolMetaData("isCatalogAtStart", &sql::DatabaseMetaData::isCatalogAtStart);
525 }
526 /* }}} */
527 
528 
529 /* {{{ ODatabaseMetaData::dataDefinitionIgnoredInTransactions() -I- */
530 sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionIgnoredInTransactions()
531     throw(SQLException, RuntimeException)
532 {
533     return impl_getBoolMetaData("dataDefinitionIgnoredInTransactions", &sql::DatabaseMetaData::dataDefinitionIgnoredInTransactions);
534 }
535 /* }}} */
536 
537 
538 /* {{{ ODatabaseMetaData::dataDefinitionCausesTransactionCommit() -I- */
539 sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionCausesTransactionCommit()
540     throw(SQLException, RuntimeException)
541 {
542     return impl_getBoolMetaData("dataDefinitionCausesTransactionCommit", &sql::DatabaseMetaData::dataDefinitionCausesTransactionCommit);
543 }
544 /* }}} */
545 
546 
547 /* {{{ ODatabaseMetaData::supportsDataManipulationTransactionsOnly() -I- */
548 sal_Bool SAL_CALL ODatabaseMetaData::supportsDataManipulationTransactionsOnly()
549     throw(SQLException, RuntimeException)
550 {
551     return impl_getBoolMetaData("supportsDataManipulationTransactionsOnly", &sql::DatabaseMetaData::supportsDataManipulationTransactionsOnly);
552 }
553 /* }}} */
554 
555 
556 /* {{{ ODatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions() -I- */
557 sal_Bool SAL_CALL ODatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions()
558     throw(SQLException, RuntimeException)
559 {
560     return impl_getBoolMetaData("supportsDataDefinitionAndDataManipulationTransactions", &sql::DatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions);
561 }
562 /* }}} */
563 
564 
565 /* {{{ ODatabaseMetaData::supportsPositionedDelete() -I- */
566 sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedDelete()
567     throw(SQLException, RuntimeException)
568 {
569     return impl_getBoolMetaData("supportsPositionedDelete", &sql::DatabaseMetaData::supportsPositionedDelete);
570 }
571 /* }}} */
572 
573 
574 /* {{{ ODatabaseMetaData::supportsPositionedUpdate() -I- */
575 sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedUpdate()
576     throw(SQLException, RuntimeException)
577 {
578     return impl_getBoolMetaData("supportsPositionedUpdate", &sql::DatabaseMetaData::supportsPositionedUpdate);
579 }
580 /* }}} */
581 
582 
583 /* {{{ ODatabaseMetaData::supportsOpenStatementsAcrossRollback() -I- */
584 sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossRollback()
585     throw(SQLException, RuntimeException)
586 {
587     return impl_getBoolMetaData("supportsOpenStatementsAcrossRollback", &sql::DatabaseMetaData::supportsOpenStatementsAcrossRollback);
588 }
589 /* }}} */
590 
591 
592 /* {{{ ODatabaseMetaData::supportsOpenStatementsAcrossCommit() -I- */
593 sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossCommit()
594     throw(SQLException, RuntimeException)
595 {
596     return impl_getBoolMetaData("supportsOpenStatementsAcrossCommit", &sql::DatabaseMetaData::supportsOpenStatementsAcrossCommit);
597 }
598 /* }}} */
599 
600 
601 /* {{{ ODatabaseMetaData::supportsOpenCursorsAcrossCommit() -I- */
602 sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossCommit()
603     throw(SQLException, RuntimeException)
604 {
605     return impl_getBoolMetaData("supportsOpenCursorsAcrossCommit", &sql::DatabaseMetaData::supportsOpenCursorsAcrossCommit);
606 }
607 /* }}} */
608 
609 
610 /* {{{ ODatabaseMetaData::supportsOpenCursorsAcrossRollback() -I- */
611 sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossRollback()
612     throw(SQLException, RuntimeException)
613 {
614     return impl_getBoolMetaData("supportsOpenCursorsAcrossRollback", &sql::DatabaseMetaData::supportsOpenCursorsAcrossRollback);
615 }
616 /* }}} */
617 
618 
619 /* {{{ ODatabaseMetaData::supportsTransactionIsolationLevel() -I- */
620 sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactionIsolationLevel(sal_Int32 level)
621     throw(SQLException, RuntimeException)
622 {
623     return impl_getBoolMetaData("supportsTransactionIsolationLevel", &sql::DatabaseMetaData::supportsTransactionIsolationLevel, level);
624 }
625 /* }}} */
626 
627 
628 /* {{{ ODatabaseMetaData::supportsSchemasInDataManipulation() -I- */
629 sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInDataManipulation()
630     throw(SQLException, RuntimeException)
631 {
632     return impl_getBoolMetaData("supportsSchemasInDataManipulation", &sql::DatabaseMetaData::supportsSchemasInDataManipulation);
633 }
634 /* }}} */
635 
636 
637 /* {{{ ODatabaseMetaData::supportsANSI92FullSQL() -I- */
638 sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92FullSQL()
639     throw(SQLException, RuntimeException)
640 {
641     return impl_getBoolMetaData("supportsANSI92FullSQL", &sql::DatabaseMetaData::supportsANSI92FullSQL);
642 }
643 /* }}} */
644 
645 
646 /* {{{ ODatabaseMetaData::supportsANSI92EntryLevelSQL() -I- */
647 sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92EntryLevelSQL()
648     throw(SQLException, RuntimeException)
649 {
650     return impl_getBoolMetaData("supportsANSI92EntryLevelSQL", &sql::DatabaseMetaData::supportsANSI92EntryLevelSQL);
651 }
652 /* }}} */
653 
654 
655 /* {{{ ODatabaseMetaData::supportsIntegrityEnhancementFacility() -I- */
656 sal_Bool SAL_CALL ODatabaseMetaData::supportsIntegrityEnhancementFacility()
657     throw(SQLException, RuntimeException)
658 {
659     return impl_getBoolMetaData("supportsIntegrityEnhancementFacility", &sql::DatabaseMetaData::supportsIntegrityEnhancementFacility);
660 }
661 /* }}} */
662 
663 
664 /* {{{ ODatabaseMetaData::supportsSchemasInIndexDefinitions() -I- */
665 sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInIndexDefinitions()
666     throw(SQLException, RuntimeException)
667 {
668     return impl_getBoolMetaData("supportsSchemasInIndexDefinitions", &sql::DatabaseMetaData::supportsSchemasInIndexDefinitions);
669 }
670 /* }}} */
671 
672 
673 /* {{{ ODatabaseMetaData::supportsSchemasInTableDefinitions() -I- */
674 sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInTableDefinitions()
675     throw(SQLException, RuntimeException)
676 {
677     return impl_getBoolMetaData("supportsSchemasInTableDefinitions", &sql::DatabaseMetaData::supportsSchemasInTableDefinitions);
678 }
679 /* }}} */
680 
681 
682 /* {{{ ODatabaseMetaData::supportsCatalogsInTableDefinitions() -I- */
683 sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInTableDefinitions()
684     throw(SQLException, RuntimeException)
685 {
686     return impl_getBoolMetaData("supportsCatalogsInTableDefinitions", &sql::DatabaseMetaData::supportsCatalogsInTableDefinitions);
687 }
688 /* }}} */
689 
690 
691 /* {{{ ODatabaseMetaData::supportsCatalogsInIndexDefinitions() -I- */
692 sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInIndexDefinitions()
693     throw(SQLException, RuntimeException)
694 {
695     return impl_getBoolMetaData("supportsCatalogsInIndexDefinitions", &sql::DatabaseMetaData::supportsCatalogsInIndexDefinitions);
696 }
697 /* }}} */
698 
699 
700 /* {{{ ODatabaseMetaData::supportsCatalogsInDataManipulation() -I- */
701 sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInDataManipulation()
702     throw(SQLException, RuntimeException)
703 {
704     return impl_getBoolMetaData("supportsCatalogsInDataManipulation", &sql::DatabaseMetaData::supportsCatalogsInDataManipulation);
705 }
706 /* }}} */
707 
708 
709 /* {{{ ODatabaseMetaData::supportsOuterJoins() -I- */
710 sal_Bool SAL_CALL ODatabaseMetaData::supportsOuterJoins()
711     throw(SQLException, RuntimeException)
712 {
713     return impl_getBoolMetaData("supportsOuterJoins", &sql::DatabaseMetaData::supportsOuterJoins);
714 }
715 /* }}} */
716 
717 
718 /* {{{ ODatabaseMetaData::getMaxStatements() -I- */
719 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxStatements()
720     throw(SQLException, RuntimeException)
721 {
722     return impl_getInt32MetaData("getMaxStatements", &sql::DatabaseMetaData::getMaxStatements);
723 }
724 /* }}} */
725 
726 
727 /* {{{ ODatabaseMetaData::getMaxProcedureNameLength() -I- */
728 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxProcedureNameLength()
729     throw(SQLException, RuntimeException)
730 {
731     return impl_getInt32MetaData("getMaxProcedureNameLength", &sql::DatabaseMetaData::getMaxProcedureNameLength);
732 }
733 /* }}} */
734 
735 
736 /* {{{ ODatabaseMetaData::getMaxSchemaNameLength() -I- */
737 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxSchemaNameLength()
738     throw(SQLException, RuntimeException)
739 {
740     return impl_getInt32MetaData("getMaxSchemaNameLength", &sql::DatabaseMetaData::getMaxSchemaNameLength);
741 }
742 /* }}} */
743 
744 
745 /* {{{ ODatabaseMetaData::supportsTransactions() -I- */
746 sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactions()
747     throw(SQLException, RuntimeException)
748 {
749     return impl_getBoolMetaData("supportsTransactions", &sql::DatabaseMetaData::supportsTransactions);
750 }
751 /* }}} */
752 
753 
754 /* {{{ ODatabaseMetaData::allProceduresAreCallable() -I- */
755 sal_Bool SAL_CALL ODatabaseMetaData::allProceduresAreCallable()
756     throw(SQLException, RuntimeException)
757 {
758     return impl_getBoolMetaData("allProceduresAreCallable", &sql::DatabaseMetaData::allProceduresAreCallable);
759 }
760 /* }}} */
761 
762 
763 /* {{{ ODatabaseMetaData::supportsStoredProcedures() -I- */
764 sal_Bool SAL_CALL ODatabaseMetaData::supportsStoredProcedures()
765     throw(SQLException, RuntimeException)
766 {
767     return impl_getBoolMetaData("supportsStoredProcedures", &sql::DatabaseMetaData::supportsStoredProcedures);
768 }
769 /* }}} */
770 
771 
772 /* {{{ ODatabaseMetaData::supportsSelectForUpdate() -I- */
773 sal_Bool SAL_CALL ODatabaseMetaData::supportsSelectForUpdate()
774     throw(SQLException, RuntimeException)
775 {
776     return impl_getBoolMetaData("supportsSelectForUpdate", &sql::DatabaseMetaData::supportsSelectForUpdate);
777 }
778 /* }}} */
779 
780 
781 /* {{{ ODatabaseMetaData::allTablesAreSelectable() -I- */
782 sal_Bool SAL_CALL ODatabaseMetaData::allTablesAreSelectable()
783     throw(SQLException, RuntimeException)
784 {
785     return impl_getBoolMetaData("allTablesAreSelectable", &sql::DatabaseMetaData::allTablesAreSelectable);
786 }
787 /* }}} */
788 
789 
790 /* {{{ ODatabaseMetaData::isReadOnly() -I- */
791 sal_Bool SAL_CALL ODatabaseMetaData::isReadOnly()
792     throw(SQLException, RuntimeException)
793 {
794     return impl_getBoolMetaData("isReadOnly", &sql::DatabaseMetaData::isReadOnly);
795 }
796 /* }}} */
797 
798 
799 /* {{{ ODatabaseMetaData::usesLocalFiles() -I- */
800 sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFiles()
801     throw(SQLException, RuntimeException)
802 {
803     return impl_getBoolMetaData("usesLocalFiles", &sql::DatabaseMetaData::usesLocalFiles);
804 }
805 /* }}} */
806 
807 
808 /* {{{ ODatabaseMetaData::usesLocalFilePerTable() -I- */
809 sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFilePerTable()
810     throw(SQLException, RuntimeException)
811 {
812     return impl_getBoolMetaData("usesLocalFilePerTable", &sql::DatabaseMetaData::usesLocalFilePerTable);
813 }
814 /* }}} */
815 
816 
817 /* {{{ ODatabaseMetaData::supportsTypeConversion() -I- */
818 sal_Bool SAL_CALL ODatabaseMetaData::supportsTypeConversion()
819     throw(SQLException, RuntimeException)
820 {
821     return impl_getBoolMetaData("supportsTypeConversion", &sql::DatabaseMetaData::supportsTypeConversion);
822 }
823 /* }}} */
824 
825 
826 /* {{{ ODatabaseMetaData::nullPlusNonNullIsNull() -I- */
827 sal_Bool SAL_CALL ODatabaseMetaData::nullPlusNonNullIsNull()
828     throw(SQLException, RuntimeException)
829 {
830     return impl_getBoolMetaData("nullPlusNonNullIsNull", &sql::DatabaseMetaData::nullPlusNonNullIsNull);
831 }
832 /* }}} */
833 
834 
835 /* {{{ ODatabaseMetaData::supportsColumnAliasing() -I- */
836 sal_Bool SAL_CALL ODatabaseMetaData::supportsColumnAliasing()
837     throw(SQLException, RuntimeException)
838 {
839     return impl_getBoolMetaData("supportsColumnAliasing", &sql::DatabaseMetaData::supportsColumnAliasing);
840 }
841 /* }}} */
842 
843 
844 /* {{{ ODatabaseMetaData::supportsTableCorrelationNames() -I- */
845 sal_Bool SAL_CALL ODatabaseMetaData::supportsTableCorrelationNames()
846     throw(SQLException, RuntimeException)
847 {
848     return impl_getBoolMetaData("supportsTableCorrelationNames", &sql::DatabaseMetaData::supportsTableCorrelationNames);
849 }
850 /* }}} */
851 
852 
853 /* {{{ ODatabaseMetaData::supportsConvert() -I- */
854 sal_Bool SAL_CALL ODatabaseMetaData::supportsConvert(sal_Int32 /* fromType */, sal_Int32 /* toType */)
855     throw(SQLException, RuntimeException)
856 {
857     OSL_TRACE("ODatabaseMetaData::supportsConvert");
858     try {
859         /* ToDo -> use supportsConvert( fromType, toType) */
860         return meta->supportsConvert()? sal_True:sal_False;
861     } catch (sql::MethodNotImplementedException) {
862         mysqlc_sdbc_driver::throwFeatureNotImplementedException("ODatabaseMetaData::supportsConvert", *this);
863     } catch (sql::InvalidArgumentException) {
864         mysqlc_sdbc_driver::throwInvalidArgumentException("ODatabaseMetaData::supportsConvert", *this);
865     } catch (const sql::SQLException& e) {
866         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_rConnection.getConnectionEncoding());
867     }
868     return sal_False;
869 }
870 /* }}} */
871 
872 
873 /* {{{ ODatabaseMetaData::supportsExpressionsInOrderBy() -I- */
874 sal_Bool SAL_CALL ODatabaseMetaData::supportsExpressionsInOrderBy()
875     throw(SQLException, RuntimeException)
876 {
877     return impl_getBoolMetaData("supportsExpressionsInOrderBy", &sql::DatabaseMetaData::supportsExpressionsInOrderBy);
878 }
879 /* }}} */
880 
881 
882 /* {{{ ODatabaseMetaData::supportsGroupBy() -I- */
883 sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupBy()
884     throw(SQLException, RuntimeException)
885 {
886     return impl_getBoolMetaData("supportsGroupBy", &sql::DatabaseMetaData::supportsGroupBy);
887 }
888 /* }}} */
889 
890 
891 /* {{{ ODatabaseMetaData::supportsGroupByBeyondSelect() -I- */
892 sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByBeyondSelect()
893     throw(SQLException, RuntimeException)
894 {
895     return impl_getBoolMetaData("supportsGroupByBeyondSelect", &sql::DatabaseMetaData::supportsGroupByBeyondSelect);
896 }
897 /* }}} */
898 
899 
900 /* {{{ ODatabaseMetaData::supportsGroupByUnrelated() -I- */
901 sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByUnrelated()
902     throw(SQLException, RuntimeException)
903 {
904     return impl_getBoolMetaData("supportsGroupByUnrelated", &sql::DatabaseMetaData::supportsGroupByUnrelated);
905 }
906 /* }}} */
907 
908 
909 /* {{{ ODatabaseMetaData::supportsMultipleTransactions() -I- */
910 sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleTransactions()
911     throw(SQLException, RuntimeException)
912 {
913     return impl_getBoolMetaData("supportsMultipleTransactions", &sql::DatabaseMetaData::supportsMultipleTransactions);
914 }
915 /* }}} */
916 
917 
918 /* {{{ ODatabaseMetaData::supportsMultipleResultSets() -I- */
919 sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleResultSets()
920     throw(SQLException, RuntimeException)
921 {
922     return impl_getBoolMetaData("supportsMultipleResultSets", &sql::DatabaseMetaData::supportsMultipleResultSets);
923 }
924 /* }}} */
925 
926 
927 /* {{{ ODatabaseMetaData::supportsLikeEscapeClause() -I- */
928 sal_Bool SAL_CALL ODatabaseMetaData::supportsLikeEscapeClause()
929     throw(SQLException, RuntimeException)
930 {
931     return impl_getBoolMetaData("supportsLikeEscapeClause", &sql::DatabaseMetaData::supportsLikeEscapeClause);
932 }
933 /* }}} */
934 
935 
936 /* {{{ ODatabaseMetaData::supportsOrderByUnrelated() -I- */
937 sal_Bool SAL_CALL ODatabaseMetaData::supportsOrderByUnrelated()
938     throw(SQLException, RuntimeException)
939 {
940     return impl_getBoolMetaData("supportsOrderByUnrelated", &sql::DatabaseMetaData::supportsOrderByUnrelated);
941 }
942 /* }}} */
943 
944 
945 /* {{{ ODatabaseMetaData::supportsUnion() -I- */
946 sal_Bool SAL_CALL ODatabaseMetaData::supportsUnion()
947     throw(SQLException, RuntimeException)
948 {
949     return impl_getBoolMetaData("supportsUnion", &sql::DatabaseMetaData::supportsUnion);
950 }
951 /* }}} */
952 
953 
954 /* {{{ ODatabaseMetaData::supportsUnionAll() -I- */
955 sal_Bool SAL_CALL ODatabaseMetaData::supportsUnionAll()
956     throw(SQLException, RuntimeException)
957 {
958     return impl_getBoolMetaData("supportsUnionAll", &sql::DatabaseMetaData::supportsUnionAll);
959 }
960 /* }}} */
961 
962 
963 /* {{{ ODatabaseMetaData::supportsMixedCaseIdentifiers() -I- */
964 sal_Bool SAL_CALL ODatabaseMetaData::supportsMixedCaseIdentifiers()
965     throw(SQLException, RuntimeException)
966 {
967     return impl_getBoolMetaData("supportsMixedCaseIdentifiers", &sql::DatabaseMetaData::supportsMixedCaseIdentifiers);
968 }
969 /* }}} */
970 
971 
972 /* {{{ ODatabaseMetaData::supportsMixedCaseQuotedIdentifiers() -I- */
973 sal_Bool SAL_CALL ODatabaseMetaData::supportsMixedCaseQuotedIdentifiers()
974     throw(SQLException, RuntimeException)
975 {
976     return impl_getBoolMetaData("supportsMixedCaseQuotedIdentifiers", &sql::DatabaseMetaData::supportsMixedCaseQuotedIdentifiers);
977 }
978 /* }}} */
979 
980 
981 /* {{{ ODatabaseMetaData::nullsAreSortedAtEnd() -I- */
982 sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtEnd()
983     throw(SQLException, RuntimeException)
984 {
985     return impl_getBoolMetaData("nullsAreSortedAtEnd", &sql::DatabaseMetaData::nullsAreSortedAtEnd);
986 }
987 /* }}} */
988 
989 
990 /* {{{ ODatabaseMetaData::nullsAreSortedAtStart() -I- */
991 sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtStart()
992     throw(SQLException, RuntimeException)
993 {
994     return impl_getBoolMetaData("nullsAreSortedAtStart", &sql::DatabaseMetaData::nullsAreSortedAtStart);
995 }
996 /* }}} */
997 
998 
999 /* {{{ ODatabaseMetaData::nullsAreSortedHigh() -I- */
1000 sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedHigh()
1001     throw(SQLException, RuntimeException)
1002 {
1003     return impl_getBoolMetaData("nullsAreSortedHigh", &sql::DatabaseMetaData::nullsAreSortedHigh);
1004 }
1005 /* }}} */
1006 
1007 
1008 /* {{{ ODatabaseMetaData::nullsAreSortedLow() -I- */
1009 sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedLow()
1010     throw(SQLException, RuntimeException)
1011 {
1012     return impl_getBoolMetaData("nullsAreSortedLow", &sql::DatabaseMetaData::nullsAreSortedLow);
1013 }
1014 /* }}} */
1015 
1016 
1017 /* {{{ ODatabaseMetaData::supportsSchemasInProcedureCalls() -I- */
1018 sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInProcedureCalls()
1019     throw(SQLException, RuntimeException)
1020 {
1021     return impl_getBoolMetaData("supportsSchemasInProcedureCalls", &sql::DatabaseMetaData::supportsSchemasInProcedureCalls);
1022 }
1023 /* }}} */
1024 
1025 
1026 /* {{{ ODatabaseMetaData::supportsSchemasInPrivilegeDefinitions() -I- */
1027 sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInPrivilegeDefinitions()
1028     throw(SQLException, RuntimeException)
1029 {
1030     return impl_getBoolMetaData("supportsSchemasInPrivilegeDefinitions", &sql::DatabaseMetaData::supportsSchemasInPrivilegeDefinitions);
1031 }
1032 /* }}} */
1033 
1034 
1035 /* {{{ ODatabaseMetaData::supportsCatalogsInProcedureCalls() -I- */
1036 sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInProcedureCalls()
1037     throw(SQLException, RuntimeException)
1038 {
1039     return impl_getBoolMetaData("supportsCatalogsInProcedureCalls", &sql::DatabaseMetaData::supportsCatalogsInProcedureCalls);
1040 }
1041 /* }}} */
1042 
1043 
1044 /* {{{ ODatabaseMetaData::supportsCatalogsInPrivilegeDefinitions() -I- */
1045 sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInPrivilegeDefinitions()
1046     throw(SQLException, RuntimeException)
1047 {
1048     return impl_getBoolMetaData("supportsCatalogsInPrivilegeDefinitions", &sql::DatabaseMetaData::supportsCatalogsInPrivilegeDefinitions);
1049 }
1050 /* }}} */
1051 
1052 
1053 /* {{{ ODatabaseMetaData::supportsCorrelatedSubqueries() -I- */
1054 sal_Bool SAL_CALL ODatabaseMetaData::supportsCorrelatedSubqueries()
1055     throw(SQLException, RuntimeException)
1056 {
1057     return impl_getBoolMetaData("supportsCorrelatedSubqueries", &sql::DatabaseMetaData::supportsCorrelatedSubqueries);
1058 }
1059 /* }}} */
1060 
1061 
1062 /* {{{ ODatabaseMetaData::supportsSubqueriesInComparisons() -I- */
1063 sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInComparisons()
1064     throw(SQLException, RuntimeException)
1065 {
1066     return impl_getBoolMetaData("supportsSubqueriesInComparisons", &sql::DatabaseMetaData::supportsSubqueriesInComparisons);
1067 }
1068 /* }}} */
1069 
1070 
1071 /* {{{ ODatabaseMetaData::supportsSubqueriesInExists() -I- */
1072 sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInExists()
1073     throw(SQLException, RuntimeException)
1074 {
1075     return impl_getBoolMetaData("supportsSubqueriesInExists", &sql::DatabaseMetaData::supportsSubqueriesInExists);
1076 }
1077 /* }}} */
1078 
1079 
1080 /* {{{ ODatabaseMetaData::supportsSubqueriesInIns() -I- */
1081 sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInIns()
1082     throw(SQLException, RuntimeException)
1083 {
1084     return impl_getBoolMetaData("supportsSubqueriesInIns", &sql::DatabaseMetaData::supportsSubqueriesInIns);
1085 }
1086 /* }}} */
1087 
1088 
1089 /* {{{ ODatabaseMetaData::supportsSubqueriesInQuantifieds() -I- */
1090 sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInQuantifieds()
1091     throw(SQLException, RuntimeException)
1092 {
1093     return impl_getBoolMetaData("supportsSubqueriesInQuantifieds", &sql::DatabaseMetaData::supportsSubqueriesInQuantifieds);
1094 }
1095 /* }}} */
1096 
1097 
1098 /* {{{ ODatabaseMetaData::supportsANSI92IntermediateSQL() -I- */
1099 sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92IntermediateSQL()
1100     throw(SQLException, RuntimeException)
1101 {
1102     return impl_getBoolMetaData("supportsANSI92IntermediateSQL", &sql::DatabaseMetaData::supportsANSI92IntermediateSQL);
1103 }
1104 /* }}} */
1105 
1106 
1107 /* {{{ ODatabaseMetaData::getURL() -I- */
1108 OUString SAL_CALL ODatabaseMetaData::getURL()
1109     throw(SQLException, RuntimeException)
1110 {
1111     OSL_TRACE("ODatabaseMetaData::getURL");
1112     return m_rConnection.getConnectionSettings().connectionURL;
1113 }
1114 /* }}} */
1115 
1116 
1117 /* {{{ ODatabaseMetaData::getUserName() -I- */
1118 OUString SAL_CALL ODatabaseMetaData::getUserName()
1119     throw(SQLException, RuntimeException)
1120 {
1121     return impl_getStringMetaData("getUserName", &sql::DatabaseMetaData::getUserName);
1122 }
1123 /* }}} */
1124 
1125 
1126 /* {{{ ODatabaseMetaData::getDriverName() -I- */
1127 OUString SAL_CALL ODatabaseMetaData::getDriverName()
1128     throw(SQLException, RuntimeException)
1129 {
1130     OSL_TRACE("ODatabaseMetaData::getDriverName");
1131     OUString aValue( RTL_CONSTASCII_USTRINGPARAM( "MySQL Connector/OO.org" ) );
1132     return aValue;
1133 }
1134 /* }}} */
1135 
1136 
1137 /* {{{ ODatabaseMetaData::getDriverVersion() -I- */
1138 OUString SAL_CALL ODatabaseMetaData::getDriverVersion()
1139     throw(SQLException, RuntimeException)
1140 {
1141     OSL_TRACE("ODatabaseMetaData::getDriverVersion");
1142     static const OUString sVersion( RTL_CONSTASCII_USTRINGPARAM( "0.9.2" ) );
1143     return sVersion;
1144 }
1145 /* }}} */
1146 
1147 
1148 /* {{{ ODatabaseMetaData::getDatabaseProductVersion() -I- */
1149 OUString SAL_CALL ODatabaseMetaData::getDatabaseProductVersion()
1150     throw(SQLException, RuntimeException)
1151 {
1152     return impl_getStringMetaData("getDatabaseProductVersion", &sql::DatabaseMetaData::getDatabaseProductVersion);
1153 }
1154 /* }}} */
1155 
1156 
1157 /* {{{ ODatabaseMetaData::getDatabaseProductName() -I- */
1158 OUString SAL_CALL ODatabaseMetaData::getDatabaseProductName()
1159     throw(SQLException, RuntimeException)
1160 {
1161     return impl_getStringMetaData("getDatabaseProductName", &sql::DatabaseMetaData::getDatabaseProductName);
1162 }
1163 /* }}} */
1164 
1165 
1166 /* {{{ ODatabaseMetaData::getProcedureTerm() -I- */
1167 OUString SAL_CALL ODatabaseMetaData::getProcedureTerm()
1168     throw(SQLException, RuntimeException)
1169 {
1170     return impl_getStringMetaData("getProcedureTerm", &sql::DatabaseMetaData::getProcedureTerm);
1171 }
1172 /* }}} */
1173 
1174 
1175 /* {{{ ODatabaseMetaData::getSchemaTerm() -I- */
1176 OUString SAL_CALL ODatabaseMetaData::getSchemaTerm()
1177     throw(SQLException, RuntimeException)
1178 {
1179     return impl_getStringMetaData("getSchemaTerm", &sql::DatabaseMetaData::getSchemaTerm);
1180 }
1181 /* }}} */
1182 
1183 
1184 /* {{{ ODatabaseMetaData::getDriverMajorVersion() -I- */
1185 sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMajorVersion()
1186     throw(RuntimeException)
1187 {
1188     OSL_TRACE("ODatabaseMetaData::getDriverMajorVersion");
1189     return MYSQLC_VERSION_MAJOR;
1190 }
1191 /* }}} */
1192 
1193 
1194 /* {{{ ODatabaseMetaData::getDefaultTransactionIsolation() -I- */
1195 sal_Int32 SAL_CALL ODatabaseMetaData::getDefaultTransactionIsolation()
1196     throw(SQLException, RuntimeException)
1197 {
1198     OSL_TRACE("ODatabaseMetaData::getDefaultTransactionIsolation");
1199     try {
1200         switch (meta->getDefaultTransactionIsolation()) {
1201             case sql::TRANSACTION_SERIALIZABLE:     return TransactionIsolation::SERIALIZABLE;
1202             case sql::TRANSACTION_REPEATABLE_READ:  return TransactionIsolation::REPEATABLE_READ;
1203             case sql::TRANSACTION_READ_COMMITTED:   return TransactionIsolation::READ_COMMITTED;
1204             case sql::TRANSACTION_READ_UNCOMMITTED: return TransactionIsolation::READ_UNCOMMITTED;
1205         }
1206     } catch (sql::MethodNotImplementedException) {
1207         mysqlc_sdbc_driver::throwFeatureNotImplementedException("ODatabaseMetaData::getDriverMajorVersion", *this);
1208     } catch (sql::InvalidArgumentException) {
1209         mysqlc_sdbc_driver::throwInvalidArgumentException("ODatabaseMetaData::getDriverMajorVersion", *this);
1210     } catch (const sql::SQLException& e) {
1211         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_rConnection.getConnectionEncoding());
1212     }
1213     return TransactionIsolation::NONE;
1214 }
1215 /* }}} */
1216 
1217 
1218 /* {{{ ODatabaseMetaData::getDriverMinorVersion() -I- */
1219 sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion()
1220     throw(RuntimeException)
1221 {
1222     OSL_TRACE("ODatabaseMetaData::getDriverMinorVersion");
1223     return MYSQLC_VERSION_MINOR;
1224 }
1225 /* }}} */
1226 
1227 
1228 /* {{{ ODatabaseMetaData::getSQLKeywords() -I- */
1229 OUString SAL_CALL ODatabaseMetaData::getSQLKeywords()
1230     throw(SQLException, RuntimeException)
1231 {
1232     return impl_getStringMetaData("getSQLKeywords", &sql::DatabaseMetaData::getSQLKeywords);
1233 }
1234 /* }}} */
1235 
1236 
1237 /* {{{ ODatabaseMetaData::getSearchStringEscape() -I- */
1238 OUString SAL_CALL ODatabaseMetaData::getSearchStringEscape()
1239     throw(SQLException, RuntimeException)
1240 {
1241     return impl_getStringMetaData("getSearchStringEscape", &sql::DatabaseMetaData::getSearchStringEscape);
1242 }
1243 /* }}} */
1244 
1245 
1246 /* {{{ ODatabaseMetaData::getStringFunctions() -I- */
1247 OUString SAL_CALL ODatabaseMetaData::getStringFunctions()
1248     throw(SQLException, RuntimeException)
1249 {
1250     return impl_getStringMetaData("getStringFunctions", &sql::DatabaseMetaData::getStringFunctions);
1251 }
1252 /* }}} */
1253 
1254 
1255 /* {{{ ODatabaseMetaData::getTimeDateFunctions() -I- */
1256 OUString SAL_CALL ODatabaseMetaData::getTimeDateFunctions()
1257     throw(SQLException, RuntimeException)
1258 {
1259     return impl_getStringMetaData("getTimeDateFunctions", &sql::DatabaseMetaData::getTimeDateFunctions);
1260 }
1261 /* }}} */
1262 
1263 
1264 /* {{{ ODatabaseMetaData::getSystemFunctions() -I- */
1265 OUString SAL_CALL ODatabaseMetaData::getSystemFunctions()
1266     throw(SQLException, RuntimeException)
1267 {
1268     return impl_getStringMetaData("getSystemFunctions", &sql::DatabaseMetaData::getSystemFunctions);
1269 }
1270 /* }}} */
1271 
1272 
1273 /* {{{ ODatabaseMetaData::getNumericFunctions() -I- */
1274 OUString SAL_CALL ODatabaseMetaData::getNumericFunctions()
1275     throw(SQLException, RuntimeException)
1276 {
1277     return impl_getStringMetaData("getNumericFunctions", &sql::DatabaseMetaData::getNumericFunctions);
1278 }
1279 /* }}} */
1280 
1281 
1282 /* {{{ ODatabaseMetaData::supportsExtendedSQLGrammar() -I- */
1283 sal_Bool SAL_CALL ODatabaseMetaData::supportsExtendedSQLGrammar()
1284     throw(SQLException, RuntimeException)
1285 {
1286     return impl_getBoolMetaData("supportsExtendedSQLGrammar", &sql::DatabaseMetaData::supportsExtendedSQLGrammar);
1287 }
1288 /* }}} */
1289 
1290 
1291 /* {{{ ODatabaseMetaData::supportsCoreSQLGrammar() -I- */
1292 sal_Bool SAL_CALL ODatabaseMetaData::supportsCoreSQLGrammar()
1293     throw(SQLException, RuntimeException)
1294 {
1295     return impl_getBoolMetaData("supportsCoreSQLGrammar", &sql::DatabaseMetaData::supportsCoreSQLGrammar);
1296 }
1297 /* }}} */
1298 
1299 
1300 /* {{{ ODatabaseMetaData::supportsMinimumSQLGrammar() -I- */
1301 sal_Bool SAL_CALL ODatabaseMetaData::supportsMinimumSQLGrammar()
1302     throw(SQLException, RuntimeException)
1303 {
1304     return impl_getBoolMetaData("supportsMinimumSQLGrammar", &sql::DatabaseMetaData::supportsMinimumSQLGrammar);
1305 }
1306 /* }}} */
1307 
1308 
1309 /* {{{ ODatabaseMetaData::supportsFullOuterJoins() -I- */
1310 sal_Bool SAL_CALL ODatabaseMetaData::supportsFullOuterJoins()
1311     throw(SQLException, RuntimeException)
1312 {
1313     return impl_getBoolMetaData("supportsFullOuterJoins", &sql::DatabaseMetaData::supportsFullOuterJoins);
1314 }
1315 /* }}} */
1316 
1317 
1318 /* {{{ ODatabaseMetaData::supportsLimitedOuterJoins() -I- */
1319 sal_Bool SAL_CALL ODatabaseMetaData::supportsLimitedOuterJoins()
1320     throw(SQLException, RuntimeException)
1321 {
1322     return impl_getBoolMetaData("supportsLimitedOuterJoins", &sql::DatabaseMetaData::supportsLimitedOuterJoins);
1323 }
1324 /* }}} */
1325 
1326 
1327 /* {{{ ODatabaseMetaData::getMaxColumnsInGroupBy() -I- */
1328 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInGroupBy()
1329     throw(SQLException, RuntimeException)
1330 {
1331     return impl_getInt32MetaData("getMaxColumnsInGroupBy", &sql::DatabaseMetaData::getMaxColumnsInGroupBy);
1332 }
1333 /* }}} */
1334 
1335 
1336 /* {{{ ODatabaseMetaData::getMaxColumnsInOrderBy() -I- */
1337 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInOrderBy()
1338     throw(SQLException, RuntimeException)
1339 {
1340     return impl_getInt32MetaData("getMaxColumnsInOrderBy", &sql::DatabaseMetaData::getMaxColumnsInOrderBy);
1341 }
1342 /* }}} */
1343 
1344 
1345 /* {{{ ODatabaseMetaData::getMaxColumnsInSelect() -I- */
1346 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInSelect()
1347     throw(SQLException, RuntimeException)
1348 {
1349     return impl_getInt32MetaData("getMaxColumnsInSelect", &sql::DatabaseMetaData::getMaxColumnsInSelect);
1350 }
1351 /* }}} */
1352 
1353 
1354 /* {{{ ODatabaseMetaData::getMaxUserNameLength() -I- */
1355 sal_Int32 SAL_CALL ODatabaseMetaData::getMaxUserNameLength()
1356     throw(SQLException, RuntimeException)
1357 {
1358     return impl_getInt32MetaData("getMaxUserNameLength", &sql::DatabaseMetaData::getMaxUserNameLength);
1359 }
1360 /* }}} */
1361 
1362 
1363 /* {{{ ODatabaseMetaData::supportsResultSetType() -I- */
1364 sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetType(sal_Int32 setType)
1365     throw(SQLException, RuntimeException)
1366 {
1367     return impl_getRSTypeMetaData("supportsResultSetType", &sql::DatabaseMetaData::supportsResultSetType, setType);
1368 }
1369 /* }}} */
1370 
1371 
1372 /* {{{ ODatabaseMetaData::supportsResultSetConcurrency() -I- */
1373 sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetConcurrency(sal_Int32 setType, sal_Int32 concurrency)
1374     throw(SQLException, RuntimeException)
1375 {
1376     OSL_TRACE("ODatabaseMetaData::supportsResultSetConcurrency");
1377     /* TODO: Check this out */
1378     try {
1379         return meta->supportsResultSetConcurrency(setType, concurrency==com::sun::star::sdbc::TransactionIsolation::READ_COMMITTED?
1380                                                     sql::TRANSACTION_READ_COMMITTED:
1381                                                     (concurrency == com::sun::star::sdbc::TransactionIsolation::SERIALIZABLE?
1382                                                         sql::TRANSACTION_SERIALIZABLE:sql::TRANSACTION_SERIALIZABLE))? sal_True:sal_False;
1383     } catch (sql::MethodNotImplementedException) {
1384         mysqlc_sdbc_driver::throwFeatureNotImplementedException("ODatabaseMetaData::supportsResultSetConcurrency", *this);
1385     } catch (sql::InvalidArgumentException) {
1386         mysqlc_sdbc_driver::throwInvalidArgumentException("ODatabaseMetaData::supportsResultSetConcurrency", *this);
1387     } catch (const sql::SQLException& e) {
1388         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_rConnection.getConnectionEncoding());
1389     }
1390     return sal_False;
1391 }
1392 /* }}} */
1393 
1394 
1395 /* {{{ ODatabaseMetaData::ownUpdatesAreVisible() -I- */
1396 sal_Bool SAL_CALL ODatabaseMetaData::ownUpdatesAreVisible(sal_Int32 setType)
1397     throw(SQLException, RuntimeException)
1398 {
1399     return impl_getRSTypeMetaData("ownUpdatesAreVisible", &sql::DatabaseMetaData::ownUpdatesAreVisible, setType);
1400 }
1401 /* }}} */
1402 
1403 
1404 /* {{{ ODatabaseMetaData::ownDeletesAreVisible() -I- */
1405 sal_Bool SAL_CALL ODatabaseMetaData::ownDeletesAreVisible(sal_Int32 setType)
1406     throw(SQLException, RuntimeException)
1407 {
1408     return impl_getRSTypeMetaData("ownDeletesAreVisible", &sql::DatabaseMetaData::ownDeletesAreVisible, setType);
1409 }
1410 /* }}} */
1411 
1412 
1413 /* {{{ ODatabaseMetaData::ownInsertsAreVisible() -I- */
1414 sal_Bool SAL_CALL ODatabaseMetaData::ownInsertsAreVisible(sal_Int32 setType)
1415     throw(SQLException, RuntimeException)
1416 {
1417     return impl_getRSTypeMetaData("ownInsertsAreVisible", &sql::DatabaseMetaData::ownInsertsAreVisible, setType);
1418 }
1419 /* }}} */
1420 
1421 
1422 /* {{{ ODatabaseMetaData::othersUpdatesAreVisible() -I- */
1423 sal_Bool SAL_CALL ODatabaseMetaData::othersUpdatesAreVisible(sal_Int32 setType)
1424     throw(SQLException, RuntimeException)
1425 {
1426     return impl_getRSTypeMetaData("othersUpdatesAreVisible", &sql::DatabaseMetaData::othersUpdatesAreVisible, setType);
1427 }
1428 /* }}} */
1429 
1430 
1431 /* {{{ ODatabaseMetaData::othersDeletesAreVisible() -I- */
1432 sal_Bool SAL_CALL ODatabaseMetaData::othersDeletesAreVisible(sal_Int32 setType)
1433     throw(SQLException, RuntimeException)
1434 {
1435     return impl_getRSTypeMetaData("othersDeletesAreVisible", &sql::DatabaseMetaData::othersDeletesAreVisible, setType);
1436 }
1437 /* }}} */
1438 
1439 
1440 /* {{{ ODatabaseMetaData::othersInsertsAreVisible() -I- */
1441 sal_Bool SAL_CALL ODatabaseMetaData::othersInsertsAreVisible(sal_Int32 setType)
1442     throw(SQLException, RuntimeException)
1443 {
1444     return impl_getRSTypeMetaData("othersInsertsAreVisible", &sql::DatabaseMetaData::othersInsertsAreVisible, setType);
1445 }
1446 /* }}} */
1447 
1448 
1449 /* {{{ ODatabaseMetaData::updatesAreDetected() -I- */
1450 sal_Bool SAL_CALL ODatabaseMetaData::updatesAreDetected(sal_Int32 setType)
1451     throw(SQLException, RuntimeException)
1452 {
1453     return impl_getRSTypeMetaData("updatesAreDetected", &sql::DatabaseMetaData::updatesAreDetected, setType);
1454 }
1455 /* }}} */
1456 
1457 
1458 /* {{{ ODatabaseMetaData::deletesAreDetected() -I- */
1459 sal_Bool SAL_CALL ODatabaseMetaData::deletesAreDetected(sal_Int32 setType)
1460     throw(SQLException, RuntimeException)
1461 {
1462     return impl_getRSTypeMetaData("deletesAreDetected", &sql::DatabaseMetaData::deletesAreDetected, setType);
1463 }
1464 /* }}} */
1465 
1466 
1467 /* {{{ ODatabaseMetaData::insertsAreDetected() -I- */
1468 sal_Bool SAL_CALL ODatabaseMetaData::insertsAreDetected(sal_Int32 setType)
1469     throw(SQLException, RuntimeException)
1470 {
1471     return impl_getRSTypeMetaData("insertsAreDetected", &sql::DatabaseMetaData::insertsAreDetected, setType);
1472 }
1473 /* }}} */
1474 
1475 
1476 /* {{{ ODatabaseMetaData::supportsBatchUpdates() -I- */
1477 sal_Bool SAL_CALL ODatabaseMetaData::supportsBatchUpdates()
1478     throw(SQLException, RuntimeException)
1479 {
1480     return impl_getBoolMetaData("supportsBatchUpdates", &sql::DatabaseMetaData::supportsBatchUpdates);
1481 }
1482 /* }}} */
1483 
1484 
1485 /* {{{ ODatabaseMetaData::getConnection() -I- */
1486 Reference< XConnection > SAL_CALL ODatabaseMetaData::getConnection()
1487     throw(SQLException, RuntimeException)
1488 {
1489     OSL_TRACE("ODatabaseMetaData::getConnection");
1490     return (Reference< XConnection >)&m_rConnection;
1491 }
1492 /* }}} */
1493 
1494 
1495 /*
1496   Here follow all methods which return(a resultset
1497   the first methods is an example implementation how to use this resultset
1498   of course you could implement it on your and you should do this because
1499   the general way is more memory expensive
1500 */
1501 
1502 /* {{{ ODatabaseMetaData::getTableTypes() -I- */
1503 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTableTypes()
1504     throw(SQLException, RuntimeException)
1505 {
1506     OSL_TRACE("ODatabaseMetaData::getTableTypes");
1507     const char * table_types[] = {"TABLE", "VIEW"};
1508     sal_Int32 requiredVersion[] = {0, 50000};
1509 
1510     Reference< XResultSet > xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.helper.DatabaseMetaDataResultSet"))),UNO_QUERY);
1511     std::vector< std::vector< Any > > rRows;
1512     rtl_TextEncoding encoding = m_rConnection.getConnectionEncoding();
1513 
1514     for (sal_uInt32 i = 0; i < 2; i++) {
1515         if (m_rConnection.getMysqlVersion() >= requiredVersion[i]) {
1516             std::vector< Any > aRow(1);
1517             aRow.push_back(makeAny(mysqlc_sdbc_driver::convert(table_types[i], encoding)));
1518             rRows.push_back(aRow);
1519         }
1520     }
1521     lcl_setRows_throw(xResultSet, 5 ,rRows);
1522     return xResultSet;
1523 }
1524 /* }}} */
1525 
1526 
1527 /* {{{ ODatabaseMetaData::getTypeInfo() -I- */
1528 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTypeInfo()
1529     throw(SQLException, RuntimeException)
1530 {
1531     OSL_TRACE("ODatabaseMetaData::getTypeInfo");
1532     Reference< XResultSet > xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.helper.DatabaseMetaDataResultSet"))),UNO_QUERY);
1533 
1534     std::vector< std::vector< Any > > rRows;
1535 
1536     rtl_TextEncoding encoding = m_rConnection.getConnectionEncoding();
1537     unsigned int i = 0;
1538     while (mysqlc_types[i].typeName) {
1539         std::vector< Any > aRow(1);
1540 
1541         aRow.push_back(makeAny(mysqlc_sdbc_driver::convert(mysqlc_types[i].typeName, encoding)));
1542         aRow.push_back(makeAny(mysqlc_types[i].dataType));
1543         aRow.push_back(makeAny(mysqlc_types[i].precision));
1544         aRow.push_back(makeAny(mysqlc_sdbc_driver::convert(mysqlc_types[i].literalPrefix, encoding)));
1545         aRow.push_back(makeAny(mysqlc_sdbc_driver::convert(mysqlc_types[i].literalSuffix, encoding)));
1546         aRow.push_back(makeAny(mysqlc_sdbc_driver::convert(mysqlc_types[i].createParams, encoding)));
1547         aRow.push_back(makeAny(mysqlc_types[i].nullable));
1548         aRow.push_back(makeAny(mysqlc_types[i].caseSensitive));
1549         aRow.push_back(makeAny(mysqlc_types[i].searchable));
1550         aRow.push_back(makeAny(mysqlc_types[i].isUnsigned));
1551         aRow.push_back(makeAny(mysqlc_types[i].fixedPrecScale));
1552         aRow.push_back(makeAny(mysqlc_types[i].autoIncrement));
1553         aRow.push_back(makeAny(mysqlc_sdbc_driver::convert(mysqlc_types[i].localTypeName, encoding)));
1554         aRow.push_back(makeAny(mysqlc_types[i].minScale));
1555         aRow.push_back(makeAny(mysqlc_types[i].maxScale));
1556         aRow.push_back(makeAny(sal_Int32(0)));
1557         aRow.push_back(makeAny(sal_Int32(0)));
1558         aRow.push_back(makeAny(sal_Int32(10)));
1559 
1560         rRows.push_back(aRow);
1561         i++;
1562     }
1563 
1564     lcl_setRows_throw(xResultSet, 14, rRows);
1565     return xResultSet;
1566 }
1567 /* }}} */
1568 
1569 
1570 /* {{{ ODatabaseMetaData::getCatalogs() -I- */
1571 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCatalogs()
1572     throw(SQLException, RuntimeException)
1573 {
1574     OSL_TRACE("ODatabaseMetaData::getCatalogs");
1575 
1576     Reference< XResultSet > xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.helper.DatabaseMetaDataResultSet"))),UNO_QUERY);
1577     std::vector< std::vector< Any > > rRows;
1578 
1579     try {
1580         rtl_TextEncoding encoding = m_rConnection.getConnectionEncoding();
1581         std::auto_ptr< sql::ResultSet> rset( meta->getCatalogs());
1582         sql::ResultSetMetaData * rs_meta = rset->getMetaData();
1583         sal_uInt32 columns = rs_meta->getColumnCount();
1584         while (rset->next()) {
1585             std::vector< Any > aRow(1);
1586             for (sal_uInt32 i = 1; i <= columns; i++) {
1587                 aRow.push_back(makeAny(mysqlc_sdbc_driver::convert(rset->getString(i), encoding)));
1588             }
1589             rRows.push_back(aRow);
1590         }
1591     } catch (sql::MethodNotImplementedException) {
1592         mysqlc_sdbc_driver::throwFeatureNotImplementedException("ODatabaseMetaData::getCatalogs", *this);
1593     } catch (sql::InvalidArgumentException) {
1594         mysqlc_sdbc_driver::throwInvalidArgumentException("ODatabaseMetaData::getCatalogs", *this);
1595     } catch (const sql::SQLException& e) {
1596         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_rConnection.getConnectionEncoding());
1597     }
1598 
1599     lcl_setRows_throw(xResultSet, 0, rRows);
1600     return xResultSet;
1601 }
1602 /* }}} */
1603 
1604 
1605 /* {{{ ODatabaseMetaData::getSchemas() -I- */
1606 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getSchemas()
1607     throw(SQLException, RuntimeException)
1608 {
1609     OSL_TRACE("ODatabaseMetaData::getSchemas");
1610 
1611     Reference< XResultSet > xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.helper.DatabaseMetaDataResultSet"))),UNO_QUERY);
1612     std::vector< std::vector< Any > > rRows;
1613 
1614     try {
1615         rtl_TextEncoding encoding = m_rConnection.getConnectionEncoding();
1616         std::auto_ptr< sql::ResultSet> rset( meta->getSchemas());
1617         sql::ResultSetMetaData * rs_meta = rset->getMetaData();
1618         sal_uInt32 columns = rs_meta->getColumnCount();
1619         while (rset->next()) {
1620             std::vector< Any > aRow(1);
1621             bool informationSchema = false;
1622             for (sal_uInt32 i = 1; i <= columns; i++) {
1623                 sql::SQLString columnStringValue = rset->getString(i);
1624                 if (i == 1) {   // TABLE_SCHEM
1625                     informationSchema = (0 == columnStringValue.compare("information_schema"));
1626                 }
1627                 aRow.push_back(makeAny(mysqlc_sdbc_driver::convert(columnStringValue, encoding)));
1628             }
1629             if (!informationSchema ) {
1630                 rRows.push_back(aRow);
1631             }
1632         }
1633     } catch (sql::MethodNotImplementedException) {
1634         mysqlc_sdbc_driver::throwFeatureNotImplementedException("ODatabaseMetaData::getSchemas", *this);
1635     } catch (sql::InvalidArgumentException) {
1636         mysqlc_sdbc_driver::throwInvalidArgumentException("ODatabaseMetaData::getSchemas", *this);
1637     } catch (const sql::SQLException& e) {
1638         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_rConnection.getConnectionEncoding());
1639     }
1640 
1641     lcl_setRows_throw(xResultSet, 1, rRows);
1642     return xResultSet;
1643 }
1644 /* }}} */
1645 
1646 
1647 /* {{{ ODatabaseMetaData::getColumnPrivileges() -I- */
1648 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumnPrivileges(
1649         const Any& catalog,
1650         const OUString& schema,
1651         const OUString& table,
1652         const OUString& columnNamePattern)
1653     throw(SQLException, RuntimeException)
1654 {
1655     OSL_TRACE("ODatabaseMetaData::getColumnPrivileges");
1656     Reference< XResultSet > xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.helper.DatabaseMetaDataResultSet"))),UNO_QUERY);
1657     std::vector< std::vector< Any > > rRows;
1658 
1659     ext_std::string cat(catalog.hasValue()? OUStringToOString(getStringFromAny(catalog), m_rConnection.getConnectionEncoding()).getStr():""),
1660                 sch(OUStringToOString(schema, m_rConnection.getConnectionEncoding()).getStr()),
1661                 tab(OUStringToOString(table, m_rConnection.getConnectionEncoding()).getStr()),
1662                 cNamePattern(OUStringToOString(columnNamePattern, m_rConnection.getConnectionEncoding()).getStr());
1663     try {
1664         rtl_TextEncoding encoding = m_rConnection.getConnectionEncoding();
1665         std::auto_ptr< sql::ResultSet> rset( meta->getColumnPrivileges(cat, sch, tab, cNamePattern.compare("")? cNamePattern:wild));
1666 
1667         sql::ResultSetMetaData * rs_meta = rset->getMetaData();
1668         sal_uInt32 columns = rs_meta->getColumnCount();
1669         while (rset->next()) {
1670             std::vector< Any > aRow(1);
1671             for (sal_uInt32 i = 1; i <= columns; i++) {
1672                 aRow.push_back(makeAny(mysqlc_sdbc_driver::convert(rset->getString(i), encoding)));
1673             }
1674             rRows.push_back(aRow);
1675         }
1676     } catch (sql::MethodNotImplementedException) {
1677         mysqlc_sdbc_driver::throwFeatureNotImplementedException("ODatabaseMetaData::getColumnPrivileges", *this);
1678     } catch (sql::InvalidArgumentException) {
1679         mysqlc_sdbc_driver::throwInvalidArgumentException("ODatabaseMetaData::getColumnPrivileges", *this);
1680     } catch (const sql::SQLException& e) {
1681         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_rConnection.getConnectionEncoding());
1682     }
1683 
1684     lcl_setRows_throw(xResultSet, 2, rRows);
1685     return xResultSet;
1686 }
1687 /* }}} */
1688 
1689 
1690 /* {{{ ODatabaseMetaData::getColumns() -I- */
1691 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns(
1692         const Any& catalog,
1693         const OUString& schemaPattern,
1694         const OUString& tableNamePattern,
1695         const OUString& columnNamePattern)
1696     throw(SQLException, RuntimeException)
1697 {
1698     OSL_TRACE("ODatabaseMetaData::getColumns");
1699     Reference< XResultSet > xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.helper.DatabaseMetaDataResultSet"))),UNO_QUERY);
1700     std::vector< std::vector< Any > > rRows;
1701     ext_std::string cat(catalog.hasValue()? OUStringToOString(getStringFromAny(catalog), m_rConnection.getConnectionEncoding()).getStr():""),
1702                 sPattern(OUStringToOString(schemaPattern, m_rConnection.getConnectionEncoding()).getStr()),
1703                 tNamePattern(OUStringToOString(tableNamePattern, m_rConnection.getConnectionEncoding()).getStr()),
1704                 cNamePattern(OUStringToOString(columnNamePattern, m_rConnection.getConnectionEncoding()).getStr());
1705 
1706     try {
1707         std::auto_ptr< sql::ResultSet> rset( meta->getColumns(cat,
1708                                                 sPattern.compare("")? sPattern:wild,
1709                                                 tNamePattern.compare("")? tNamePattern:wild,
1710                                                 cNamePattern.compare("")? cNamePattern:wild));
1711         rtl_TextEncoding encoding = m_rConnection.getConnectionEncoding();
1712         sql::ResultSetMetaData * rs_meta = rset->getMetaData();
1713         sal_uInt32 columns = rs_meta->getColumnCount();
1714         while (rset->next()) {
1715             std::vector< Any > aRow(1);
1716             for (sal_uInt32 i = 1; i <= columns; i++) {
1717                 if (i == 5) { // ColumnType
1718                     sal_Int32 sdbc_type = mysqlc_sdbc_driver::mysqlToOOOType(atoi(rset->getString(i).c_str()));
1719                     aRow.push_back(makeAny(sdbc_type));
1720                 } else {
1721                     aRow.push_back(makeAny(mysqlc_sdbc_driver::convert(rset->getString(i), encoding)));
1722                 }
1723             }
1724             rRows.push_back(aRow);
1725         }
1726     } catch (sql::MethodNotImplementedException) {
1727         mysqlc_sdbc_driver::throwFeatureNotImplementedException("ODatabaseMetaData::getColumns", *this);
1728     } catch (sql::InvalidArgumentException) {
1729         mysqlc_sdbc_driver::throwInvalidArgumentException("ODatabaseMetaData::getColumns", *this);
1730     } catch (const sql::SQLException& e) {
1731         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_rConnection.getConnectionEncoding());
1732     }
1733     lcl_setRows_throw(xResultSet, 3, rRows);
1734     return xResultSet;
1735 }
1736 /* }}} */
1737 
1738 
1739 /* {{{ ODatabaseMetaData::getTables() -I- */
1740 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
1741         const Any& catalog,
1742         const OUString& schemaPattern,
1743         const OUString& tableNamePattern,
1744         const Sequence< OUString >& types )
1745     throw(SQLException, RuntimeException)
1746 {
1747     OSL_TRACE("ODatabaseMetaData::getTables");
1748     sal_Int32 nLength = types.getLength();
1749 
1750     Reference< XResultSet > xResultSet(getOwnConnection().
1751         getDriver().getFactory()->createInstance(
1752                 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.helper.DatabaseMetaDataResultSet"))),UNO_QUERY);
1753     std::vector< std::vector< Any > > rRows;
1754 
1755     ext_std::string cat(catalog.hasValue()? OUStringToOString(getStringFromAny(catalog), m_rConnection.getConnectionEncoding()).getStr():""),
1756                 sPattern(OUStringToOString(schemaPattern, m_rConnection.getConnectionEncoding()).getStr()),
1757                 tNamePattern(OUStringToOString(tableNamePattern, m_rConnection.getConnectionEncoding()).getStr());
1758 
1759     ext_std::list<sql::SQLString> tabTypes;
1760     for (const OUString *pStart = types.getConstArray(), *p = pStart, *pEnd = pStart + nLength; p != pEnd; ++p) {
1761         tabTypes.push_back(OUStringToOString(*p, m_rConnection.getConnectionEncoding()).getStr());
1762     }
1763 
1764     try {
1765         std::auto_ptr< sql::ResultSet> rset( meta->getTables(cat,
1766                                                sPattern.compare("")? sPattern:wild,
1767                                                tNamePattern.compare("")? tNamePattern:wild,
1768                                                tabTypes));
1769 
1770         rtl_TextEncoding encoding = m_rConnection.getConnectionEncoding();
1771         sql::ResultSetMetaData * rs_meta = rset->getMetaData();
1772         sal_uInt32 columns = rs_meta->getColumnCount();
1773         while (rset->next()) {
1774             std::vector< Any > aRow(1);
1775             bool informationSchema = false;
1776             for (sal_uInt32 i = 1; (i <= columns) && !informationSchema; ++i) {
1777                 sql::SQLString columnStringValue = rset->getString(i);
1778                 if (i == 2) {   // TABLE_SCHEM
1779                     informationSchema = ( 0 == columnStringValue.compare("information_schema"));
1780                 }
1781                 aRow.push_back(makeAny(mysqlc_sdbc_driver::convert(columnStringValue, encoding)));
1782             }
1783             if (!informationSchema) {
1784                 rRows.push_back(aRow);
1785             }
1786         }
1787     } catch (sql::MethodNotImplementedException) {
1788         mysqlc_sdbc_driver::throwFeatureNotImplementedException("ODatabaseMetaData::getTables", *this);
1789     } catch (sql::InvalidArgumentException) {
1790         mysqlc_sdbc_driver::throwInvalidArgumentException("ODatabaseMetaData::getTables", *this);
1791     } catch (const sql::SQLException& e) {
1792         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_rConnection.getConnectionEncoding());
1793     }
1794 
1795     lcl_setRows_throw(xResultSet, 4, rRows);
1796     return xResultSet;
1797 }
1798 /* }}} */
1799 
1800 
1801 /* {{{ ODatabaseMetaData::getProcedureColumns() -I- */
1802 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedureColumns(
1803         const Any& /* catalog */,
1804         const OUString& /* schemaPattern */,
1805         const OUString& /* procedureNamePattern */,
1806         const OUString& /* columnNamePattern */)
1807     throw(SQLException, RuntimeException)
1808 {
1809     OSL_TRACE("ODatabaseMetaData::getProcedureColumns");
1810     // Currently there is no information available
1811     return NULL;
1812 }
1813 /* }}} */
1814 
1815 
1816 /* {{{ ODatabaseMetaData::getProcedures() -I- */
1817 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedures(
1818         const Any& catalog,
1819         const OUString& schemaPattern,
1820         const OUString& procedureNamePattern)
1821     throw(SQLException, RuntimeException)
1822 {
1823     OSL_TRACE("ODatabaseMetaData::getProcedures");
1824     Reference< XResultSet > xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.helper.DatabaseMetaDataResultSet"))),UNO_QUERY);
1825     std::vector< std::vector< Any > > rRows;
1826 
1827     ext_std::string cat(catalog.hasValue()? OUStringToOString(getStringFromAny(catalog), m_rConnection.getConnectionEncoding()).getStr():""),
1828                 sPattern(OUStringToOString(schemaPattern, m_rConnection.getConnectionEncoding()).getStr()),
1829                 pNamePattern(OUStringToOString(procedureNamePattern, m_rConnection.getConnectionEncoding()).getStr());
1830 
1831 
1832     try {
1833         std::auto_ptr< sql::ResultSet> rset( meta->getProcedures(cat,
1834                                                    sPattern.compare("")? sPattern:wild,
1835                                                    pNamePattern.compare("")? pNamePattern:wild));
1836 
1837         rtl_TextEncoding encoding = m_rConnection.getConnectionEncoding();
1838         sql::ResultSetMetaData * rs_meta = rset->getMetaData();
1839         sal_uInt32 columns = rs_meta->getColumnCount();
1840         while (rset->next()) {
1841             std::vector< Any > aRow(1);
1842             for (sal_uInt32 i = 1; i <= columns; i++) {
1843                 aRow.push_back(makeAny(mysqlc_sdbc_driver::convert(rset->getString(i), encoding)));
1844             }
1845             rRows.push_back(aRow);
1846         }
1847     } catch (sql::MethodNotImplementedException) {
1848         mysqlc_sdbc_driver::throwFeatureNotImplementedException("ODatabaseMetaData::getProcedures", *this);
1849     } catch (sql::InvalidArgumentException) {
1850         mysqlc_sdbc_driver::throwInvalidArgumentException("ODatabaseMetaData::getProcedures", *this);
1851     } catch (const sql::SQLException& e) {
1852         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_rConnection.getConnectionEncoding());
1853     }
1854 
1855     lcl_setRows_throw(xResultSet, 7,rRows);
1856     return xResultSet;
1857 }
1858 /* }}} */
1859 
1860 
1861 /* {{{ ODatabaseMetaData::getVersionColumns() -I- */
1862 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getVersionColumns(
1863         const Any& /* catalog */,
1864         const OUString& /* schema */,
1865         const OUString& /* table */)
1866     throw(SQLException, RuntimeException)
1867 {
1868     OSL_TRACE("ODatabaseMetaData::getVersionColumns");
1869     Reference< XResultSet > xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.helper.DatabaseMetaDataResultSet"))),UNO_QUERY);
1870     std::vector< std::vector< Any > > rRows;
1871     lcl_setRows_throw(xResultSet, 16,rRows);
1872     return xResultSet;
1873 }
1874 /* }}} */
1875 
1876 
1877 /* {{{ ODatabaseMetaData::getExportedKeys() -I- */
1878 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getExportedKeys(
1879         const Any&  catalog ,
1880         const OUString&  schema ,
1881         const OUString&  table )
1882     throw(SQLException, RuntimeException)
1883 {
1884     OSL_TRACE("ODatabaseMetaData::getExportedKeys");
1885     Reference< XResultSet > xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.helper.DatabaseMetaDataResultSet"))),UNO_QUERY);
1886     std::vector< std::vector< Any > > rRows;
1887     ext_std::string cat(catalog.hasValue()? OUStringToOString(getStringFromAny(catalog), m_rConnection.getConnectionEncoding()).getStr():""),
1888                 sch(OUStringToOString(schema, m_rConnection.getConnectionEncoding()).getStr()),
1889                 tab(OUStringToOString(table, m_rConnection.getConnectionEncoding()).getStr());
1890 
1891     try {
1892         rtl_TextEncoding encoding = m_rConnection.getConnectionEncoding();
1893         std::auto_ptr< sql::ResultSet> rset( meta->getExportedKeys(cat, sch, tab));
1894         sql::ResultSetMetaData * rs_meta = rset->getMetaData();
1895         sal_uInt32 columns = rs_meta->getColumnCount();
1896         while (rset->next()) {
1897             std::vector< Any > aRow(1);
1898             for (sal_uInt32 i = 1; i <= columns; i++) {
1899                 aRow.push_back(makeAny(mysqlc_sdbc_driver::convert(rset->getString(i), encoding)));
1900             }
1901             rRows.push_back(aRow);
1902         }
1903     } catch (sql::MethodNotImplementedException) {
1904         mysqlc_sdbc_driver::throwFeatureNotImplementedException("ODatabaseMetaData::getExportedKeys", *this);
1905     } catch (sql::InvalidArgumentException) {
1906         mysqlc_sdbc_driver::throwInvalidArgumentException("ODatabaseMetaData::getExportedKeys", *this);
1907     } catch (const sql::SQLException& e) {
1908         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_rConnection.getConnectionEncoding());
1909     }
1910 
1911     lcl_setRows_throw(xResultSet, 8, rRows);
1912     return xResultSet;
1913 }
1914 /* }}} */
1915 
1916 
1917 /* {{{ ODatabaseMetaData::getImportedKeys() -I- */
1918 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getImportedKeys(
1919         const Any& catalog,
1920         const OUString& schema,
1921         const OUString& table)
1922     throw(SQLException, RuntimeException)
1923 {
1924     OSL_TRACE("ODatabaseMetaData::getImportedKeys");
1925 
1926     Reference< XResultSet > xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.helper.DatabaseMetaDataResultSet"))),UNO_QUERY);
1927     std::vector< std::vector< Any > > rRows;
1928 
1929     ext_std::string cat(catalog.hasValue()? OUStringToOString(getStringFromAny(catalog), m_rConnection.getConnectionEncoding()).getStr():""),
1930                 sch(OUStringToOString(schema, m_rConnection.getConnectionEncoding()).getStr()),
1931                 tab(OUStringToOString(table, m_rConnection.getConnectionEncoding()).getStr());
1932 
1933     try {
1934         rtl_TextEncoding encoding = m_rConnection.getConnectionEncoding();
1935         std::auto_ptr< sql::ResultSet> rset( meta->getImportedKeys(cat, sch, tab));
1936         sql::ResultSetMetaData * rs_meta = rset->getMetaData();
1937         sal_uInt32 columns = rs_meta->getColumnCount();
1938         while (rset->next()) {
1939             std::vector< Any > aRow(1);
1940             for (sal_uInt32 i = 1; i <= columns; i++) {
1941                 aRow.push_back(makeAny(mysqlc_sdbc_driver::convert(rset->getString(i), encoding)));
1942             }
1943             rRows.push_back(aRow);
1944         }
1945     } catch (sql::MethodNotImplementedException) {
1946         mysqlc_sdbc_driver::throwFeatureNotImplementedException("ODatabaseMetaData::getImportedKeys", *this);
1947     } catch (sql::InvalidArgumentException) {
1948         mysqlc_sdbc_driver::throwInvalidArgumentException("ODatabaseMetaData::getImportedKeys", *this);
1949     } catch (const sql::SQLException& e) {
1950         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_rConnection.getConnectionEncoding());
1951     }
1952 
1953     lcl_setRows_throw(xResultSet,9,rRows);
1954     return xResultSet;
1955 }
1956 /* }}} */
1957 
1958 
1959 /* {{{ ODatabaseMetaData::getPrimaryKeys() -I- */
1960 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getPrimaryKeys(
1961         const Any& catalog,
1962         const OUString& schema,
1963         const OUString& table)
1964     throw(SQLException, RuntimeException)
1965 {
1966     OSL_TRACE("ODatabaseMetaData::getPrimaryKeys");
1967     Reference< XResultSet > xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.helper.DatabaseMetaDataResultSet"))),UNO_QUERY);
1968     std::vector< std::vector< Any > > rRows;
1969 
1970     ext_std::string cat(catalog.hasValue()? OUStringToOString(getStringFromAny(catalog), m_rConnection.getConnectionEncoding()).getStr():""),
1971                 sch(OUStringToOString(schema, m_rConnection.getConnectionEncoding()).getStr()),
1972                 tab(OUStringToOString(table, m_rConnection.getConnectionEncoding()).getStr());
1973 
1974     try {
1975         rtl_TextEncoding encoding = m_rConnection.getConnectionEncoding();
1976         std::auto_ptr< sql::ResultSet> rset( meta->getPrimaryKeys(cat, sch, tab));
1977         sql::ResultSetMetaData * rs_meta = rset->getMetaData();
1978         sal_uInt32 columns = rs_meta->getColumnCount();
1979         while (rset->next()) {
1980             std::vector< Any > aRow(1);
1981             for (sal_uInt32 i = 1; i <= columns; i++) {
1982                 aRow.push_back(makeAny(mysqlc_sdbc_driver::convert(rset->getString(i), encoding)));
1983             }
1984             rRows.push_back(aRow);
1985         }
1986     } catch (sql::MethodNotImplementedException) {
1987         mysqlc_sdbc_driver::throwFeatureNotImplementedException("ODatabaseMetaData::getPrimaryKeys", *this);
1988     } catch (sql::InvalidArgumentException) {
1989         mysqlc_sdbc_driver::throwInvalidArgumentException("ODatabaseMetaData::getPrimaryKeys", *this);
1990     } catch (const sql::SQLException& e) {
1991         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_rConnection.getConnectionEncoding());
1992     }
1993 
1994     lcl_setRows_throw(xResultSet, 10, rRows);
1995     return xResultSet;
1996 }
1997 /* }}} */
1998 
1999 
2000 /* {{{ ODatabaseMetaData::getIndexInfo() -I- */
2001 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getIndexInfo(
2002         const Any& catalog,
2003         const OUString& schema,
2004         const OUString& table,
2005         sal_Bool unique,
2006         sal_Bool approximate)
2007     throw(SQLException, RuntimeException)
2008 {
2009     OSL_TRACE("ODatabaseMetaData::getIndexInfo");
2010     Reference< XResultSet > xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.helper.DatabaseMetaDataResultSet"))),UNO_QUERY);
2011     std::vector< std::vector< Any > > rRows;
2012 
2013     ext_std::string cat(catalog.hasValue()? OUStringToOString(getStringFromAny(catalog), m_rConnection.getConnectionEncoding()).getStr():""),
2014                 sch(OUStringToOString(schema, m_rConnection.getConnectionEncoding()).getStr()),
2015                 tab(OUStringToOString(table, m_rConnection.getConnectionEncoding()).getStr());
2016 
2017     try {
2018         rtl_TextEncoding encoding = m_rConnection.getConnectionEncoding();
2019         std::auto_ptr< sql::ResultSet> rset( meta->getIndexInfo(cat, sch, tab, unique, approximate));
2020         sql::ResultSetMetaData * rs_meta = rset->getMetaData();
2021         sal_uInt32 columns = rs_meta->getColumnCount();
2022         while (rset->next()) {
2023             std::vector< Any > aRow(1);
2024             for (sal_uInt32 i = 1; i <= columns; i++) {
2025                 aRow.push_back(makeAny(mysqlc_sdbc_driver::convert(rset->getString(i), encoding)));
2026             }
2027             rRows.push_back(aRow);
2028         }
2029     } catch (sql::MethodNotImplementedException) {
2030         mysqlc_sdbc_driver::throwFeatureNotImplementedException("ODatabaseMetaData::getIndexInfo", *this);
2031     } catch (sql::InvalidArgumentException) {
2032         mysqlc_sdbc_driver::throwInvalidArgumentException("ODatabaseMetaData::getIndexInfo", *this);
2033     } catch (const sql::SQLException& e) {
2034         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_rConnection.getConnectionEncoding());
2035     }
2036 
2037     lcl_setRows_throw(xResultSet, 11, rRows);
2038     return xResultSet;
2039 }
2040 /* }}} */
2041 
2042 
2043 /* {{{ ODatabaseMetaData::getBestRowIdentifier() -I- */
2044 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getBestRowIdentifier(
2045         const Any& catalog,
2046         const OUString& schema,
2047         const OUString& table,
2048         sal_Int32 scope,
2049         sal_Bool nullable)
2050     throw(SQLException, RuntimeException)
2051 {
2052     OSL_TRACE("ODatabaseMetaData::getBestRowIdentifier");
2053     Reference< XResultSet > xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.helper.DatabaseMetaDataResultSet"))),UNO_QUERY);
2054     std::vector< std::vector< Any > > rRows;
2055 
2056     ext_std::string cat(catalog.hasValue()? OUStringToOString(getStringFromAny(catalog), m_rConnection.getConnectionEncoding()).getStr():""),
2057                 sch(OUStringToOString(schema, m_rConnection.getConnectionEncoding()).getStr()),
2058                 tab(OUStringToOString(table, m_rConnection.getConnectionEncoding()).getStr());
2059 
2060     try {
2061         rtl_TextEncoding encoding = m_rConnection.getConnectionEncoding();
2062         std::auto_ptr< sql::ResultSet> rset( meta->getBestRowIdentifier(cat, sch, tab, scope, nullable));
2063         sql::ResultSetMetaData * rs_meta = rset->getMetaData();
2064         sal_uInt32 columns = rs_meta->getColumnCount();
2065         while (rset->next()) {
2066             std::vector< Any > aRow(1);
2067             for (sal_uInt32 i = 1; i <= columns; i++) {
2068                 aRow.push_back(makeAny(mysqlc_sdbc_driver::convert(rset->getString(i), encoding)));
2069             }
2070             rRows.push_back(aRow);
2071         }
2072     } catch (sql::MethodNotImplementedException) {
2073         mysqlc_sdbc_driver::throwFeatureNotImplementedException("ODatabaseMetaData::getBestRowIdentifier", *this);
2074     } catch (sql::InvalidArgumentException) {
2075         mysqlc_sdbc_driver::throwInvalidArgumentException("ODatabaseMetaData::getBestRowIdentifier", *this);
2076     } catch (const sql::SQLException& e) {
2077         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_rConnection.getConnectionEncoding());
2078     }
2079 
2080     lcl_setRows_throw(xResultSet, 15, rRows);
2081     return xResultSet;
2082 }
2083 /* }}} */
2084 
2085 
2086 /* {{{ ODatabaseMetaData::getTablePrivileges() -I- */
2087 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges(
2088         const Any& catalog,
2089         const OUString& schemaPattern,
2090         const OUString& tableNamePattern)
2091     throw(SQLException, RuntimeException)
2092 {
2093     OSL_TRACE("ODatabaseMetaData::getTablePrivileges");
2094     Reference< XResultSet > xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.helper.DatabaseMetaDataResultSet"))),UNO_QUERY);
2095     std::vector< std::vector< Any > > rRows;
2096 
2097     ext_std::string cat(catalog.hasValue()? OUStringToOString(getStringFromAny(catalog), m_rConnection.getConnectionEncoding()).getStr():""),
2098                 sPattern(OUStringToOString(schemaPattern, m_rConnection.getConnectionEncoding()).getStr()),
2099                 tPattern(OUStringToOString(tableNamePattern, m_rConnection.getConnectionEncoding()).getStr());
2100 
2101     try {
2102         static bool fakeTablePrivileges = false;
2103         if (fakeTablePrivileges) {
2104             static const sal_Char* allPrivileges[] = {
2105                 "ALTER", "DELETE", "DROP", "INDEX", "INSERT", "LOCK TABLES", "SELECT", "UPDATE"
2106             };
2107             Any userName; userName <<= getUserName();
2108             for (size_t i = 0; i < sizeof( allPrivileges ) / sizeof( allPrivileges[0]); ++i) {
2109                 std::vector< Any > aRow;
2110                 aRow.push_back(makeAny( sal_Int32( i ) ));
2111                 aRow.push_back(catalog);                                                          // TABLE_CAT
2112                 aRow.push_back(makeAny( schemaPattern ));                                         // TABLE_SCHEM
2113                 aRow.push_back(makeAny( tableNamePattern ));                                      // TABLE_NAME
2114                 aRow.push_back(Any());                                                            // GRANTOR
2115                 aRow.push_back(userName);                                                         // GRANTEE
2116                 aRow.push_back(makeAny( ::rtl::OUString::createFromAscii( allPrivileges[i] ) ));  // PRIVILEGE
2117                 aRow.push_back(Any());                                                            // IS_GRANTABLE
2118 
2119                 rRows.push_back(aRow);
2120             }
2121         } else {
2122             rtl_TextEncoding encoding = m_rConnection.getConnectionEncoding();
2123             std::auto_ptr< sql::ResultSet> rset( meta->getTablePrivileges(cat, sPattern.compare("")? sPattern:wild, tPattern.compare("")? tPattern:wild));
2124             sql::ResultSetMetaData * rs_meta = rset->getMetaData();
2125             sal_uInt32 columns = rs_meta->getColumnCount();
2126             while (rset->next()) {
2127                 std::vector< Any > aRow(1);
2128                 for (sal_uInt32 i = 1; i <= columns; i++) {
2129                     aRow.push_back(makeAny(mysqlc_sdbc_driver::convert(rset->getString(i), encoding)));
2130                 }
2131                 rRows.push_back(aRow);
2132             }
2133         }
2134     } catch (sql::MethodNotImplementedException) {
2135         mysqlc_sdbc_driver::throwFeatureNotImplementedException("ODatabaseMetaData::getTablePrivileges", *this);
2136     } catch (sql::InvalidArgumentException) {
2137         mysqlc_sdbc_driver::throwInvalidArgumentException("ODatabaseMetaData::getTablePrivileges", *this);
2138     } catch (const sql::SQLException& e) {
2139         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_rConnection.getConnectionEncoding());
2140     }
2141 
2142     lcl_setRows_throw(xResultSet,12,rRows);
2143     return xResultSet;
2144 }
2145 /* }}} */
2146 
2147 
2148 /* {{{ ODatabaseMetaData::getCrossReference() -I- */
2149 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCrossReference(
2150         const Any& primaryCatalog,
2151         const OUString& primarySchema,
2152         const OUString& primaryTable,
2153         const Any& foreignCatalog,
2154         const OUString& foreignSchema,
2155         const OUString& foreignTable)
2156     throw(SQLException, RuntimeException)
2157 {
2158     OSL_TRACE("ODatabaseMetaData::getCrossReference");
2159     Reference< XResultSet > xResultSet(getOwnConnection().getDriver().getFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.helper.DatabaseMetaDataResultSet"))),UNO_QUERY);
2160     std::vector< std::vector< Any > > rRows;
2161 
2162     ext_std::string primaryCat(primaryCatalog.hasValue()? OUStringToOString(getStringFromAny(primaryCatalog), m_rConnection.getConnectionEncoding()).getStr():""),
2163                 foreignCat(foreignCatalog.hasValue()? OUStringToOString(getStringFromAny(foreignCatalog), m_rConnection.getConnectionEncoding()).getStr():""),
2164                 pSchema(OUStringToOString(primarySchema, m_rConnection.getConnectionEncoding()).getStr()),
2165                 pTable(OUStringToOString(primaryTable, m_rConnection.getConnectionEncoding()).getStr()),
2166                 fSchema(OUStringToOString(foreignSchema, m_rConnection.getConnectionEncoding()).getStr()),
2167                 fTable(OUStringToOString(foreignTable, m_rConnection.getConnectionEncoding()).getStr());
2168 
2169     try {
2170         rtl_TextEncoding encoding = m_rConnection.getConnectionEncoding();
2171         std::auto_ptr< sql::ResultSet> rset( meta->getCrossReference(primaryCat, pSchema, pTable, foreignCat, fSchema, fTable));
2172         sql::ResultSetMetaData * rs_meta = rset->getMetaData();
2173         sal_uInt32 columns = rs_meta->getColumnCount();
2174         while (rset->next()) {
2175             std::vector< Any > aRow(1);
2176             for (sal_uInt32 i = 1; i <= columns; i++) {
2177                 aRow.push_back(makeAny(mysqlc_sdbc_driver::convert(rset->getString(i), encoding)));
2178             }
2179             rRows.push_back(aRow);
2180         }
2181     } catch (sql::MethodNotImplementedException) {
2182         mysqlc_sdbc_driver::throwFeatureNotImplementedException("ODatabaseMetaData::getCrossReference", *this);
2183     } catch (sql::InvalidArgumentException) {
2184         mysqlc_sdbc_driver::throwInvalidArgumentException("ODatabaseMetaData::getCrossReference", *this);
2185     } catch (const sql::SQLException& e) {
2186         mysqlc_sdbc_driver::translateAndThrow(e, *this, m_rConnection.getConnectionEncoding());
2187     }
2188 
2189     lcl_setRows_throw(xResultSet,13,rRows);
2190     return xResultSet;
2191 }
2192 /* }}} */
2193 
2194 
2195 /* {{{ ODatabaseMetaData::getUDTs() -I- */
2196 Reference< XResultSet > SAL_CALL ODatabaseMetaData::getUDTs(
2197         const Any& /* catalog */,
2198         const OUString& /* schemaPattern */,
2199         const OUString& /* typeNamePattern */,
2200         const Sequence< sal_Int32 >& /* types */)
2201     throw(SQLException, RuntimeException)
2202 {
2203     OSL_TRACE("ODatabaseMetaData::getUDTs");
2204     mysqlc_sdbc_driver::throwFeatureNotImplementedException("ODatabaseMetaData::getUDTs", *this);
2205     return NULL;
2206 }
2207 /* }}} */
2208 
2209 /*
2210  * Local variables:
2211  * tab-width: 4
2212  * c-basic-offset: 4
2213  * End:
2214  * vim600: noet sw=4 ts=4 fdm=marker
2215  * vim<600: noet sw=4 ts=4
2216  */
2217 
2218