merge the formfield patch from ooo-build
[ooovba.git] / connectivity / source / commontools / FDatabaseMetaDataResultSetMetaData.cxx
blobfa2789c29a7326e4cc4827efa7e25717f88f2239
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: FDatabaseMetaDataResultSetMetaData.cxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_connectivity.hxx"
33 #include "FDatabaseMetaDataResultSetMetaData.hxx"
34 #include <com/sun/star/sdbc/DataType.hpp>
35 #include <com/sun/star/sdbc/ProcedureResult.hpp>
36 #include <com/sun/star/sdbc/ColumnValue.hpp>
38 using namespace connectivity;
39 using namespace ::com::sun::star::beans;
40 using namespace ::com::sun::star::uno;
41 using namespace ::com::sun::star::sdbcx;
42 using namespace ::com::sun::star::sdbc;
43 using namespace ::com::sun::star::container;
44 using namespace ::com::sun::star::lang;
46 // -------------------------------------------------------------------------
47 ODatabaseMetaDataResultSetMetaData::~ODatabaseMetaDataResultSetMetaData()
50 // -------------------------------------------------------------------------
51 sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnDisplaySize( sal_Int32 column ) throw(SQLException, RuntimeException)
53 if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
54 return (*m_mColumnsIter).second.getColumnDisplaySize();
56 return 0;
58 // -------------------------------------------------------------------------
60 sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnType( sal_Int32 column ) throw(SQLException, RuntimeException)
62 if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
63 return (*m_mColumnsIter).second.getColumnType();
64 return 1;
66 // -------------------------------------------------------------------------
68 sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnCount( ) throw(SQLException, RuntimeException)
70 return m_mColumns.size();
72 // -------------------------------------------------------------------------
74 sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isCaseSensitive( sal_Int32 column ) throw(SQLException, RuntimeException)
76 if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
77 return (*m_mColumnsIter).second.isCaseSensitive();
78 return sal_True;
80 // -------------------------------------------------------------------------
82 ::rtl::OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getSchemaName( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
84 return ::rtl::OUString();
86 // -------------------------------------------------------------------------
88 ::rtl::OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnName( sal_Int32 column ) throw(SQLException, RuntimeException)
90 if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
91 return (*m_mColumnsIter).second.getColumnName();
92 return ::rtl::OUString();
94 // -------------------------------------------------------------------------
95 ::rtl::OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getTableName( sal_Int32 column ) throw(SQLException, RuntimeException)
97 if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
98 return (*m_mColumnsIter).second.getTableName();
99 return ::rtl::OUString();
101 // -------------------------------------------------------------------------
102 ::rtl::OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getCatalogName( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
104 return ::rtl::OUString();
106 // -------------------------------------------------------------------------
107 ::rtl::OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnTypeName( sal_Int32 column ) throw(SQLException, RuntimeException)
109 if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
110 return (*m_mColumnsIter).second.getColumnTypeName();
111 return ::rtl::OUString();
113 // -------------------------------------------------------------------------
114 ::rtl::OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnLabel( sal_Int32 column ) throw(SQLException, RuntimeException)
116 if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
117 return (*m_mColumnsIter).second.getColumnLabel();
118 return getColumnName(column);
120 // -------------------------------------------------------------------------
121 ::rtl::OUString SAL_CALL ODatabaseMetaDataResultSetMetaData::getColumnServiceName( sal_Int32 column ) throw(SQLException, RuntimeException)
123 if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
124 return (*m_mColumnsIter).second.getColumnServiceName();
125 return ::rtl::OUString();
127 // -------------------------------------------------------------------------
129 sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isCurrency( sal_Int32 column ) throw(SQLException, RuntimeException)
131 if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
132 return (*m_mColumnsIter).second.isCurrency();
133 return sal_False;
135 // -------------------------------------------------------------------------
137 sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isAutoIncrement( sal_Int32 column ) throw(SQLException, RuntimeException)
139 if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
140 return (*m_mColumnsIter).second.isAutoIncrement();
141 return sal_False;
143 // -------------------------------------------------------------------------
146 sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isSigned( sal_Int32 column ) throw(SQLException, RuntimeException)
148 if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
149 return (*m_mColumnsIter).second.isSigned();
150 return sal_False;
152 // -------------------------------------------------------------------------
153 sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::getPrecision( sal_Int32 column ) throw(SQLException, RuntimeException)
155 if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
156 return (*m_mColumnsIter).second.getPrecision();
157 return 0;
159 // -------------------------------------------------------------------------
160 sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
162 if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
163 return (*m_mColumnsIter).second.getScale();
165 return 0;
167 // -------------------------------------------------------------------------
169 sal_Int32 SAL_CALL ODatabaseMetaDataResultSetMetaData::isNullable( sal_Int32 column ) throw(SQLException, RuntimeException)
171 if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
172 return (*m_mColumnsIter).second.isNullable();
174 return sal_False;
176 // -------------------------------------------------------------------------
178 sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isSearchable( sal_Int32 column ) throw(SQLException, RuntimeException)
180 if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
181 return (*m_mColumnsIter).second.isSearchable();
182 return sal_True;
184 // -------------------------------------------------------------------------
186 sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isReadOnly( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
188 // if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
189 // return (*m_mColumnsIter).second.isReadOnly();
191 return sal_True;
193 // -------------------------------------------------------------------------
195 sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isDefinitelyWritable( sal_Int32 /*column*/ ) throw(SQLException, RuntimeException)
197 // if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
198 // return (*m_mColumnsIter).second.isDefinitelyWritable();
200 return sal_False;
203 // -------------------------------------------------------------------------
204 sal_Bool SAL_CALL ODatabaseMetaDataResultSetMetaData::isWritable( sal_Int32 column ) throw(SQLException, RuntimeException)
206 // if(m_mColumns.size() && (m_mColumnsIter = m_mColumns.find(column)) != m_mColumns.end())
207 // return (*m_mColumnsIter).second.isWritable();
208 return isDefinitelyWritable(column);
210 // -------------------------------------------------------------------------
211 void ODatabaseMetaDataResultSetMetaData::setColumnPrivilegesMap()
213 setColumnMap();
214 m_mColumns[5] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("GRANTOR"),
215 ColumnValue::NULLABLE,
216 3,3,0,
217 DataType::VARCHAR);
218 m_mColumns[6] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("GRANTEE"),
219 ColumnValue::NULLABLE,
220 3,3,0,
221 DataType::VARCHAR);
222 m_mColumns[7] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("PRIVILEGE"),
223 ColumnValue::NULLABLE,
224 3,3,0,
225 DataType::VARCHAR);
226 m_mColumns[8] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("IS_GRANTABLE"),
227 ColumnValue::NULLABLE,
228 3,3,0,
229 DataType::VARCHAR);
231 // -----------------------------------------------------------------------------
232 void ODatabaseMetaDataResultSetMetaData::setTableNameMap()
234 m_mColumns[1] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("TABLE_CAT"),
235 ColumnValue::NULLABLE,
236 3,3,0,
237 DataType::VARCHAR);
238 m_mColumns[2] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("TABLE_SCHEM"),
239 ColumnValue::NULLABLE,
240 3,3,0,
241 DataType::VARCHAR);
242 m_mColumns[3] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("TABLE_NAME"),
243 ColumnValue::NO_NULLS,
244 3,3,0,
245 DataType::VARCHAR);
247 // -----------------------------------------------------------------------------
248 void ODatabaseMetaDataResultSetMetaData::setColumnMap()
250 setTableNameMap();
251 m_mColumns[4] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("COLUMN_NAME"),
252 ColumnValue::NO_NULLS,
253 3,3,0,
254 DataType::VARCHAR);
256 // -------------------------------------------------------------------------
257 void ODatabaseMetaDataResultSetMetaData::setColumnsMap()
259 setColumnMap();
261 m_mColumns[5] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("DATA_TYPE"),
262 ColumnValue::NO_NULLS,
263 0,0,0,
264 DataType::INTEGER);
265 m_mColumns[6] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("TYPE_NAME"),
266 ColumnValue::NO_NULLS,
267 0,0,0,
268 DataType::VARCHAR);
269 m_mColumns[7] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("COLUMN_SIZE"),
270 ColumnValue::NO_NULLS,
271 3,3,0,
272 DataType::INTEGER);
273 m_mColumns[8] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("BUFFER_LENGTH"),
274 ColumnValue::NULLABLE,
275 3,3,0,
276 DataType::INTEGER);
277 m_mColumns[9] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("DECIMAL_DIGITS"),
278 ColumnValue::NO_NULLS,
279 0,0,0,
280 DataType::INTEGER);
281 m_mColumns[10] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("NUM_PREC_RADIX"),
282 ColumnValue::NO_NULLS,
283 0,0,0,
284 DataType::INTEGER);
285 m_mColumns[11] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("NULLABLE"),
286 ColumnValue::NO_NULLS,
287 1,1,0,
288 DataType::INTEGER);
289 m_mColumns[12] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("REMARKS"),
290 ColumnValue::NULLABLE,
291 0,0,0,
292 DataType::VARCHAR);
293 m_mColumns[13] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("COLUMN_DEF"),
294 ColumnValue::NULLABLE,
295 0,0,0,
296 DataType::VARCHAR);
297 m_mColumns[14] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("SQL_DATA_TYPE"),
298 ColumnValue::NO_NULLS,
299 1,1,0,
300 DataType::INTEGER);
301 m_mColumns[15] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("SQL_DATETIME_SUB"),
302 ColumnValue::NO_NULLS,
303 1,1,0,
304 DataType::INTEGER);
305 m_mColumns[16] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("CHAR_OCTET_LENGTH"),
306 ColumnValue::NO_NULLS,
307 1,1,0,
308 DataType::INTEGER);
309 m_mColumns[17] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("ORDINAL_POSITION"),
310 ColumnValue::NO_NULLS,
311 1,1,0,
312 DataType::INTEGER);
313 m_mColumns[18] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("IS_NULLABLE"),
314 ColumnValue::NO_NULLS,
315 1,1,0,
316 DataType::VARCHAR);
318 // -------------------------------------------------------------------------
319 void ODatabaseMetaDataResultSetMetaData::setTablesMap()
321 setTableNameMap();
322 m_mColumns[4] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("TABLE_TYPE"),
323 ColumnValue::NO_NULLS,
324 0,0,0,
325 DataType::VARCHAR);
326 m_mColumns[5] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("REMARKS"),
327 ColumnValue::NULLABLE,
328 0,0,0,
329 DataType::VARCHAR);
331 // -------------------------------------------------------------------------
332 void ODatabaseMetaDataResultSetMetaData::setProcedureNameMap()
334 m_mColumns[1] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("PROCEDURE_CAT"),
335 ColumnValue::NULLABLE,
336 0,0,0,
337 DataType::VARCHAR);
338 m_mColumns[2] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("PROCEDURE_SCHEM"),
339 ColumnValue::NULLABLE,
340 0,0,0,
341 DataType::VARCHAR);
342 m_mColumns[3] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("PROCEDURE_NAME"),
343 ColumnValue::NO_NULLS,
344 0,0,0,
345 DataType::VARCHAR);
347 // -------------------------------------------------------------------------
348 void ODatabaseMetaDataResultSetMetaData::setProcedureColumnsMap()
350 setProcedureNameMap();
351 m_mColumns[4] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("COLUMN_NAME"),
352 ColumnValue::NO_NULLS,
353 0,0,0,
354 DataType::VARCHAR);
355 m_mColumns[5] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("COLUMN_TYPE"),
356 ColumnValue::NO_NULLS,
357 0,0,0,
358 DataType::INTEGER);
359 m_mColumns[6] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("DATA_TYPE"),
360 ColumnValue::NO_NULLS,
361 0,0,0,
362 DataType::INTEGER);
363 m_mColumns[7] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("TYPE_NAME"),
364 ColumnValue::NULLABLE,
365 0,0,0,
366 DataType::VARCHAR);
367 m_mColumns[8] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("PRECISION"),
368 ColumnValue::NO_NULLS,
369 0,0,0,
370 DataType::INTEGER);
371 m_mColumns[9] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("LENGTH"),
372 ColumnValue::NO_NULLS,
373 0,0,0,
374 DataType::INTEGER);
375 m_mColumns[10] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("SCALE"),
376 ColumnValue::NO_NULLS,
377 0,0,0,
378 DataType::INTEGER);
379 m_mColumns[11] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("RADIX"),
380 ColumnValue::NO_NULLS,
381 0,0,0,
382 DataType::INTEGER);
383 m_mColumns[12] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("NULLABLE"),
384 ColumnValue::NO_NULLS,
385 0,0,0,
386 DataType::INTEGER);
387 m_mColumns[13] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("REMARKS"),
388 ColumnValue::NULLABLE,
389 0,0,0,
390 DataType::VARCHAR);
393 // -------------------------------------------------------------------------
394 void ODatabaseMetaDataResultSetMetaData::setPrimaryKeysMap()
396 setColumnMap();
397 m_mColumns[5] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("KEY_SEQ"),
398 ColumnValue::NO_NULLS,
399 1,1,0,
400 DataType::INTEGER);
401 m_mColumns[6] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("PK_NAME"),
402 ColumnValue::NULLABLE,
403 0,0,0,
404 DataType::VARCHAR);
406 // -------------------------------------------------------------------------
407 void ODatabaseMetaDataResultSetMetaData::setIndexInfoMap()
409 setTableNameMap();
410 m_mColumns[4] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("NON_UNIQUE"),
411 ColumnValue::NO_NULLS,
412 1,1,0,
413 DataType::BIT);
414 m_mColumns[5] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("INDEX_QUALIFIER"),
415 ColumnValue::NULLABLE,
416 0,0,0,
417 DataType::VARCHAR);
418 m_mColumns[6] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("INDEX_NAME"),
419 ColumnValue::NULLABLE,
420 0,0,0,
421 DataType::VARCHAR);
422 m_mColumns[7] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("TYPE"),
423 ColumnValue::NO_NULLS,
424 0,0,0,
425 DataType::INTEGER);
426 m_mColumns[8] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("ORDINAL_POSITION"),
427 ColumnValue::NO_NULLS,
428 0,0,0,
429 DataType::INTEGER);
430 m_mColumns[9] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("COLUMN_NAME"),
431 ColumnValue::NO_NULLS,
432 0,0,0,
433 DataType::VARCHAR);
434 m_mColumns[10] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("ASC_OR_DESC"),
435 ColumnValue::NULLABLE,
436 0,0,0,
437 DataType::VARCHAR);
438 m_mColumns[11] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("CARDINALITY"),
439 ColumnValue::NO_NULLS,
440 0,0,0,
441 DataType::INTEGER);
442 m_mColumns[12] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("PAGES"),
443 ColumnValue::NO_NULLS,
444 0,0,0,
445 DataType::INTEGER);
446 m_mColumns[13] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("FILTER_CONDITION"),
447 ColumnValue::NULLABLE,
448 0,0,0,
449 DataType::VARCHAR);
451 // -------------------------------------------------------------------------
452 void ODatabaseMetaDataResultSetMetaData::setTablePrivilegesMap()
454 setTableNameMap();
455 m_mColumns[4] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("GRANTOR"),
456 ColumnValue::NULLABLE,
457 0,0,0,
458 DataType::VARCHAR);
459 m_mColumns[5] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("GRANTEE"),
460 ColumnValue::NO_NULLS,
461 0,0,0,
462 DataType::VARCHAR);
463 m_mColumns[6] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("PRIVILEGE"),
464 ColumnValue::NULLABLE,
465 0,0,0,
466 DataType::VARCHAR);
467 m_mColumns[7] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("IS_GRANTABLE"),
468 ColumnValue::NULLABLE,
469 0,0,0,
470 DataType::VARCHAR);
472 // -------------------------------------------------------------------------
473 void ODatabaseMetaDataResultSetMetaData::setCrossReferenceMap()
475 m_mColumns[1] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("PKTABLE_CAT"),
476 ColumnValue::NULLABLE,
477 0,0,0,
478 DataType::VARCHAR);
479 m_mColumns[2] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("PKTABLE_SCHEM"),
480 ColumnValue::NULLABLE,
481 0,0,0,
482 DataType::VARCHAR);
483 m_mColumns[3] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("PKTABLE_NAME"),
484 ColumnValue::NO_NULLS,
485 0,0,0,
486 DataType::VARCHAR);
487 m_mColumns[4] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("PKCOLUMN_NAME"),
488 ColumnValue::NO_NULLS,
489 0,0,0,
490 DataType::VARCHAR);
491 m_mColumns[5] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("FKTABLE_CAT"),
492 ColumnValue::NULLABLE,
493 0,0,0,
494 DataType::VARCHAR);
495 m_mColumns[6] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("FKTABLE_SCHEM"),
496 ColumnValue::NULLABLE,
497 0,0,0,
498 DataType::VARCHAR);
499 m_mColumns[7] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("FKTABLE_NAME"),
500 ColumnValue::NO_NULLS,
501 0,0,0,
502 DataType::VARCHAR);
503 m_mColumns[8] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("FKCOLUMN_NAME"),
504 ColumnValue::NO_NULLS,
505 0,0,0,
506 DataType::VARCHAR);
508 m_mColumns[9] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("KEY_SEQ"),
509 ColumnValue::NO_NULLS,
510 1,1,0,
511 DataType::INTEGER);
512 m_mColumns[10] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("UPDATE_RULE"),
513 ColumnValue::NO_NULLS,
514 1,1,0,
515 DataType::INTEGER);
516 m_mColumns[11] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("DELETE_RULE"),
517 ColumnValue::NO_NULLS,
518 1,1,0,
519 DataType::INTEGER);
520 m_mColumns[12] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("FK_NAME"),
521 ColumnValue::NULLABLE,
522 0,0,0,
523 DataType::VARCHAR);
524 m_mColumns[13] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("PK_NAME"),
525 ColumnValue::NULLABLE,
526 0,0,0,
527 DataType::VARCHAR);
528 m_mColumns[14] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("DEFERRABILITY"),
529 ColumnValue::NO_NULLS,
530 1,1,0,
531 DataType::INTEGER);
533 // -------------------------------------------------------------------------
534 void ODatabaseMetaDataResultSetMetaData::setTypeInfoMap()
536 m_mColumns[1] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("TYPE_NAME"),
537 ColumnValue::NO_NULLS,
538 0,0,0,
539 DataType::VARCHAR);
540 m_mColumns[2] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("DATA_TYPE"),
541 ColumnValue::NO_NULLS,
542 1,1,0,
543 DataType::INTEGER);
544 m_mColumns[3] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("PRECISION"),
545 ColumnValue::NO_NULLS,
546 1,1,0,
547 DataType::INTEGER);
548 m_mColumns[4] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("LITERAL_PREFIX"),
549 ColumnValue::NULLABLE,
550 0,0,0,
551 DataType::VARCHAR);
552 m_mColumns[5] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("LITERAL_SUFFIX"),
553 ColumnValue::NULLABLE,
554 0,0,0,
555 DataType::VARCHAR);
556 m_mColumns[6] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("CREATE_PARAMS"),
557 ColumnValue::NULLABLE,
558 0,0,0,
559 DataType::VARCHAR);
560 m_mColumns[7] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("NULLABLE"),
561 ColumnValue::NO_NULLS,
562 1,1,0,
563 DataType::INTEGER);
564 m_mColumns[8] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("CASE_SENSITIVE"),
565 ColumnValue::NO_NULLS,
566 1,1,0,
567 DataType::BIT);
568 m_mColumns[9] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("SEARCHABLE"),
569 ColumnValue::NO_NULLS,
570 1,1,0,
571 DataType::INTEGER);
572 m_mColumns[10] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("UNSIGNED_ATTRIBUTE"),
573 ColumnValue::NO_NULLS,
574 1,1,0,
575 DataType::BIT);
576 m_mColumns[11] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("FIXED_PREC_SCALE"),
577 ColumnValue::NO_NULLS,
578 1,1,0,
579 DataType::BIT);
580 m_mColumns[12] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("AUTO_INCREMENT"),
581 ColumnValue::NO_NULLS,
582 1,1,0,
583 DataType::BIT);
584 m_mColumns[13] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("LOCAL_TYPE_NAME"),
585 ColumnValue::NO_NULLS,
586 0,0,0,
587 DataType::VARCHAR);
588 m_mColumns[14] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("MINIMUM_SCALE"),
589 ColumnValue::NO_NULLS,
590 0,0,0,
591 DataType::INTEGER);
592 m_mColumns[15] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("MAXIMUM_SCALE"),
593 ColumnValue::NO_NULLS,
594 0,0,0,
595 DataType::INTEGER);
596 m_mColumns[16] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("SQL_DATA_TYPE"),
597 ColumnValue::NO_NULLS,
598 1,1,0,
599 DataType::INTEGER);
600 m_mColumns[17] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("SQL_DATETIME_SUB"),
601 ColumnValue::NO_NULLS,
602 1,1,0,
603 DataType::INTEGER);
604 m_mColumns[18] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("NUM_PREC_RADIX"),
605 ColumnValue::NO_NULLS,
606 1,1,0,
607 DataType::INTEGER);
609 // -------------------------------------------------------------------------
610 void ODatabaseMetaDataResultSetMetaData::setProceduresMap()
612 setProcedureNameMap();
613 m_mColumns[4] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("RESERVED1"),
614 ColumnValue::NULLABLE,
615 0,0,0,
616 DataType::VARCHAR);
617 m_mColumns[5] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("RESERVED2"),
618 ColumnValue::NULLABLE,
619 0,0,0,
620 DataType::VARCHAR);
621 m_mColumns[6] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("RESERVED3"),
622 ColumnValue::NULLABLE,
623 0,0,0,
624 DataType::VARCHAR);
625 m_mColumns[7] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("REMARKS"),
626 ColumnValue::NULLABLE,
627 0,0,0,
628 DataType::VARCHAR);
629 m_mColumns[8] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("PROCEDURE_TYPE"),
630 ColumnValue::NO_NULLS,
631 1,1,0,
632 DataType::INTEGER);
634 // -------------------------------------------------------------------------
635 void ODatabaseMetaDataResultSetMetaData::setTableTypes()
637 m_mColumns[1] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("TABLE_TYPE"),
638 ColumnValue::NULLABLE,
639 0,0,0,
640 DataType::VARCHAR);
642 // -------------------------------------------------------------------------
643 void ODatabaseMetaDataResultSetMetaData::setCatalogsMap()
645 m_mColumns[1] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("TABLE_CAT"),
646 ColumnValue::NULLABLE,
647 0,0,0,
648 DataType::VARCHAR);
650 // -------------------------------------------------------------------------
651 void ODatabaseMetaDataResultSetMetaData::setSchemasMap()
653 m_mColumns[1] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("TABLE_SCHEM"),
654 ColumnValue::NULLABLE,
655 0,0,0,
656 DataType::VARCHAR);
658 // -------------------------------------------------------------------------
659 void ODatabaseMetaDataResultSetMetaData::setVersionColumnsMap()
661 m_mColumns[1] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("SCOPE"),
662 ColumnValue::NO_NULLS,
663 0,0,0,
664 DataType::INTEGER);
665 m_mColumns[2] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("COLUMN_NAME"),
666 ColumnValue::NO_NULLS,
667 0,0,0,
668 DataType::VARCHAR);
669 m_mColumns[3] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("DATA_TYPE"),
670 ColumnValue::NO_NULLS,
671 0,0,0,
672 DataType::INTEGER);
673 m_mColumns[4] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("TYPE_NAME"),
674 ColumnValue::NO_NULLS,
675 0,0,0,
676 DataType::VARCHAR);
677 m_mColumns[5] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("COLUMN_SIZE"),
678 ColumnValue::NO_NULLS,
679 0,0,0,
680 DataType::INTEGER);
681 m_mColumns[6] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("BUFFER_LENGTH"),
682 ColumnValue::NO_NULLS,
683 0,0,0,
684 DataType::INTEGER);
685 m_mColumns[7] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("DECIMAL_DIGITS"),
686 ColumnValue::NULLABLE,
687 0,0,0,
688 DataType::INTEGER);
689 m_mColumns[8] = OColumn(::rtl::OUString(),::rtl::OUString::createFromAscii("PSEUDO_COLUMN"),
690 ColumnValue::NO_NULLS,
691 0,0,0,
692 DataType::INTEGER);