xref: /AOO41X/main/connectivity/source/drivers/odbcbase/ODatabaseMetaData.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_connectivity.hxx"
30*cdf0e10cSrcweir #include "odbc/ODatabaseMetaData.hxx"
31*cdf0e10cSrcweir #include "odbc/OTools.hxx"
32*cdf0e10cSrcweir #ifndef _CONNECTIVITY_ODBC_ORESULTSET_HXX_
33*cdf0e10cSrcweir #include "odbc/ODatabaseMetaDataResultSet.hxx"
34*cdf0e10cSrcweir #endif
35*cdf0e10cSrcweir #include "FDatabaseMetaDataResultSet.hxx"
36*cdf0e10cSrcweir #include <com/sun/star/sdbc/DataType.hpp>
37*cdf0e10cSrcweir #include <com/sun/star/sdbc/ResultSetType.hpp>
38*cdf0e10cSrcweir #include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
39*cdf0e10cSrcweir #include "odbc/OFunctiondefs.hxx"
40*cdf0e10cSrcweir #include "stdio.h"
41*cdf0e10cSrcweir #include "TPrivilegesResultSet.hxx"
42*cdf0e10cSrcweir #include <connectivity/dbexception.hxx>
43*cdf0e10cSrcweir #include <rtl/ustrbuf.hxx>
44*cdf0e10cSrcweir 
45*cdf0e10cSrcweir using namespace connectivity::odbc;
46*cdf0e10cSrcweir using namespace com::sun::star::uno;
47*cdf0e10cSrcweir using namespace com::sun::star::lang;
48*cdf0e10cSrcweir using namespace com::sun::star::beans;
49*cdf0e10cSrcweir using namespace com::sun::star::sdbc;
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir ODatabaseMetaData::ODatabaseMetaData(const SQLHANDLE _pHandle,OConnection* _pCon)
52*cdf0e10cSrcweir 						: ::connectivity::ODatabaseMetaDataBase(_pCon,_pCon->getConnectionInfo())
53*cdf0e10cSrcweir 						,m_aConnectionHandle(_pHandle)
54*cdf0e10cSrcweir 						,m_pConnection(_pCon)
55*cdf0e10cSrcweir 						,m_bUseCatalog(sal_True)
56*cdf0e10cSrcweir 						,m_bOdbc3(sal_True)
57*cdf0e10cSrcweir {
58*cdf0e10cSrcweir 	OSL_ENSURE(m_pConnection,"ODatabaseMetaData::ODatabaseMetaData: No connection set!");
59*cdf0e10cSrcweir 	if(!m_pConnection->isCatalogUsed())
60*cdf0e10cSrcweir 	{
61*cdf0e10cSrcweir 		osl_incrementInterlockedCount( &m_refCount );
62*cdf0e10cSrcweir 		try
63*cdf0e10cSrcweir 		{
64*cdf0e10cSrcweir 			m_bUseCatalog	= !(usesLocalFiles() || usesLocalFilePerTable());
65*cdf0e10cSrcweir 			::rtl::OUString sVersion = getDriverVersion();
66*cdf0e10cSrcweir 			m_bOdbc3		=  sVersion != ::rtl::OUString::createFromAscii("02.50") && sVersion != ::rtl::OUString::createFromAscii("02.00");
67*cdf0e10cSrcweir 		}
68*cdf0e10cSrcweir 		catch(SQLException& )
69*cdf0e10cSrcweir 		{ // doesn't matter here
70*cdf0e10cSrcweir 		}
71*cdf0e10cSrcweir 		osl_decrementInterlockedCount( &m_refCount );
72*cdf0e10cSrcweir 	}
73*cdf0e10cSrcweir }
74*cdf0e10cSrcweir // -------------------------------------------------------------------------
75*cdf0e10cSrcweir ODatabaseMetaData::~ODatabaseMetaData()
76*cdf0e10cSrcweir {
77*cdf0e10cSrcweir }
78*cdf0e10cSrcweir // -------------------------------------------------------------------------
79*cdf0e10cSrcweir Reference< XResultSet > ODatabaseMetaData::impl_getTypeInfo_throw(  )
80*cdf0e10cSrcweir {
81*cdf0e10cSrcweir 	Reference< XResultSet > xRef;
82*cdf0e10cSrcweir 	try
83*cdf0e10cSrcweir 	{
84*cdf0e10cSrcweir 		ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
85*cdf0e10cSrcweir 		xRef = pResult;
86*cdf0e10cSrcweir 		pResult->openTypeInfo();
87*cdf0e10cSrcweir 	}
88*cdf0e10cSrcweir 	catch(SQLException&)
89*cdf0e10cSrcweir 	{
90*cdf0e10cSrcweir         xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTypeInfo);
91*cdf0e10cSrcweir 	}
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir 	return xRef;
94*cdf0e10cSrcweir }
95*cdf0e10cSrcweir // -------------------------------------------------------------------------
96*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCatalogs(  ) throw(SQLException, RuntimeException)
97*cdf0e10cSrcweir {
98*cdf0e10cSrcweir 	Reference< XResultSet > xRef;
99*cdf0e10cSrcweir 	if(!m_bUseCatalog)
100*cdf0e10cSrcweir 	{
101*cdf0e10cSrcweir         xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eCatalogs);
102*cdf0e10cSrcweir 	}
103*cdf0e10cSrcweir 	else
104*cdf0e10cSrcweir 	{
105*cdf0e10cSrcweir 		try
106*cdf0e10cSrcweir 		{
107*cdf0e10cSrcweir 			ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
108*cdf0e10cSrcweir 			xRef = pResult;
109*cdf0e10cSrcweir 			pResult->openCatalogs();
110*cdf0e10cSrcweir 		}
111*cdf0e10cSrcweir 		catch(SQLException&)
112*cdf0e10cSrcweir 		{
113*cdf0e10cSrcweir 			xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eCatalogs);
114*cdf0e10cSrcweir 		}
115*cdf0e10cSrcweir 	}
116*cdf0e10cSrcweir 
117*cdf0e10cSrcweir 	return xRef;
118*cdf0e10cSrcweir }
119*cdf0e10cSrcweir // -------------------------------------------------------------------------
120*cdf0e10cSrcweir ::rtl::OUString ODatabaseMetaData::impl_getCatalogSeparator_throw(  )
121*cdf0e10cSrcweir {
122*cdf0e10cSrcweir     ::rtl::OUString aVal;
123*cdf0e10cSrcweir 	if ( m_bUseCatalog )
124*cdf0e10cSrcweir 		OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_NAME_SEPARATOR,aVal,*this,m_pConnection->getTextEncoding());
125*cdf0e10cSrcweir 
126*cdf0e10cSrcweir 	return aVal;
127*cdf0e10cSrcweir }
128*cdf0e10cSrcweir // -------------------------------------------------------------------------
129*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getSchemas(  ) throw(SQLException, RuntimeException)
130*cdf0e10cSrcweir {
131*cdf0e10cSrcweir 	Reference< XResultSet > xRef;
132*cdf0e10cSrcweir 	try
133*cdf0e10cSrcweir 	{
134*cdf0e10cSrcweir 		ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
135*cdf0e10cSrcweir 		xRef = pResult;
136*cdf0e10cSrcweir 		pResult->openSchemas();
137*cdf0e10cSrcweir 	}
138*cdf0e10cSrcweir 	catch(SQLException&)
139*cdf0e10cSrcweir 	{
140*cdf0e10cSrcweir 		xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eSchemas);
141*cdf0e10cSrcweir 	}
142*cdf0e10cSrcweir 	return xRef;
143*cdf0e10cSrcweir }
144*cdf0e10cSrcweir // -------------------------------------------------------------------------
145*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumnPrivileges(
146*cdf0e10cSrcweir 	const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table,
147*cdf0e10cSrcweir 	const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
148*cdf0e10cSrcweir {
149*cdf0e10cSrcweir 	Reference< XResultSet > xRef;
150*cdf0e10cSrcweir 	try
151*cdf0e10cSrcweir 	{
152*cdf0e10cSrcweir 		ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
153*cdf0e10cSrcweir 		xRef = pResult;
154*cdf0e10cSrcweir 		pResult->openColumnPrivileges(m_bUseCatalog ? catalog : Any(),schema,table,columnNamePattern);
155*cdf0e10cSrcweir 	}
156*cdf0e10cSrcweir 	catch(SQLException&)
157*cdf0e10cSrcweir 	{
158*cdf0e10cSrcweir 		xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eColumnPrivileges);
159*cdf0e10cSrcweir 	}
160*cdf0e10cSrcweir 	return xRef;
161*cdf0e10cSrcweir }
162*cdf0e10cSrcweir // -------------------------------------------------------------------------
163*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns(
164*cdf0e10cSrcweir 	const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern,
165*cdf0e10cSrcweir 	const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
166*cdf0e10cSrcweir {
167*cdf0e10cSrcweir 	Reference< XResultSet > xRef;
168*cdf0e10cSrcweir 	try
169*cdf0e10cSrcweir 	{
170*cdf0e10cSrcweir 		ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
171*cdf0e10cSrcweir 		xRef = pResult;
172*cdf0e10cSrcweir 		pResult->openColumns(m_bUseCatalog ? catalog : Any(),schemaPattern,tableNamePattern,columnNamePattern);
173*cdf0e10cSrcweir 	}
174*cdf0e10cSrcweir 	catch(SQLException&)
175*cdf0e10cSrcweir 	{
176*cdf0e10cSrcweir 		xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eColumns);
177*cdf0e10cSrcweir 	}
178*cdf0e10cSrcweir 	return xRef;
179*cdf0e10cSrcweir }
180*cdf0e10cSrcweir // -------------------------------------------------------------------------
181*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
182*cdf0e10cSrcweir 	const Any& catalog, const ::rtl::OUString& schemaPattern,
183*cdf0e10cSrcweir 	const ::rtl::OUString& tableNamePattern, const Sequence< ::rtl::OUString >& types ) throw(SQLException, RuntimeException)
184*cdf0e10cSrcweir {
185*cdf0e10cSrcweir 	Reference< XResultSet > xRef;
186*cdf0e10cSrcweir 	try
187*cdf0e10cSrcweir 	{
188*cdf0e10cSrcweir 		ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
189*cdf0e10cSrcweir 		xRef = pResult;
190*cdf0e10cSrcweir 		pResult->openTables(m_bUseCatalog ? catalog : Any(),schemaPattern,tableNamePattern,types);
191*cdf0e10cSrcweir 	}
192*cdf0e10cSrcweir 	catch(SQLException&)
193*cdf0e10cSrcweir 	{
194*cdf0e10cSrcweir 		xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTables);
195*cdf0e10cSrcweir 	}
196*cdf0e10cSrcweir 	return xRef;
197*cdf0e10cSrcweir }
198*cdf0e10cSrcweir // -------------------------------------------------------------------------
199*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedureColumns(
200*cdf0e10cSrcweir 	const Any& catalog, const ::rtl::OUString& schemaPattern,
201*cdf0e10cSrcweir 	const ::rtl::OUString& procedureNamePattern, const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
202*cdf0e10cSrcweir {
203*cdf0e10cSrcweir 	Reference< XResultSet > xRef;
204*cdf0e10cSrcweir 	try
205*cdf0e10cSrcweir 	{
206*cdf0e10cSrcweir 		ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
207*cdf0e10cSrcweir 		xRef = pResult;
208*cdf0e10cSrcweir 		pResult->openProcedureColumns(m_bUseCatalog ? catalog : Any(),schemaPattern,procedureNamePattern,columnNamePattern);
209*cdf0e10cSrcweir 	}
210*cdf0e10cSrcweir 	catch(SQLException&)
211*cdf0e10cSrcweir 	{
212*cdf0e10cSrcweir 		xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eProcedureColumns);
213*cdf0e10cSrcweir 	}
214*cdf0e10cSrcweir 	return xRef;
215*cdf0e10cSrcweir }
216*cdf0e10cSrcweir // -------------------------------------------------------------------------
217*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedures(
218*cdf0e10cSrcweir 	const Any& catalog, const ::rtl::OUString& schemaPattern,
219*cdf0e10cSrcweir 	const ::rtl::OUString& procedureNamePattern ) throw(SQLException, RuntimeException)
220*cdf0e10cSrcweir {
221*cdf0e10cSrcweir 	Reference< XResultSet > xRef;
222*cdf0e10cSrcweir 	try
223*cdf0e10cSrcweir 	{
224*cdf0e10cSrcweir 		ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
225*cdf0e10cSrcweir 		xRef = pResult;
226*cdf0e10cSrcweir 		pResult->openProcedures(m_bUseCatalog ? catalog : Any(),schemaPattern,procedureNamePattern);
227*cdf0e10cSrcweir 	}
228*cdf0e10cSrcweir 	catch(SQLException&)
229*cdf0e10cSrcweir 	{
230*cdf0e10cSrcweir 		xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eProcedures);
231*cdf0e10cSrcweir 	}
232*cdf0e10cSrcweir 	return xRef;
233*cdf0e10cSrcweir }
234*cdf0e10cSrcweir // -------------------------------------------------------------------------
235*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getVersionColumns(
236*cdf0e10cSrcweir 	const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
237*cdf0e10cSrcweir {
238*cdf0e10cSrcweir 	Reference< XResultSet > xRef;
239*cdf0e10cSrcweir     bool bSuccess = false;
240*cdf0e10cSrcweir 	try
241*cdf0e10cSrcweir 	{
242*cdf0e10cSrcweir         if ( !m_pConnection->preventGetVersionColumns() )
243*cdf0e10cSrcweir         {
244*cdf0e10cSrcweir 		    ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
245*cdf0e10cSrcweir 		    xRef = pResult;
246*cdf0e10cSrcweir 		    pResult->openVersionColumns(m_bUseCatalog ? catalog : Any(),schema,table);
247*cdf0e10cSrcweir             bSuccess = true;
248*cdf0e10cSrcweir         }
249*cdf0e10cSrcweir 	}
250*cdf0e10cSrcweir 	catch(SQLException&)
251*cdf0e10cSrcweir 	{
252*cdf0e10cSrcweir 	}
253*cdf0e10cSrcweir 
254*cdf0e10cSrcweir     if ( !bSuccess )
255*cdf0e10cSrcweir     {
256*cdf0e10cSrcweir 		xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eVersionColumns);
257*cdf0e10cSrcweir     }
258*cdf0e10cSrcweir 
259*cdf0e10cSrcweir     return xRef;
260*cdf0e10cSrcweir }
261*cdf0e10cSrcweir // -------------------------------------------------------------------------
262*cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxBinaryLiteralLength(  ) throw(SQLException, RuntimeException)
263*cdf0e10cSrcweir {
264*cdf0e10cSrcweir 	SQLUINTEGER nValue;
265*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_BINARY_LITERAL_LEN,nValue,*this);
266*cdf0e10cSrcweir 	return nValue;
267*cdf0e10cSrcweir }
268*cdf0e10cSrcweir // -------------------------------------------------------------------------
269*cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxRowSize(  ) throw(SQLException, RuntimeException)
270*cdf0e10cSrcweir {
271*cdf0e10cSrcweir 	SQLUINTEGER nValue;
272*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_ROW_SIZE,nValue,*this);
273*cdf0e10cSrcweir 	return nValue;
274*cdf0e10cSrcweir }
275*cdf0e10cSrcweir // -------------------------------------------------------------------------
276*cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCatalogNameLength(  ) throw(SQLException, RuntimeException)
277*cdf0e10cSrcweir {
278*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
279*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_CATALOG_NAME_LEN,nValue,*this);
280*cdf0e10cSrcweir 	return nValue;
281*cdf0e10cSrcweir }
282*cdf0e10cSrcweir // -------------------------------------------------------------------------
283*cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCharLiteralLength(  ) throw(SQLException, RuntimeException)
284*cdf0e10cSrcweir {
285*cdf0e10cSrcweir 	SQLUINTEGER nValue;
286*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_CHAR_LITERAL_LEN,nValue,*this);
287*cdf0e10cSrcweir 	return nValue;
288*cdf0e10cSrcweir }
289*cdf0e10cSrcweir // -------------------------------------------------------------------------
290*cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnNameLength(  ) throw(SQLException, RuntimeException)
291*cdf0e10cSrcweir {
292*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
293*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMN_NAME_LEN,nValue,*this);
294*cdf0e10cSrcweir 	return nValue;
295*cdf0e10cSrcweir }
296*cdf0e10cSrcweir // -------------------------------------------------------------------------
297*cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInIndex(  ) throw(SQLException, RuntimeException)
298*cdf0e10cSrcweir {
299*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
300*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMNS_IN_INDEX,nValue,*this);
301*cdf0e10cSrcweir 	return nValue;
302*cdf0e10cSrcweir }
303*cdf0e10cSrcweir // -------------------------------------------------------------------------
304*cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxCursorNameLength(  ) throw(SQLException, RuntimeException)
305*cdf0e10cSrcweir {
306*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
307*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_CURSOR_NAME_LEN,nValue,*this);
308*cdf0e10cSrcweir 	return nValue;
309*cdf0e10cSrcweir }
310*cdf0e10cSrcweir // -------------------------------------------------------------------------
311*cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxConnections(  ) throw(SQLException, RuntimeException)
312*cdf0e10cSrcweir {
313*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
314*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_DRIVER_CONNECTIONS/*SQL_ACTIVE_CONNECTIONS*/,nValue,*this);
315*cdf0e10cSrcweir 	return nValue;
316*cdf0e10cSrcweir }
317*cdf0e10cSrcweir // -------------------------------------------------------------------------
318*cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInTable(  ) throw(SQLException, RuntimeException)
319*cdf0e10cSrcweir {
320*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
321*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMNS_IN_TABLE,nValue,*this);
322*cdf0e10cSrcweir 	return nValue;
323*cdf0e10cSrcweir }
324*cdf0e10cSrcweir // -------------------------------------------------------------------------
325*cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxStatementLength(  ) throw(SQLException, RuntimeException)
326*cdf0e10cSrcweir {
327*cdf0e10cSrcweir 	SQLUINTEGER nValue;
328*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_STATEMENT_LEN,nValue,*this);
329*cdf0e10cSrcweir 	return nValue;
330*cdf0e10cSrcweir }
331*cdf0e10cSrcweir // -------------------------------------------------------------------------
332*cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxTableNameLength(  ) throw(SQLException, RuntimeException)
333*cdf0e10cSrcweir {
334*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
335*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_TABLE_NAME_LEN,nValue,*this);
336*cdf0e10cSrcweir 	return nValue;
337*cdf0e10cSrcweir }
338*cdf0e10cSrcweir // -------------------------------------------------------------------------
339*cdf0e10cSrcweir sal_Int32 ODatabaseMetaData::impl_getMaxTablesInSelect_throw(  )
340*cdf0e10cSrcweir {
341*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
342*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_TABLES_IN_SELECT,nValue,*this);
343*cdf0e10cSrcweir 	return nValue;
344*cdf0e10cSrcweir }
345*cdf0e10cSrcweir // -------------------------------------------------------------------------
346*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getExportedKeys(
347*cdf0e10cSrcweir 	const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
348*cdf0e10cSrcweir {
349*cdf0e10cSrcweir 	Reference< XResultSet > xRef;
350*cdf0e10cSrcweir 	try
351*cdf0e10cSrcweir 	{
352*cdf0e10cSrcweir 		ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
353*cdf0e10cSrcweir 		xRef = pResult;
354*cdf0e10cSrcweir 		pResult->openExportedKeys(m_bUseCatalog ? catalog : Any(),schema,table);
355*cdf0e10cSrcweir 	}
356*cdf0e10cSrcweir 	catch(SQLException&)
357*cdf0e10cSrcweir 	{
358*cdf0e10cSrcweir 		xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eExportedKeys);
359*cdf0e10cSrcweir 	}
360*cdf0e10cSrcweir 	return xRef;
361*cdf0e10cSrcweir }
362*cdf0e10cSrcweir // -------------------------------------------------------------------------
363*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getImportedKeys(
364*cdf0e10cSrcweir 	const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
365*cdf0e10cSrcweir {
366*cdf0e10cSrcweir 	Reference< XResultSet > xRef;
367*cdf0e10cSrcweir 	try
368*cdf0e10cSrcweir 	{
369*cdf0e10cSrcweir 		ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
370*cdf0e10cSrcweir 		xRef = pResult;
371*cdf0e10cSrcweir 		pResult->openImportedKeys(m_bUseCatalog ? catalog : Any(),schema,table);
372*cdf0e10cSrcweir 	}
373*cdf0e10cSrcweir 	catch(SQLException&)
374*cdf0e10cSrcweir 	{
375*cdf0e10cSrcweir 		xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eImportedKeys);
376*cdf0e10cSrcweir 	}
377*cdf0e10cSrcweir 	return xRef;
378*cdf0e10cSrcweir }
379*cdf0e10cSrcweir // -------------------------------------------------------------------------
380*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getPrimaryKeys(
381*cdf0e10cSrcweir 	const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
382*cdf0e10cSrcweir {
383*cdf0e10cSrcweir 	Reference< XResultSet > xRef;
384*cdf0e10cSrcweir 	try
385*cdf0e10cSrcweir 	{
386*cdf0e10cSrcweir 		ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
387*cdf0e10cSrcweir 		xRef = pResult;
388*cdf0e10cSrcweir 		pResult->openPrimaryKeys(m_bUseCatalog ? catalog : Any(),schema,table);
389*cdf0e10cSrcweir 	}
390*cdf0e10cSrcweir 	catch(SQLException&)
391*cdf0e10cSrcweir 	{
392*cdf0e10cSrcweir 		xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::ePrimaryKeys);
393*cdf0e10cSrcweir 	}
394*cdf0e10cSrcweir 	return xRef;
395*cdf0e10cSrcweir }
396*cdf0e10cSrcweir // -------------------------------------------------------------------------
397*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getIndexInfo(
398*cdf0e10cSrcweir 	const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table,
399*cdf0e10cSrcweir 	sal_Bool unique, sal_Bool approximate ) throw(SQLException, RuntimeException)
400*cdf0e10cSrcweir {
401*cdf0e10cSrcweir 	Reference< XResultSet > xRef;
402*cdf0e10cSrcweir 	try
403*cdf0e10cSrcweir 	{
404*cdf0e10cSrcweir 		ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
405*cdf0e10cSrcweir 		xRef = pResult;
406*cdf0e10cSrcweir 		pResult->openIndexInfo(m_bUseCatalog ? catalog : Any(),schema,table,unique,approximate);
407*cdf0e10cSrcweir 	}
408*cdf0e10cSrcweir 	catch(SQLException&)
409*cdf0e10cSrcweir 	{
410*cdf0e10cSrcweir 		xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eIndexInfo);
411*cdf0e10cSrcweir 	}
412*cdf0e10cSrcweir 	return xRef;
413*cdf0e10cSrcweir }
414*cdf0e10cSrcweir // -------------------------------------------------------------------------
415*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getBestRowIdentifier(
416*cdf0e10cSrcweir 	const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, sal_Int32 scope,
417*cdf0e10cSrcweir 	sal_Bool nullable ) throw(SQLException, RuntimeException)
418*cdf0e10cSrcweir {
419*cdf0e10cSrcweir 	Reference< XResultSet > xRef;
420*cdf0e10cSrcweir 	try
421*cdf0e10cSrcweir 	{
422*cdf0e10cSrcweir 		ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
423*cdf0e10cSrcweir 		xRef = pResult;
424*cdf0e10cSrcweir 		pResult->openBestRowIdentifier(m_bUseCatalog ? catalog : Any(),schema,table,scope,nullable);
425*cdf0e10cSrcweir 	}
426*cdf0e10cSrcweir 	catch(SQLException&)
427*cdf0e10cSrcweir 	{
428*cdf0e10cSrcweir 		xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eBestRowIdentifier);
429*cdf0e10cSrcweir 	}
430*cdf0e10cSrcweir 	return xRef;
431*cdf0e10cSrcweir }
432*cdf0e10cSrcweir // -------------------------------------------------------------------------
433*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges(
434*cdf0e10cSrcweir 	const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern ) throw(SQLException, RuntimeException)
435*cdf0e10cSrcweir {
436*cdf0e10cSrcweir 	if ( m_pConnection->isIgnoreDriverPrivilegesEnabled() )
437*cdf0e10cSrcweir 	{
438*cdf0e10cSrcweir 		return new OResultSetPrivileges(this,catalog,schemaPattern,tableNamePattern);
439*cdf0e10cSrcweir 	}
440*cdf0e10cSrcweir 	ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
441*cdf0e10cSrcweir 	Reference< XResultSet > xRef = pResult;
442*cdf0e10cSrcweir 	pResult->openTablePrivileges(m_bUseCatalog ? catalog : Any(),schemaPattern,tableNamePattern);
443*cdf0e10cSrcweir 	return xRef;
444*cdf0e10cSrcweir }
445*cdf0e10cSrcweir // -------------------------------------------------------------------------
446*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCrossReference(
447*cdf0e10cSrcweir 	const Any& primaryCatalog, const ::rtl::OUString& primarySchema,
448*cdf0e10cSrcweir 	const ::rtl::OUString& primaryTable, const Any& foreignCatalog,
449*cdf0e10cSrcweir 	const ::rtl::OUString& foreignSchema, const ::rtl::OUString& foreignTable ) throw(SQLException, RuntimeException)
450*cdf0e10cSrcweir {
451*cdf0e10cSrcweir 	Reference< XResultSet > xRef;
452*cdf0e10cSrcweir 	try
453*cdf0e10cSrcweir 	{
454*cdf0e10cSrcweir 		ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(m_pConnection);
455*cdf0e10cSrcweir 		xRef = pResult;
456*cdf0e10cSrcweir 		pResult->openForeignKeys(m_bUseCatalog ? primaryCatalog : Any(),primarySchema.toChar() == '%' ? &primarySchema : NULL,&primaryTable,
457*cdf0e10cSrcweir 			m_bUseCatalog ? foreignCatalog : Any(), foreignSchema.toChar() == '%' ? &foreignSchema : NULL,&foreignTable);
458*cdf0e10cSrcweir 	}
459*cdf0e10cSrcweir 	catch(SQLException&)
460*cdf0e10cSrcweir 	{
461*cdf0e10cSrcweir 		xRef = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eCrossReference);
462*cdf0e10cSrcweir 	}
463*cdf0e10cSrcweir 	return xRef;
464*cdf0e10cSrcweir }
465*cdf0e10cSrcweir // -------------------------------------------------------------------------
466*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::doesMaxRowSizeIncludeBlobs(  ) throw(SQLException, RuntimeException)
467*cdf0e10cSrcweir {
468*cdf0e10cSrcweir 	::rtl::OUString aVal;
469*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_ROW_SIZE_INCLUDES_LONG,aVal,*this,m_pConnection->getTextEncoding());
470*cdf0e10cSrcweir 	return aVal.toChar() == 'Y';
471*cdf0e10cSrcweir }
472*cdf0e10cSrcweir // -------------------------------------------------------------------------
473*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseQuotedIdentifiers(  ) throw(SQLException, RuntimeException)
474*cdf0e10cSrcweir {
475*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
476*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_QUOTED_IDENTIFIER_CASE,nValue,*this);
477*cdf0e10cSrcweir 	return nValue == SQL_IC_LOWER;
478*cdf0e10cSrcweir }
479*cdf0e10cSrcweir // -------------------------------------------------------------------------
480*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::storesLowerCaseIdentifiers(  ) throw(SQLException, RuntimeException)
481*cdf0e10cSrcweir {
482*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
483*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_IDENTIFIER_CASE,nValue,*this);
484*cdf0e10cSrcweir 	return nValue == SQL_IC_LOWER;
485*cdf0e10cSrcweir }
486*cdf0e10cSrcweir // -------------------------------------------------------------------------
487*cdf0e10cSrcweir sal_Bool ODatabaseMetaData::impl_storesMixedCaseQuotedIdentifiers_throw(  )
488*cdf0e10cSrcweir {
489*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
490*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_QUOTED_IDENTIFIER_CASE,nValue,*this);
491*cdf0e10cSrcweir 	return nValue == SQL_IC_MIXED;
492*cdf0e10cSrcweir }
493*cdf0e10cSrcweir // -------------------------------------------------------------------------
494*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::storesMixedCaseIdentifiers(  ) throw(SQLException, RuntimeException)
495*cdf0e10cSrcweir {
496*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
497*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_IDENTIFIER_CASE,nValue,*this);
498*cdf0e10cSrcweir 	return nValue == SQL_IC_MIXED;
499*cdf0e10cSrcweir }
500*cdf0e10cSrcweir // -------------------------------------------------------------------------
501*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseQuotedIdentifiers(  ) throw(SQLException, RuntimeException)
502*cdf0e10cSrcweir {
503*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
504*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_QUOTED_IDENTIFIER_CASE,nValue,*this);
505*cdf0e10cSrcweir 	return nValue == SQL_IC_UPPER;
506*cdf0e10cSrcweir }
507*cdf0e10cSrcweir // -------------------------------------------------------------------------
508*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseIdentifiers(  ) throw(SQLException, RuntimeException)
509*cdf0e10cSrcweir {
510*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
511*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_IDENTIFIER_CASE,nValue,*this);
512*cdf0e10cSrcweir 	return nValue == SQL_IC_UPPER;
513*cdf0e10cSrcweir }
514*cdf0e10cSrcweir // -------------------------------------------------------------------------
515*cdf0e10cSrcweir sal_Bool ODatabaseMetaData::impl_supportsAlterTableWithAddColumn_throw(  )
516*cdf0e10cSrcweir {
517*cdf0e10cSrcweir 	SQLUINTEGER nValue;
518*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ALTER_TABLE,nValue,*this);
519*cdf0e10cSrcweir 	return (nValue & SQL_AT_ADD_COLUMN) == SQL_AT_ADD_COLUMN;
520*cdf0e10cSrcweir }
521*cdf0e10cSrcweir // -------------------------------------------------------------------------
522*cdf0e10cSrcweir sal_Bool ODatabaseMetaData::impl_supportsAlterTableWithDropColumn_throw(  )
523*cdf0e10cSrcweir {
524*cdf0e10cSrcweir 	SQLUINTEGER nValue;
525*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ALTER_TABLE,nValue,*this);
526*cdf0e10cSrcweir 	return	((nValue & SQL_AT_DROP_COLUMN)			== SQL_AT_DROP_COLUMN)			||
527*cdf0e10cSrcweir 			((nValue & SQL_AT_DROP_COLUMN_CASCADE)	== SQL_AT_DROP_COLUMN_CASCADE)	||
528*cdf0e10cSrcweir 			((nValue & SQL_AT_DROP_COLUMN_RESTRICT) == SQL_AT_DROP_COLUMN_RESTRICT);
529*cdf0e10cSrcweir }
530*cdf0e10cSrcweir // -------------------------------------------------------------------------
531*cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxIndexLength(  ) throw(SQLException, RuntimeException)
532*cdf0e10cSrcweir {
533*cdf0e10cSrcweir 	SQLUINTEGER nValue;
534*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_INDEX_SIZE,nValue,*this);
535*cdf0e10cSrcweir 	return nValue;
536*cdf0e10cSrcweir }
537*cdf0e10cSrcweir // -------------------------------------------------------------------------
538*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsNonNullableColumns(  ) throw(SQLException, RuntimeException)
539*cdf0e10cSrcweir {
540*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
541*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NON_NULLABLE_COLUMNS,nValue,*this);
542*cdf0e10cSrcweir 	return nValue == SQL_NNC_NON_NULL;
543*cdf0e10cSrcweir }
544*cdf0e10cSrcweir // -------------------------------------------------------------------------
545*cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getCatalogTerm(  ) throw(SQLException, RuntimeException)
546*cdf0e10cSrcweir {
547*cdf0e10cSrcweir 	::rtl::OUString aVal;
548*cdf0e10cSrcweir 	if(m_bUseCatalog)
549*cdf0e10cSrcweir 		OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_TERM,aVal,*this,m_pConnection->getTextEncoding());
550*cdf0e10cSrcweir 	return aVal;
551*cdf0e10cSrcweir }
552*cdf0e10cSrcweir // -------------------------------------------------------------------------
553*cdf0e10cSrcweir ::rtl::OUString ODatabaseMetaData::impl_getIdentifierQuoteString_throw(  )
554*cdf0e10cSrcweir {
555*cdf0e10cSrcweir 	::rtl::OUString aVal;
556*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_IDENTIFIER_QUOTE_CHAR,aVal,*this,m_pConnection->getTextEncoding());
557*cdf0e10cSrcweir 	return aVal;
558*cdf0e10cSrcweir }
559*cdf0e10cSrcweir // -------------------------------------------------------------------------
560*cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getExtraNameCharacters(  ) throw(SQLException, RuntimeException)
561*cdf0e10cSrcweir {
562*cdf0e10cSrcweir 	::rtl::OUString aVal;
563*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SPECIAL_CHARACTERS,aVal,*this,m_pConnection->getTextEncoding());
564*cdf0e10cSrcweir 	return aVal;
565*cdf0e10cSrcweir }
566*cdf0e10cSrcweir // -------------------------------------------------------------------------
567*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsDifferentTableCorrelationNames(  ) throw(SQLException, RuntimeException)
568*cdf0e10cSrcweir {
569*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
570*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
571*cdf0e10cSrcweir 	return nValue != SQL_CN_NONE;
572*cdf0e10cSrcweir }
573*cdf0e10cSrcweir // -------------------------------------------------------------------------
574*cdf0e10cSrcweir sal_Bool        ODatabaseMetaData::impl_isCatalogAtStart_throw(  )
575*cdf0e10cSrcweir {
576*cdf0e10cSrcweir 	SQLUSMALLINT nValue=0;
577*cdf0e10cSrcweir 	if ( m_bUseCatalog )
578*cdf0e10cSrcweir 		OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_LOCATION,nValue,*this);
579*cdf0e10cSrcweir 	return nValue == SQL_CL_START;
580*cdf0e10cSrcweir }
581*cdf0e10cSrcweir // -------------------------------------------------------------------------
582*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionIgnoredInTransactions(  ) throw(SQLException, RuntimeException)
583*cdf0e10cSrcweir {
584*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
585*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this);
586*cdf0e10cSrcweir 	return nValue == SQL_TC_DDL_IGNORE;
587*cdf0e10cSrcweir }
588*cdf0e10cSrcweir // -------------------------------------------------------------------------
589*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionCausesTransactionCommit(  ) throw(SQLException, RuntimeException)
590*cdf0e10cSrcweir {
591*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
592*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this);
593*cdf0e10cSrcweir 	return nValue == SQL_TC_DDL_COMMIT;
594*cdf0e10cSrcweir }
595*cdf0e10cSrcweir // -------------------------------------------------------------------------
596*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsDataManipulationTransactionsOnly(  ) throw(SQLException, RuntimeException)
597*cdf0e10cSrcweir {
598*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
599*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this);
600*cdf0e10cSrcweir 	return nValue == SQL_TC_DML;
601*cdf0e10cSrcweir }
602*cdf0e10cSrcweir // -------------------------------------------------------------------------
603*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions(  ) throw(SQLException, RuntimeException)
604*cdf0e10cSrcweir {
605*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
606*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this);
607*cdf0e10cSrcweir 	return nValue == SQL_TC_ALL;
608*cdf0e10cSrcweir }
609*cdf0e10cSrcweir // -------------------------------------------------------------------------
610*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedDelete(  ) throw(SQLException, RuntimeException)
611*cdf0e10cSrcweir {
612*cdf0e10cSrcweir 	SQLUINTEGER nValue;
613*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DYNAMIC_CURSOR_ATTRIBUTES1,nValue,*this);
614*cdf0e10cSrcweir 	return (nValue & SQL_CA1_POS_DELETE) == SQL_CA1_POS_DELETE;
615*cdf0e10cSrcweir }
616*cdf0e10cSrcweir // -------------------------------------------------------------------------
617*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsPositionedUpdate(  ) throw(SQLException, RuntimeException)
618*cdf0e10cSrcweir {
619*cdf0e10cSrcweir 	SQLUINTEGER nValue;
620*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DYNAMIC_CURSOR_ATTRIBUTES1,nValue,*this);
621*cdf0e10cSrcweir 	return (nValue & SQL_CA1_POS_UPDATE) == SQL_CA1_POS_UPDATE;
622*cdf0e10cSrcweir }
623*cdf0e10cSrcweir // -------------------------------------------------------------------------
624*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossRollback(  ) throw(SQLException, RuntimeException)
625*cdf0e10cSrcweir {
626*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
627*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CURSOR_ROLLBACK_BEHAVIOR,nValue,*this);
628*cdf0e10cSrcweir 	return nValue == SQL_CB_PRESERVE || nValue == SQL_CB_CLOSE;
629*cdf0e10cSrcweir }
630*cdf0e10cSrcweir // -------------------------------------------------------------------------
631*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenStatementsAcrossCommit(  ) throw(SQLException, RuntimeException)
632*cdf0e10cSrcweir {
633*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
634*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CURSOR_COMMIT_BEHAVIOR,nValue,*this);
635*cdf0e10cSrcweir 	return nValue == SQL_CB_PRESERVE || nValue == SQL_CB_CLOSE;
636*cdf0e10cSrcweir }
637*cdf0e10cSrcweir // -------------------------------------------------------------------------
638*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossCommit(  ) throw(SQLException, RuntimeException)
639*cdf0e10cSrcweir {
640*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
641*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CURSOR_COMMIT_BEHAVIOR,nValue,*this);
642*cdf0e10cSrcweir 	return nValue == SQL_CB_PRESERVE;
643*cdf0e10cSrcweir }
644*cdf0e10cSrcweir // -------------------------------------------------------------------------
645*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsOpenCursorsAcrossRollback(  ) throw(SQLException, RuntimeException)
646*cdf0e10cSrcweir {
647*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
648*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CURSOR_ROLLBACK_BEHAVIOR,nValue,*this);
649*cdf0e10cSrcweir 	return nValue == SQL_CB_PRESERVE;
650*cdf0e10cSrcweir }
651*cdf0e10cSrcweir // -------------------------------------------------------------------------
652*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactionIsolationLevel( sal_Int32 level ) throw(SQLException, RuntimeException)
653*cdf0e10cSrcweir {
654*cdf0e10cSrcweir 	SQLUINTEGER nValue;
655*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_ISOLATION_OPTION,nValue,*this);
656*cdf0e10cSrcweir 	return (nValue & static_cast<SQLUINTEGER>(level)) == static_cast<SQLUINTEGER>(level);
657*cdf0e10cSrcweir }
658*cdf0e10cSrcweir // -------------------------------------------------------------------------
659*cdf0e10cSrcweir sal_Bool ODatabaseMetaData::impl_supportsSchemasInDataManipulation_throw(  )
660*cdf0e10cSrcweir {
661*cdf0e10cSrcweir 	SQLUINTEGER nValue;
662*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this);
663*cdf0e10cSrcweir 	return (nValue & SQL_SU_DML_STATEMENTS) == SQL_SU_DML_STATEMENTS;
664*cdf0e10cSrcweir }
665*cdf0e10cSrcweir // -------------------------------------------------------------------------
666*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92FullSQL(  ) throw(SQLException, RuntimeException)
667*cdf0e10cSrcweir {
668*cdf0e10cSrcweir 	SQLUINTEGER nValue;
669*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SQL_CONFORMANCE,nValue,*this);
670*cdf0e10cSrcweir 	return nValue == SQL_SC_SQL92_FULL;
671*cdf0e10cSrcweir }
672*cdf0e10cSrcweir // -------------------------------------------------------------------------
673*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92EntryLevelSQL(  ) throw(SQLException, RuntimeException)
674*cdf0e10cSrcweir {
675*cdf0e10cSrcweir 	SQLUINTEGER nValue;
676*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SQL_CONFORMANCE,nValue,*this);
677*cdf0e10cSrcweir 	return nValue == SQL_SC_SQL92_ENTRY;
678*cdf0e10cSrcweir }
679*cdf0e10cSrcweir // -------------------------------------------------------------------------
680*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsIntegrityEnhancementFacility(  ) throw(SQLException, RuntimeException)
681*cdf0e10cSrcweir {
682*cdf0e10cSrcweir 	::rtl::OUString aStr;
683*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_INTEGRITY,aStr,*this,m_pConnection->getTextEncoding());
684*cdf0e10cSrcweir 	return aStr.toChar() == 'Y';
685*cdf0e10cSrcweir }
686*cdf0e10cSrcweir // -------------------------------------------------------------------------
687*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInIndexDefinitions(  ) throw(SQLException, RuntimeException)
688*cdf0e10cSrcweir {
689*cdf0e10cSrcweir 	SQLUINTEGER nValue;
690*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this);
691*cdf0e10cSrcweir 	return (nValue & SQL_SU_INDEX_DEFINITION) == SQL_SU_INDEX_DEFINITION;
692*cdf0e10cSrcweir }
693*cdf0e10cSrcweir // -------------------------------------------------------------------------
694*cdf0e10cSrcweir sal_Bool ODatabaseMetaData::impl_supportsSchemasInTableDefinitions_throw(  )
695*cdf0e10cSrcweir {
696*cdf0e10cSrcweir 	SQLUINTEGER nValue;
697*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this);
698*cdf0e10cSrcweir 	return (nValue & SQL_SU_TABLE_DEFINITION) == SQL_SU_TABLE_DEFINITION;
699*cdf0e10cSrcweir }
700*cdf0e10cSrcweir // -------------------------------------------------------------------------
701*cdf0e10cSrcweir sal_Bool ODatabaseMetaData::impl_supportsCatalogsInTableDefinitions_throw(  )
702*cdf0e10cSrcweir {
703*cdf0e10cSrcweir 	SQLUINTEGER nValue=0;
704*cdf0e10cSrcweir 	if(m_bUseCatalog)
705*cdf0e10cSrcweir 		OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this);
706*cdf0e10cSrcweir 	return (nValue & SQL_CU_TABLE_DEFINITION) == SQL_CU_TABLE_DEFINITION;
707*cdf0e10cSrcweir }
708*cdf0e10cSrcweir // -------------------------------------------------------------------------
709*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInIndexDefinitions(  ) throw(SQLException, RuntimeException)
710*cdf0e10cSrcweir {
711*cdf0e10cSrcweir 	SQLUINTEGER nValue=0;
712*cdf0e10cSrcweir 	if(m_bUseCatalog)
713*cdf0e10cSrcweir 		OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this);
714*cdf0e10cSrcweir 	return (nValue & SQL_CU_INDEX_DEFINITION) == SQL_CU_INDEX_DEFINITION;
715*cdf0e10cSrcweir }
716*cdf0e10cSrcweir // -------------------------------------------------------------------------
717*cdf0e10cSrcweir sal_Bool ODatabaseMetaData::impl_supportsCatalogsInDataManipulation_throw(  )
718*cdf0e10cSrcweir {
719*cdf0e10cSrcweir 	SQLUINTEGER nValue=0;
720*cdf0e10cSrcweir 	if(m_bUseCatalog)
721*cdf0e10cSrcweir 		OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this);
722*cdf0e10cSrcweir 	return (nValue & SQL_CU_DML_STATEMENTS) == SQL_CU_DML_STATEMENTS;
723*cdf0e10cSrcweir }
724*cdf0e10cSrcweir // -------------------------------------------------------------------------
725*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsOuterJoins(  ) throw(SQLException, RuntimeException)
726*cdf0e10cSrcweir {
727*cdf0e10cSrcweir 	SQLUINTEGER nValue;
728*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_OJ_CAPABILITIES,nValue,*this);
729*cdf0e10cSrcweir 	return ((nValue & (SQL_OJ_FULL|SQL_OJ_LEFT|SQL_OJ_RIGHT|SQL_OJ_NESTED|SQL_OJ_NOT_ORDERED|SQL_OJ_ALL_COMPARISON_OPS|SQL_OJ_INNER)) != 0);
730*cdf0e10cSrcweir }
731*cdf0e10cSrcweir // -------------------------------------------------------------------------
732*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTableTypes(  ) throw(SQLException, RuntimeException)
733*cdf0e10cSrcweir {
734*cdf0e10cSrcweir 
735*cdf0e10cSrcweir 	// there exists no possibility to get table types so we have to check
736*cdf0e10cSrcweir 	static ::rtl::OUString sTableTypes[] =
737*cdf0e10cSrcweir 	{
738*cdf0e10cSrcweir 		::rtl::OUString::createFromAscii("TABLE"),
739*cdf0e10cSrcweir 		::rtl::OUString::createFromAscii("VIEW"),
740*cdf0e10cSrcweir 		::rtl::OUString::createFromAscii("SYSTEM TABLE"),
741*cdf0e10cSrcweir 		::rtl::OUString::createFromAscii("GLOBAL TEMPORARY"),
742*cdf0e10cSrcweir 		::rtl::OUString::createFromAscii("LOCAL TEMPORARY"),
743*cdf0e10cSrcweir 		::rtl::OUString::createFromAscii("ALIAS"),
744*cdf0e10cSrcweir 		::rtl::OUString::createFromAscii("SYNONYM")
745*cdf0e10cSrcweir 	};
746*cdf0e10cSrcweir 	sal_Int32  nSize = sizeof(sTableTypes) / sizeof(::rtl::OUString);
747*cdf0e10cSrcweir 	::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTableTypes);
748*cdf0e10cSrcweir     Reference< XResultSet > xRef = pResult;
749*cdf0e10cSrcweir 	SQLUINTEGER nValue = 0;
750*cdf0e10cSrcweir 	try
751*cdf0e10cSrcweir 	{
752*cdf0e10cSrcweir 		OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CREATE_VIEW,nValue,*this);
753*cdf0e10cSrcweir 	}
754*cdf0e10cSrcweir 	catch(const Exception&)
755*cdf0e10cSrcweir 	{
756*cdf0e10cSrcweir 	}
757*cdf0e10cSrcweir 	sal_Bool bViewsSupported = (nValue & SQL_CV_CREATE_VIEW) == SQL_CV_CREATE_VIEW;
758*cdf0e10cSrcweir 
759*cdf0e10cSrcweir 	::connectivity::ODatabaseMetaDataResultSet::ORows aRows;
760*cdf0e10cSrcweir 	for(sal_Int32 i=0;i < nSize;++i)
761*cdf0e10cSrcweir 	{
762*cdf0e10cSrcweir 		if( !bViewsSupported && i == 1)
763*cdf0e10cSrcweir 			continue; // no views supported
764*cdf0e10cSrcweir 		::connectivity::ODatabaseMetaDataResultSet::ORow aRow;
765*cdf0e10cSrcweir 		aRow.push_back(::connectivity::ODatabaseMetaDataResultSet::getEmptyValue());
766*cdf0e10cSrcweir 		aRow.push_back(new ::connectivity::ORowSetValueDecorator(sTableTypes[i]));
767*cdf0e10cSrcweir 		aRows.push_back(aRow);
768*cdf0e10cSrcweir 	}
769*cdf0e10cSrcweir 	pResult->setRows(aRows);
770*cdf0e10cSrcweir 	 return xRef;
771*cdf0e10cSrcweir }
772*cdf0e10cSrcweir // -------------------------------------------------------------------------
773*cdf0e10cSrcweir sal_Int32 ODatabaseMetaData::impl_getMaxStatements_throw(  )
774*cdf0e10cSrcweir {
775*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
776*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_CONCURRENT_ACTIVITIES,nValue,*this);
777*cdf0e10cSrcweir 	return nValue;
778*cdf0e10cSrcweir }
779*cdf0e10cSrcweir // -------------------------------------------------------------------------
780*cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxProcedureNameLength(  ) throw(SQLException, RuntimeException)
781*cdf0e10cSrcweir {
782*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
783*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_PROCEDURE_NAME_LEN,nValue,*this);
784*cdf0e10cSrcweir 	return nValue;
785*cdf0e10cSrcweir }
786*cdf0e10cSrcweir // -------------------------------------------------------------------------
787*cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxSchemaNameLength(  ) throw(SQLException, RuntimeException)
788*cdf0e10cSrcweir {
789*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
790*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_SCHEMA_NAME_LEN,nValue,*this);
791*cdf0e10cSrcweir 	return nValue;
792*cdf0e10cSrcweir }
793*cdf0e10cSrcweir // -------------------------------------------------------------------------
794*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactions(  ) throw(SQLException, RuntimeException)
795*cdf0e10cSrcweir {
796*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
797*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TXN_CAPABLE,nValue,*this);
798*cdf0e10cSrcweir 	return nValue != SQL_TC_NONE;
799*cdf0e10cSrcweir }
800*cdf0e10cSrcweir // -------------------------------------------------------------------------
801*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::allProceduresAreCallable(  ) throw(SQLException, RuntimeException)
802*cdf0e10cSrcweir {
803*cdf0e10cSrcweir 	::rtl::OUString aValue;
804*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ACCESSIBLE_PROCEDURES,aValue,*this,m_pConnection->getTextEncoding());
805*cdf0e10cSrcweir 	return aValue.toChar() == 'Y';
806*cdf0e10cSrcweir }
807*cdf0e10cSrcweir // -------------------------------------------------------------------------
808*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsStoredProcedures(  ) throw(SQLException, RuntimeException)
809*cdf0e10cSrcweir {
810*cdf0e10cSrcweir 	::rtl::OUString aValue;
811*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_PROCEDURES,aValue,*this,m_pConnection->getTextEncoding());
812*cdf0e10cSrcweir 	return aValue.toChar() == 'Y';
813*cdf0e10cSrcweir }
814*cdf0e10cSrcweir // -------------------------------------------------------------------------
815*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsSelectForUpdate(  ) throw(SQLException, RuntimeException)
816*cdf0e10cSrcweir {
817*cdf0e10cSrcweir 	SQLUINTEGER nValue;
818*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DYNAMIC_CURSOR_ATTRIBUTES1,nValue,*this);
819*cdf0e10cSrcweir 	return (nValue & SQL_CA1_POSITIONED_UPDATE) == SQL_CA1_POSITIONED_UPDATE;
820*cdf0e10cSrcweir }
821*cdf0e10cSrcweir // -------------------------------------------------------------------------
822*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::allTablesAreSelectable(  ) throw(SQLException, RuntimeException)
823*cdf0e10cSrcweir {
824*cdf0e10cSrcweir 	::rtl::OUString aValue;
825*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ACCESSIBLE_TABLES,aValue,*this,m_pConnection->getTextEncoding());
826*cdf0e10cSrcweir 	return aValue.toChar() == 'Y';
827*cdf0e10cSrcweir }
828*cdf0e10cSrcweir // -------------------------------------------------------------------------
829*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::isReadOnly(  ) throw(SQLException, RuntimeException)
830*cdf0e10cSrcweir {
831*cdf0e10cSrcweir 	return m_pConnection->isReadOnly();
832*cdf0e10cSrcweir }
833*cdf0e10cSrcweir // -------------------------------------------------------------------------
834*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFiles(  ) throw(SQLException, RuntimeException)
835*cdf0e10cSrcweir {
836*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
837*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_FILE_USAGE,nValue,*this);
838*cdf0e10cSrcweir 	return nValue == SQL_FILE_CATALOG;
839*cdf0e10cSrcweir }
840*cdf0e10cSrcweir // -------------------------------------------------------------------------
841*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::usesLocalFilePerTable(  ) throw(SQLException, RuntimeException)
842*cdf0e10cSrcweir {
843*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
844*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_FILE_USAGE,nValue,*this);
845*cdf0e10cSrcweir 	return nValue == SQL_FILE_TABLE;
846*cdf0e10cSrcweir }
847*cdf0e10cSrcweir // -------------------------------------------------------------------------
848*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsTypeConversion(  ) throw(SQLException, RuntimeException)
849*cdf0e10cSrcweir {
850*cdf0e10cSrcweir 	SQLUINTEGER nValue;
851*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_FUNCTIONS,nValue,*this);
852*cdf0e10cSrcweir 	return (nValue & SQL_FN_CVT_CONVERT) == SQL_FN_CVT_CONVERT;
853*cdf0e10cSrcweir }
854*cdf0e10cSrcweir // -------------------------------------------------------------------------
855*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::nullPlusNonNullIsNull(  ) throw(SQLException, RuntimeException)
856*cdf0e10cSrcweir {
857*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
858*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONCAT_NULL_BEHAVIOR,nValue,*this);
859*cdf0e10cSrcweir 	return nValue == SQL_CB_NULL;
860*cdf0e10cSrcweir }
861*cdf0e10cSrcweir // -------------------------------------------------------------------------
862*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsColumnAliasing(  ) throw(SQLException, RuntimeException)
863*cdf0e10cSrcweir {
864*cdf0e10cSrcweir 	::rtl::OUString aValue;
865*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_COLUMN_ALIAS,aValue,*this,m_pConnection->getTextEncoding());
866*cdf0e10cSrcweir 	return aValue.toChar() == 'Y';
867*cdf0e10cSrcweir }
868*cdf0e10cSrcweir // -------------------------------------------------------------------------
869*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsTableCorrelationNames(  ) throw(SQLException, RuntimeException)
870*cdf0e10cSrcweir {
871*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
872*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
873*cdf0e10cSrcweir 	return nValue != SQL_CN_NONE;
874*cdf0e10cSrcweir }
875*cdf0e10cSrcweir // -------------------------------------------------------------------------
876*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsConvert( sal_Int32 fromType, sal_Int32 toType ) throw(SQLException, RuntimeException)
877*cdf0e10cSrcweir {
878*cdf0e10cSrcweir 	if(fromType == toType)
879*cdf0e10cSrcweir 		return sal_True;
880*cdf0e10cSrcweir 
881*cdf0e10cSrcweir 	SQLUINTEGER nValue=0;
882*cdf0e10cSrcweir 	switch(fromType)
883*cdf0e10cSrcweir 	{
884*cdf0e10cSrcweir 		case DataType::BIT:
885*cdf0e10cSrcweir 			OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_BIT,nValue,*this);
886*cdf0e10cSrcweir 			break;
887*cdf0e10cSrcweir 		case DataType::TINYINT:
888*cdf0e10cSrcweir 			OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_TINYINT,nValue,*this);
889*cdf0e10cSrcweir 			break;
890*cdf0e10cSrcweir 		case DataType::SMALLINT:
891*cdf0e10cSrcweir 			OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_SMALLINT,nValue,*this);
892*cdf0e10cSrcweir 			break;
893*cdf0e10cSrcweir 		case DataType::INTEGER:
894*cdf0e10cSrcweir 			OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_INTEGER,nValue,*this);
895*cdf0e10cSrcweir 			break;
896*cdf0e10cSrcweir 		case DataType::BIGINT:
897*cdf0e10cSrcweir 			OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_BIGINT,nValue,*this);
898*cdf0e10cSrcweir 			break;
899*cdf0e10cSrcweir 		case DataType::FLOAT:
900*cdf0e10cSrcweir 			OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_FLOAT,nValue,*this);
901*cdf0e10cSrcweir 			break;
902*cdf0e10cSrcweir 		case DataType::REAL:
903*cdf0e10cSrcweir 			OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_REAL,nValue,*this);
904*cdf0e10cSrcweir 			break;
905*cdf0e10cSrcweir 		case DataType::DOUBLE:
906*cdf0e10cSrcweir 			OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_DOUBLE,nValue,*this);
907*cdf0e10cSrcweir 			break;
908*cdf0e10cSrcweir 		case DataType::NUMERIC:
909*cdf0e10cSrcweir 			OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_NUMERIC,nValue,*this);
910*cdf0e10cSrcweir 			break;
911*cdf0e10cSrcweir 		case DataType::DECIMAL:
912*cdf0e10cSrcweir 			OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_DECIMAL,nValue,*this);
913*cdf0e10cSrcweir 			break;
914*cdf0e10cSrcweir 		case DataType::CHAR:
915*cdf0e10cSrcweir 			OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_CHAR,nValue,*this);
916*cdf0e10cSrcweir 			break;
917*cdf0e10cSrcweir 		case DataType::VARCHAR:
918*cdf0e10cSrcweir 			OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_VARCHAR,nValue,*this);
919*cdf0e10cSrcweir 			break;
920*cdf0e10cSrcweir 		case DataType::LONGVARCHAR:
921*cdf0e10cSrcweir 		case DataType::CLOB:
922*cdf0e10cSrcweir 			OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_LONGVARCHAR,nValue,*this);
923*cdf0e10cSrcweir 			break;
924*cdf0e10cSrcweir 		case DataType::DATE:
925*cdf0e10cSrcweir 			OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_DATE,nValue,*this);
926*cdf0e10cSrcweir 			break;
927*cdf0e10cSrcweir 		case DataType::TIME:
928*cdf0e10cSrcweir 			OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_TIME,nValue,*this);
929*cdf0e10cSrcweir 			break;
930*cdf0e10cSrcweir 		case DataType::TIMESTAMP:
931*cdf0e10cSrcweir 			OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_TIMESTAMP,nValue,*this);
932*cdf0e10cSrcweir 			break;
933*cdf0e10cSrcweir 		case DataType::BINARY:
934*cdf0e10cSrcweir 			OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_BINARY,nValue,*this);
935*cdf0e10cSrcweir 			break;
936*cdf0e10cSrcweir 		case DataType::VARBINARY:
937*cdf0e10cSrcweir 			OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_VARBINARY,nValue,*this);
938*cdf0e10cSrcweir 			break;
939*cdf0e10cSrcweir 		case DataType::LONGVARBINARY:
940*cdf0e10cSrcweir 		case DataType::BLOB:
941*cdf0e10cSrcweir 			OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CONVERT_LONGVARBINARY,nValue,*this);
942*cdf0e10cSrcweir 			break;
943*cdf0e10cSrcweir 		case DataType::SQLNULL:
944*cdf0e10cSrcweir 			//	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
945*cdf0e10cSrcweir 			break;
946*cdf0e10cSrcweir 		case DataType::OTHER:
947*cdf0e10cSrcweir 			//	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
948*cdf0e10cSrcweir 			break;
949*cdf0e10cSrcweir 		case DataType::OBJECT:
950*cdf0e10cSrcweir 			//	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
951*cdf0e10cSrcweir 			break;
952*cdf0e10cSrcweir 		case DataType::DISTINCT:
953*cdf0e10cSrcweir 			//	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
954*cdf0e10cSrcweir 			break;
955*cdf0e10cSrcweir 		case DataType::STRUCT:
956*cdf0e10cSrcweir 			//	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
957*cdf0e10cSrcweir 			break;
958*cdf0e10cSrcweir 		case DataType::ARRAY:
959*cdf0e10cSrcweir 			//	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
960*cdf0e10cSrcweir 			break;
961*cdf0e10cSrcweir 		case DataType::REF:
962*cdf0e10cSrcweir 			//	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CORRELATION_NAME,nValue,*this);
963*cdf0e10cSrcweir 			break;
964*cdf0e10cSrcweir 	}
965*cdf0e10cSrcweir 	sal_Bool bConvert = sal_False;
966*cdf0e10cSrcweir 	switch(toType)
967*cdf0e10cSrcweir 	{
968*cdf0e10cSrcweir 		case DataType::BIT:
969*cdf0e10cSrcweir 			bConvert = (nValue & SQL_CVT_BIT) == SQL_CVT_BIT;
970*cdf0e10cSrcweir 			break;
971*cdf0e10cSrcweir 		case DataType::TINYINT:
972*cdf0e10cSrcweir 			bConvert = (nValue & SQL_CVT_TINYINT) == SQL_CVT_TINYINT;
973*cdf0e10cSrcweir 			break;
974*cdf0e10cSrcweir 		case DataType::SMALLINT:
975*cdf0e10cSrcweir 			bConvert = (nValue & SQL_CVT_SMALLINT) == SQL_CVT_SMALLINT;
976*cdf0e10cSrcweir 			break;
977*cdf0e10cSrcweir 		case DataType::INTEGER:
978*cdf0e10cSrcweir 			bConvert = (nValue & SQL_CVT_INTEGER) == SQL_CVT_INTEGER;
979*cdf0e10cSrcweir 			break;
980*cdf0e10cSrcweir 		case DataType::BIGINT:
981*cdf0e10cSrcweir 			bConvert = (nValue & SQL_CVT_BIGINT) == SQL_CVT_BIGINT;
982*cdf0e10cSrcweir 			break;
983*cdf0e10cSrcweir 		case DataType::FLOAT:
984*cdf0e10cSrcweir 			bConvert = (nValue & SQL_CVT_FLOAT) == SQL_CVT_FLOAT;
985*cdf0e10cSrcweir 			break;
986*cdf0e10cSrcweir 		case DataType::REAL:
987*cdf0e10cSrcweir 			bConvert = (nValue & SQL_CVT_REAL) == SQL_CVT_REAL;
988*cdf0e10cSrcweir 			break;
989*cdf0e10cSrcweir 		case DataType::DOUBLE:
990*cdf0e10cSrcweir 			bConvert = (nValue & SQL_CVT_DOUBLE) == SQL_CVT_DOUBLE;
991*cdf0e10cSrcweir 			break;
992*cdf0e10cSrcweir 		case DataType::NUMERIC:
993*cdf0e10cSrcweir 			bConvert = (nValue & SQL_CVT_NUMERIC) == SQL_CVT_NUMERIC;
994*cdf0e10cSrcweir 			break;
995*cdf0e10cSrcweir 		case DataType::DECIMAL:
996*cdf0e10cSrcweir 			bConvert = (nValue & SQL_CVT_DECIMAL) == SQL_CVT_DECIMAL;
997*cdf0e10cSrcweir 			break;
998*cdf0e10cSrcweir 		case DataType::CHAR:
999*cdf0e10cSrcweir 			bConvert = (nValue & SQL_CVT_CHAR) == SQL_CVT_CHAR;
1000*cdf0e10cSrcweir 			break;
1001*cdf0e10cSrcweir 		case DataType::VARCHAR:
1002*cdf0e10cSrcweir 			bConvert = (nValue & SQL_CVT_VARCHAR) == SQL_CVT_VARCHAR;
1003*cdf0e10cSrcweir 			break;
1004*cdf0e10cSrcweir 		case DataType::LONGVARCHAR:
1005*cdf0e10cSrcweir 		case DataType::CLOB:
1006*cdf0e10cSrcweir 			bConvert = (nValue & SQL_CVT_LONGVARCHAR) == SQL_CVT_LONGVARCHAR;
1007*cdf0e10cSrcweir 			break;
1008*cdf0e10cSrcweir 		case DataType::DATE:
1009*cdf0e10cSrcweir 			bConvert = (nValue & SQL_CVT_DATE) == SQL_CVT_DATE;
1010*cdf0e10cSrcweir 			break;
1011*cdf0e10cSrcweir 		case DataType::TIME:
1012*cdf0e10cSrcweir 			bConvert = (nValue & SQL_CVT_TIME) == SQL_CVT_TIME;
1013*cdf0e10cSrcweir 			break;
1014*cdf0e10cSrcweir 		case DataType::TIMESTAMP:
1015*cdf0e10cSrcweir 			bConvert = (nValue & SQL_CVT_TIMESTAMP) == SQL_CVT_TIMESTAMP;
1016*cdf0e10cSrcweir 			break;
1017*cdf0e10cSrcweir 		case DataType::BINARY:
1018*cdf0e10cSrcweir 			bConvert = (nValue & SQL_CVT_BINARY) == SQL_CVT_BINARY;
1019*cdf0e10cSrcweir 			break;
1020*cdf0e10cSrcweir 		case DataType::VARBINARY:
1021*cdf0e10cSrcweir 			bConvert = (nValue & SQL_CVT_VARBINARY) == SQL_CVT_VARBINARY;
1022*cdf0e10cSrcweir 			break;
1023*cdf0e10cSrcweir 		case DataType::LONGVARBINARY:
1024*cdf0e10cSrcweir 		case DataType::BLOB:
1025*cdf0e10cSrcweir 			bConvert = (nValue & SQL_CVT_LONGVARBINARY) == SQL_CVT_LONGVARBINARY;
1026*cdf0e10cSrcweir 			break;
1027*cdf0e10cSrcweir 	}
1028*cdf0e10cSrcweir 
1029*cdf0e10cSrcweir 	return bConvert;
1030*cdf0e10cSrcweir }
1031*cdf0e10cSrcweir // -------------------------------------------------------------------------
1032*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsExpressionsInOrderBy(  ) throw(SQLException, RuntimeException)
1033*cdf0e10cSrcweir {
1034*cdf0e10cSrcweir 	::rtl::OUString aValue;
1035*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_EXPRESSIONS_IN_ORDERBY,aValue,*this,m_pConnection->getTextEncoding());
1036*cdf0e10cSrcweir 	return aValue.toChar() == 'Y';
1037*cdf0e10cSrcweir }
1038*cdf0e10cSrcweir // -------------------------------------------------------------------------
1039*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupBy(  ) throw(SQLException, RuntimeException)
1040*cdf0e10cSrcweir {
1041*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
1042*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_GROUP_BY,nValue,*this);
1043*cdf0e10cSrcweir 	return nValue != SQL_GB_NOT_SUPPORTED;
1044*cdf0e10cSrcweir }
1045*cdf0e10cSrcweir // -------------------------------------------------------------------------
1046*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByBeyondSelect(  ) throw(SQLException, RuntimeException)
1047*cdf0e10cSrcweir {
1048*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
1049*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_GROUP_BY,nValue,*this);
1050*cdf0e10cSrcweir 	return nValue != SQL_GB_GROUP_BY_CONTAINS_SELECT;
1051*cdf0e10cSrcweir }
1052*cdf0e10cSrcweir // -------------------------------------------------------------------------
1053*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsGroupByUnrelated(  ) throw(SQLException, RuntimeException)
1054*cdf0e10cSrcweir {
1055*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
1056*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_GROUP_BY,nValue,*this);
1057*cdf0e10cSrcweir 	return nValue == SQL_GB_NO_RELATION;
1058*cdf0e10cSrcweir }
1059*cdf0e10cSrcweir // -------------------------------------------------------------------------
1060*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleTransactions(  ) throw(SQLException, RuntimeException)
1061*cdf0e10cSrcweir {
1062*cdf0e10cSrcweir 	::rtl::OUString aValue;
1063*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MULTIPLE_ACTIVE_TXN,aValue,*this,m_pConnection->getTextEncoding());
1064*cdf0e10cSrcweir 	return aValue.toChar() == 'Y';
1065*cdf0e10cSrcweir }
1066*cdf0e10cSrcweir // -------------------------------------------------------------------------
1067*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleResultSets(  ) throw(SQLException, RuntimeException)
1068*cdf0e10cSrcweir {
1069*cdf0e10cSrcweir 	::rtl::OUString aValue;
1070*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MULT_RESULT_SETS,aValue,*this,m_pConnection->getTextEncoding());
1071*cdf0e10cSrcweir 	return aValue.toChar() == 'Y';
1072*cdf0e10cSrcweir }
1073*cdf0e10cSrcweir // -------------------------------------------------------------------------
1074*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsLikeEscapeClause(  ) throw(SQLException, RuntimeException)
1075*cdf0e10cSrcweir {
1076*cdf0e10cSrcweir 	::rtl::OUString aValue;
1077*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_LIKE_ESCAPE_CLAUSE,aValue,*this,m_pConnection->getTextEncoding());
1078*cdf0e10cSrcweir 	return aValue.toChar() == 'Y';
1079*cdf0e10cSrcweir }
1080*cdf0e10cSrcweir // -------------------------------------------------------------------------
1081*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsOrderByUnrelated(  ) throw(SQLException, RuntimeException)
1082*cdf0e10cSrcweir {
1083*cdf0e10cSrcweir 	::rtl::OUString aValue;
1084*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ORDER_BY_COLUMNS_IN_SELECT,aValue,*this,m_pConnection->getTextEncoding());
1085*cdf0e10cSrcweir 	return aValue.toChar() == 'N';
1086*cdf0e10cSrcweir }
1087*cdf0e10cSrcweir // -------------------------------------------------------------------------
1088*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsUnion(  ) throw(SQLException, RuntimeException)
1089*cdf0e10cSrcweir {
1090*cdf0e10cSrcweir 	SQLUINTEGER nValue;
1091*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_UNION,nValue,*this);
1092*cdf0e10cSrcweir 	return (nValue & SQL_U_UNION) == SQL_U_UNION;
1093*cdf0e10cSrcweir }
1094*cdf0e10cSrcweir // -------------------------------------------------------------------------
1095*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsUnionAll(  ) throw(SQLException, RuntimeException)
1096*cdf0e10cSrcweir {
1097*cdf0e10cSrcweir 	SQLUINTEGER nValue;
1098*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_UNION,nValue,*this);
1099*cdf0e10cSrcweir 	return (nValue & SQL_U_UNION_ALL) == SQL_U_UNION_ALL;
1100*cdf0e10cSrcweir }
1101*cdf0e10cSrcweir // -------------------------------------------------------------------------
1102*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsMixedCaseIdentifiers(  ) throw(SQLException, RuntimeException)
1103*cdf0e10cSrcweir {
1104*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
1105*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_IDENTIFIER_CASE,nValue,*this);
1106*cdf0e10cSrcweir 	return nValue == SQL_IC_MIXED;
1107*cdf0e10cSrcweir }
1108*cdf0e10cSrcweir // -------------------------------------------------------------------------
1109*cdf0e10cSrcweir sal_Bool ODatabaseMetaData::impl_supportsMixedCaseQuotedIdentifiers_throw(  )
1110*cdf0e10cSrcweir {
1111*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
1112*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_QUOTED_IDENTIFIER_CASE,nValue,*this);
1113*cdf0e10cSrcweir 	return nValue == SQL_IC_MIXED;
1114*cdf0e10cSrcweir }
1115*cdf0e10cSrcweir // -------------------------------------------------------------------------
1116*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtEnd(  ) throw(SQLException, RuntimeException)
1117*cdf0e10cSrcweir {
1118*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
1119*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NULL_COLLATION,nValue,*this);
1120*cdf0e10cSrcweir 	return nValue == SQL_NC_END;
1121*cdf0e10cSrcweir }
1122*cdf0e10cSrcweir // -------------------------------------------------------------------------
1123*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedAtStart(  ) throw(SQLException, RuntimeException)
1124*cdf0e10cSrcweir {
1125*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
1126*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NULL_COLLATION,nValue,*this);
1127*cdf0e10cSrcweir 	return nValue == SQL_NC_START;
1128*cdf0e10cSrcweir }
1129*cdf0e10cSrcweir // -------------------------------------------------------------------------
1130*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedHigh(  ) throw(SQLException, RuntimeException)
1131*cdf0e10cSrcweir {
1132*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
1133*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NULL_COLLATION,nValue,*this);
1134*cdf0e10cSrcweir 	return nValue == SQL_NC_HIGH;
1135*cdf0e10cSrcweir }
1136*cdf0e10cSrcweir // -------------------------------------------------------------------------
1137*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::nullsAreSortedLow(  ) throw(SQLException, RuntimeException)
1138*cdf0e10cSrcweir {
1139*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
1140*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NULL_COLLATION,nValue,*this);
1141*cdf0e10cSrcweir 	return nValue == SQL_NC_LOW;
1142*cdf0e10cSrcweir }
1143*cdf0e10cSrcweir // -------------------------------------------------------------------------
1144*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInProcedureCalls(  ) throw(SQLException, RuntimeException)
1145*cdf0e10cSrcweir {
1146*cdf0e10cSrcweir 	SQLUINTEGER nValue;
1147*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this);
1148*cdf0e10cSrcweir 	return (nValue & SQL_SU_PROCEDURE_INVOCATION) == SQL_SU_PROCEDURE_INVOCATION;
1149*cdf0e10cSrcweir }
1150*cdf0e10cSrcweir // -------------------------------------------------------------------------
1151*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsSchemasInPrivilegeDefinitions(  ) throw(SQLException, RuntimeException)
1152*cdf0e10cSrcweir {
1153*cdf0e10cSrcweir 	SQLUINTEGER nValue;
1154*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_USAGE,nValue,*this);
1155*cdf0e10cSrcweir 	return (nValue & SQL_SU_PRIVILEGE_DEFINITION) == SQL_SU_PRIVILEGE_DEFINITION;
1156*cdf0e10cSrcweir }
1157*cdf0e10cSrcweir // -------------------------------------------------------------------------
1158*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInProcedureCalls(  ) throw(SQLException, RuntimeException)
1159*cdf0e10cSrcweir {
1160*cdf0e10cSrcweir 	SQLUINTEGER nValue=0;
1161*cdf0e10cSrcweir 	if(m_bUseCatalog)
1162*cdf0e10cSrcweir 		OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this);
1163*cdf0e10cSrcweir 	return (nValue & SQL_CU_PROCEDURE_INVOCATION) == SQL_CU_PROCEDURE_INVOCATION;
1164*cdf0e10cSrcweir }
1165*cdf0e10cSrcweir // -------------------------------------------------------------------------
1166*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsCatalogsInPrivilegeDefinitions(  ) throw(SQLException, RuntimeException)
1167*cdf0e10cSrcweir {
1168*cdf0e10cSrcweir 	SQLUINTEGER nValue=0;
1169*cdf0e10cSrcweir 	if(m_bUseCatalog)
1170*cdf0e10cSrcweir 		OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CATALOG_USAGE,nValue,*this);
1171*cdf0e10cSrcweir 	return (nValue & SQL_CU_PRIVILEGE_DEFINITION) == SQL_CU_PRIVILEGE_DEFINITION;
1172*cdf0e10cSrcweir }
1173*cdf0e10cSrcweir // -------------------------------------------------------------------------
1174*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsCorrelatedSubqueries(  ) throw(SQLException, RuntimeException)
1175*cdf0e10cSrcweir {
1176*cdf0e10cSrcweir 	SQLUINTEGER nValue;
1177*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
1178*cdf0e10cSrcweir 	return (nValue & SQL_SQ_CORRELATED_SUBQUERIES) == SQL_SQ_CORRELATED_SUBQUERIES;
1179*cdf0e10cSrcweir }
1180*cdf0e10cSrcweir // -------------------------------------------------------------------------
1181*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInComparisons(  ) throw(SQLException, RuntimeException)
1182*cdf0e10cSrcweir {
1183*cdf0e10cSrcweir 	SQLUINTEGER nValue;
1184*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
1185*cdf0e10cSrcweir 	return (nValue & SQL_SQ_COMPARISON) == SQL_SQ_COMPARISON;
1186*cdf0e10cSrcweir }
1187*cdf0e10cSrcweir // -------------------------------------------------------------------------
1188*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInExists(  ) throw(SQLException, RuntimeException)
1189*cdf0e10cSrcweir {
1190*cdf0e10cSrcweir 	SQLUINTEGER nValue;
1191*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
1192*cdf0e10cSrcweir 	return (nValue & SQL_SQ_EXISTS) == SQL_SQ_EXISTS;
1193*cdf0e10cSrcweir }
1194*cdf0e10cSrcweir // -------------------------------------------------------------------------
1195*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInIns(  ) throw(SQLException, RuntimeException)
1196*cdf0e10cSrcweir {
1197*cdf0e10cSrcweir 	SQLUINTEGER nValue;
1198*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
1199*cdf0e10cSrcweir 	return (nValue & SQL_SQ_IN) == SQL_SQ_IN;
1200*cdf0e10cSrcweir }
1201*cdf0e10cSrcweir // -------------------------------------------------------------------------
1202*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsSubqueriesInQuantifieds(  ) throw(SQLException, RuntimeException)
1203*cdf0e10cSrcweir {
1204*cdf0e10cSrcweir 	SQLUINTEGER nValue;
1205*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
1206*cdf0e10cSrcweir 	return (nValue & SQL_SQ_QUANTIFIED) == SQL_SQ_QUANTIFIED;
1207*cdf0e10cSrcweir }
1208*cdf0e10cSrcweir // -------------------------------------------------------------------------
1209*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsANSI92IntermediateSQL(  ) throw(SQLException, RuntimeException)
1210*cdf0e10cSrcweir {
1211*cdf0e10cSrcweir 	SQLUINTEGER nValue;
1212*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SQL_CONFORMANCE,nValue,*this);
1213*cdf0e10cSrcweir 	return nValue == SQL_SC_SQL92_INTERMEDIATE;
1214*cdf0e10cSrcweir }
1215*cdf0e10cSrcweir // -----------------------------------------------------------------------------
1216*cdf0e10cSrcweir ::rtl::OUString ODatabaseMetaData::getURLImpl()
1217*cdf0e10cSrcweir {
1218*cdf0e10cSrcweir 	::rtl::OUString aValue;
1219*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DATA_SOURCE_NAME,aValue,*this,m_pConnection->getTextEncoding());
1220*cdf0e10cSrcweir 	return aValue;
1221*cdf0e10cSrcweir }
1222*cdf0e10cSrcweir // -------------------------------------------------------------------------
1223*cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getURL(  ) throw(SQLException, RuntimeException)
1224*cdf0e10cSrcweir {
1225*cdf0e10cSrcweir 	::rtl::OUString aValue = m_pConnection->getURL();
1226*cdf0e10cSrcweir 	if ( !aValue.getLength() )
1227*cdf0e10cSrcweir 	{
1228*cdf0e10cSrcweir 		aValue = ::rtl::OUString::createFromAscii("sdbc:odbc:");
1229*cdf0e10cSrcweir 		aValue += getURLImpl();
1230*cdf0e10cSrcweir 	}
1231*cdf0e10cSrcweir 	return aValue;
1232*cdf0e10cSrcweir }
1233*cdf0e10cSrcweir // -------------------------------------------------------------------------
1234*cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getUserName(  ) throw(SQLException, RuntimeException)
1235*cdf0e10cSrcweir {
1236*cdf0e10cSrcweir 	::rtl::OUString aValue;
1237*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_USER_NAME,aValue,*this,m_pConnection->getTextEncoding());
1238*cdf0e10cSrcweir 	return aValue;
1239*cdf0e10cSrcweir }
1240*cdf0e10cSrcweir // -------------------------------------------------------------------------
1241*cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getDriverName(  ) throw(SQLException, RuntimeException)
1242*cdf0e10cSrcweir {
1243*cdf0e10cSrcweir 	::rtl::OUString aValue;
1244*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_NAME,aValue,*this,m_pConnection->getTextEncoding());
1245*cdf0e10cSrcweir 	return aValue;
1246*cdf0e10cSrcweir }
1247*cdf0e10cSrcweir // -------------------------------------------------------------------------
1248*cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getDriverVersion() throw(SQLException, RuntimeException)
1249*cdf0e10cSrcweir {
1250*cdf0e10cSrcweir 	::rtl::OUString aValue;
1251*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_ODBC_VER,aValue,*this,m_pConnection->getTextEncoding());
1252*cdf0e10cSrcweir 	return aValue;
1253*cdf0e10cSrcweir }
1254*cdf0e10cSrcweir // -------------------------------------------------------------------------
1255*cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getDatabaseProductVersion(  ) throw(SQLException, RuntimeException)
1256*cdf0e10cSrcweir {
1257*cdf0e10cSrcweir 	::rtl::OUString aValue;
1258*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_VER,aValue,*this,m_pConnection->getTextEncoding());
1259*cdf0e10cSrcweir 	return aValue;
1260*cdf0e10cSrcweir }
1261*cdf0e10cSrcweir // -------------------------------------------------------------------------
1262*cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getDatabaseProductName(  ) throw(SQLException, RuntimeException)
1263*cdf0e10cSrcweir {
1264*cdf0e10cSrcweir 	::rtl::OUString aValue;
1265*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DBMS_NAME,aValue,*this,m_pConnection->getTextEncoding());
1266*cdf0e10cSrcweir 	return aValue;
1267*cdf0e10cSrcweir }
1268*cdf0e10cSrcweir // -------------------------------------------------------------------------
1269*cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getProcedureTerm(  ) throw(SQLException, RuntimeException)
1270*cdf0e10cSrcweir {
1271*cdf0e10cSrcweir 	::rtl::OUString aValue;
1272*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_PROCEDURE_TERM,aValue,*this,m_pConnection->getTextEncoding());
1273*cdf0e10cSrcweir 	return aValue;
1274*cdf0e10cSrcweir }
1275*cdf0e10cSrcweir // -------------------------------------------------------------------------
1276*cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getSchemaTerm(  ) throw(SQLException, RuntimeException)
1277*cdf0e10cSrcweir {
1278*cdf0e10cSrcweir 	::rtl::OUString aValue;
1279*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SCHEMA_TERM,aValue,*this,m_pConnection->getTextEncoding());
1280*cdf0e10cSrcweir 	return aValue;
1281*cdf0e10cSrcweir }
1282*cdf0e10cSrcweir // -------------------------------------------------------------------------
1283*cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMajorVersion(  ) throw(RuntimeException)
1284*cdf0e10cSrcweir {
1285*cdf0e10cSrcweir 	::rtl::OUString aValue;
1286*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_VER,aValue,*this,m_pConnection->getTextEncoding());
1287*cdf0e10cSrcweir 	return aValue.copy(0,aValue.indexOf('.')).toInt32();
1288*cdf0e10cSrcweir }
1289*cdf0e10cSrcweir // -------------------------------------------------------------------------
1290*cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getDefaultTransactionIsolation(  ) throw(SQLException, RuntimeException)
1291*cdf0e10cSrcweir {
1292*cdf0e10cSrcweir 	SQLUINTEGER nValue;
1293*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
1294*cdf0e10cSrcweir 	return nValue;
1295*cdf0e10cSrcweir }
1296*cdf0e10cSrcweir // -------------------------------------------------------------------------
1297*cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion(  ) throw(RuntimeException)
1298*cdf0e10cSrcweir {
1299*cdf0e10cSrcweir 	::rtl::OUString aValue;
1300*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_VER,aValue,*this,m_pConnection->getTextEncoding());
1301*cdf0e10cSrcweir 	return aValue.copy(0,aValue.lastIndexOf('.')).toInt32();
1302*cdf0e10cSrcweir }
1303*cdf0e10cSrcweir // -------------------------------------------------------------------------
1304*cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getSQLKeywords(  ) throw(SQLException, RuntimeException)
1305*cdf0e10cSrcweir {
1306*cdf0e10cSrcweir 	::rtl::OUString aValue;
1307*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_KEYWORDS,aValue,*this,m_pConnection->getTextEncoding());
1308*cdf0e10cSrcweir 	return aValue;
1309*cdf0e10cSrcweir }
1310*cdf0e10cSrcweir // -------------------------------------------------------------------------
1311*cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getSearchStringEscape(  ) throw(SQLException, RuntimeException)
1312*cdf0e10cSrcweir {
1313*cdf0e10cSrcweir 	::rtl::OUString aValue;
1314*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SEARCH_PATTERN_ESCAPE,aValue,*this,m_pConnection->getTextEncoding());
1315*cdf0e10cSrcweir 	return aValue;
1316*cdf0e10cSrcweir }
1317*cdf0e10cSrcweir // -------------------------------------------------------------------------
1318*cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getStringFunctions(  ) throw(SQLException, RuntimeException)
1319*cdf0e10cSrcweir {
1320*cdf0e10cSrcweir 	SQLUINTEGER nValue;
1321*cdf0e10cSrcweir 	::rtl::OUStringBuffer aValue;
1322*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_STRING_FUNCTIONS,nValue,*this);
1323*cdf0e10cSrcweir 	if(nValue & SQL_FN_STR_ASCII)
1324*cdf0e10cSrcweir 		aValue.appendAscii("ASCII,");
1325*cdf0e10cSrcweir 	if(nValue & SQL_FN_STR_BIT_LENGTH)
1326*cdf0e10cSrcweir 		aValue.appendAscii("BIT_LENGTH,");
1327*cdf0e10cSrcweir 	if(nValue & SQL_FN_STR_CHAR)
1328*cdf0e10cSrcweir 		aValue.appendAscii("CHAR,");
1329*cdf0e10cSrcweir 	if(nValue & SQL_FN_STR_CHAR_LENGTH)
1330*cdf0e10cSrcweir 		aValue.appendAscii("CHAR_LENGTH,");
1331*cdf0e10cSrcweir 	if(nValue & SQL_FN_STR_CHARACTER_LENGTH)
1332*cdf0e10cSrcweir 		aValue.appendAscii("CHARACTER_LENGTH,");
1333*cdf0e10cSrcweir 	if(nValue & SQL_FN_STR_CONCAT)
1334*cdf0e10cSrcweir 		aValue.appendAscii("CONCAT,");
1335*cdf0e10cSrcweir 	if(nValue & SQL_FN_STR_DIFFERENCE)
1336*cdf0e10cSrcweir 		aValue.appendAscii("DIFFERENCE,");
1337*cdf0e10cSrcweir 	if(nValue & SQL_FN_STR_INSERT)
1338*cdf0e10cSrcweir 		aValue.appendAscii("INSERT,");
1339*cdf0e10cSrcweir 	if(nValue & SQL_FN_STR_LCASE)
1340*cdf0e10cSrcweir 		aValue.appendAscii("LCASE,");
1341*cdf0e10cSrcweir 	if(nValue & SQL_FN_STR_LEFT)
1342*cdf0e10cSrcweir 		aValue.appendAscii("LEFT,");
1343*cdf0e10cSrcweir 	if(nValue & SQL_FN_STR_LENGTH)
1344*cdf0e10cSrcweir 		aValue.appendAscii("LENGTH,");
1345*cdf0e10cSrcweir 	if(nValue & SQL_FN_STR_LOCATE)
1346*cdf0e10cSrcweir 		aValue.appendAscii("LOCATE,");
1347*cdf0e10cSrcweir 	if(nValue & SQL_FN_STR_LOCATE_2)
1348*cdf0e10cSrcweir 		aValue.appendAscii("LOCATE_2,");
1349*cdf0e10cSrcweir 	if(nValue & SQL_FN_STR_LTRIM)
1350*cdf0e10cSrcweir 		aValue.appendAscii("LTRIM,");
1351*cdf0e10cSrcweir 	if(nValue & SQL_FN_STR_OCTET_LENGTH)
1352*cdf0e10cSrcweir 		aValue.appendAscii("OCTET_LENGTH,");
1353*cdf0e10cSrcweir 	if(nValue & SQL_FN_STR_POSITION)
1354*cdf0e10cSrcweir 		aValue.appendAscii("POSITION,");
1355*cdf0e10cSrcweir 	if(nValue & SQL_FN_STR_REPEAT)
1356*cdf0e10cSrcweir 		aValue.appendAscii("REPEAT,");
1357*cdf0e10cSrcweir 	if(nValue & SQL_FN_STR_REPLACE)
1358*cdf0e10cSrcweir 		aValue.appendAscii("REPLACE,");
1359*cdf0e10cSrcweir 	if(nValue & SQL_FN_STR_RIGHT)
1360*cdf0e10cSrcweir 		aValue.appendAscii("RIGHT,");
1361*cdf0e10cSrcweir 	if(nValue & SQL_FN_STR_RTRIM)
1362*cdf0e10cSrcweir 		aValue.appendAscii("RTRIM,");
1363*cdf0e10cSrcweir 	if(nValue & SQL_FN_STR_SOUNDEX)
1364*cdf0e10cSrcweir 		aValue.appendAscii("SOUNDEX,");
1365*cdf0e10cSrcweir 	if(nValue & SQL_FN_STR_SPACE)
1366*cdf0e10cSrcweir 		aValue.appendAscii("SPACE,");
1367*cdf0e10cSrcweir 	if(nValue & SQL_FN_STR_SUBSTRING)
1368*cdf0e10cSrcweir 		aValue.appendAscii("SUBSTRING,");
1369*cdf0e10cSrcweir 	if(nValue & SQL_FN_STR_UCASE)
1370*cdf0e10cSrcweir 		aValue.appendAscii("UCASE,");
1371*cdf0e10cSrcweir 
1372*cdf0e10cSrcweir 
1373*cdf0e10cSrcweir 	if ( aValue.getLength() )
1374*cdf0e10cSrcweir         aValue.setLength(aValue.getLength()-1);
1375*cdf0e10cSrcweir 
1376*cdf0e10cSrcweir 	return aValue.makeStringAndClear();
1377*cdf0e10cSrcweir }
1378*cdf0e10cSrcweir // -------------------------------------------------------------------------
1379*cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getTimeDateFunctions(  ) throw(SQLException, RuntimeException)
1380*cdf0e10cSrcweir {
1381*cdf0e10cSrcweir 	SQLUINTEGER nValue;
1382*cdf0e10cSrcweir 	::rtl::OUStringBuffer aValue;
1383*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_TIMEDATE_FUNCTIONS,nValue,*this);
1384*cdf0e10cSrcweir 
1385*cdf0e10cSrcweir 	if(nValue & SQL_FN_TD_CURRENT_DATE)
1386*cdf0e10cSrcweir 		aValue.appendAscii("CURRENT_DATE,");
1387*cdf0e10cSrcweir 	if(nValue & SQL_FN_TD_CURRENT_TIME)
1388*cdf0e10cSrcweir 		aValue.appendAscii("CURRENT_TIME,");
1389*cdf0e10cSrcweir 	if(nValue & SQL_FN_TD_CURRENT_TIMESTAMP)
1390*cdf0e10cSrcweir 		aValue.appendAscii("CURRENT_TIMESTAMP,");
1391*cdf0e10cSrcweir 	if(nValue & SQL_FN_TD_CURDATE)
1392*cdf0e10cSrcweir 		aValue.appendAscii("CURDATE,");
1393*cdf0e10cSrcweir 	if(nValue & SQL_FN_TD_CURTIME)
1394*cdf0e10cSrcweir 		aValue.appendAscii("CURTIME,");
1395*cdf0e10cSrcweir 	if(nValue & SQL_FN_TD_DAYNAME)
1396*cdf0e10cSrcweir 		aValue.appendAscii("DAYNAME,");
1397*cdf0e10cSrcweir 	if(nValue & SQL_FN_TD_DAYOFMONTH)
1398*cdf0e10cSrcweir 		aValue.appendAscii("DAYOFMONTH,");
1399*cdf0e10cSrcweir 	if(nValue & SQL_FN_TD_DAYOFWEEK)
1400*cdf0e10cSrcweir 		aValue.appendAscii("DAYOFWEEK,");
1401*cdf0e10cSrcweir 	if(nValue & SQL_FN_TD_DAYOFYEAR)
1402*cdf0e10cSrcweir 		aValue.appendAscii("DAYOFYEAR,");
1403*cdf0e10cSrcweir 	if(nValue & SQL_FN_TD_EXTRACT)
1404*cdf0e10cSrcweir 		aValue.appendAscii("EXTRACT,");
1405*cdf0e10cSrcweir 	if(nValue & SQL_FN_TD_HOUR)
1406*cdf0e10cSrcweir 		aValue.appendAscii("HOUR,");
1407*cdf0e10cSrcweir 	if(nValue & SQL_FN_TD_MINUTE)
1408*cdf0e10cSrcweir 		aValue.appendAscii("MINUTE,");
1409*cdf0e10cSrcweir 	if(nValue & SQL_FN_TD_MONTH)
1410*cdf0e10cSrcweir 		aValue.appendAscii("MONTH,");
1411*cdf0e10cSrcweir 	if(nValue & SQL_FN_TD_MONTHNAME)
1412*cdf0e10cSrcweir 		aValue.appendAscii("MONTHNAME,");
1413*cdf0e10cSrcweir 	if(nValue & SQL_FN_TD_NOW)
1414*cdf0e10cSrcweir 		aValue.appendAscii("NOW,");
1415*cdf0e10cSrcweir 	if(nValue & SQL_FN_TD_QUARTER)
1416*cdf0e10cSrcweir 		aValue.appendAscii("QUARTER,");
1417*cdf0e10cSrcweir 	if(nValue & SQL_FN_TD_SECOND)
1418*cdf0e10cSrcweir 		aValue.appendAscii("SECOND,");
1419*cdf0e10cSrcweir 	if(nValue & SQL_FN_TD_TIMESTAMPADD)
1420*cdf0e10cSrcweir 		aValue.appendAscii("TIMESTAMPADD,");
1421*cdf0e10cSrcweir 	if(nValue & SQL_FN_TD_TIMESTAMPDIFF)
1422*cdf0e10cSrcweir 		aValue.appendAscii("TIMESTAMPDIFF,");
1423*cdf0e10cSrcweir 	if(nValue & SQL_FN_TD_WEEK)
1424*cdf0e10cSrcweir 		aValue.appendAscii("WEEK,");
1425*cdf0e10cSrcweir 	if(nValue & SQL_FN_TD_YEAR)
1426*cdf0e10cSrcweir 		aValue.appendAscii("YEAR,");
1427*cdf0e10cSrcweir 
1428*cdf0e10cSrcweir 	if ( aValue.getLength() )
1429*cdf0e10cSrcweir         aValue.setLength(aValue.getLength()-1);
1430*cdf0e10cSrcweir 
1431*cdf0e10cSrcweir 	return aValue.makeStringAndClear();
1432*cdf0e10cSrcweir }
1433*cdf0e10cSrcweir // -------------------------------------------------------------------------
1434*cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getSystemFunctions(  ) throw(SQLException, RuntimeException)
1435*cdf0e10cSrcweir {
1436*cdf0e10cSrcweir 	SQLUINTEGER nValue;
1437*cdf0e10cSrcweir 	::rtl::OUStringBuffer aValue;
1438*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SYSTEM_FUNCTIONS,nValue,*this);
1439*cdf0e10cSrcweir 
1440*cdf0e10cSrcweir 	if(nValue & SQL_FN_SYS_DBNAME)
1441*cdf0e10cSrcweir 		aValue.appendAscii("DBNAME,");
1442*cdf0e10cSrcweir 	if(nValue & SQL_FN_SYS_IFNULL)
1443*cdf0e10cSrcweir 		aValue.appendAscii("IFNULL,");
1444*cdf0e10cSrcweir 	if(nValue & SQL_FN_SYS_USERNAME)
1445*cdf0e10cSrcweir 		aValue.appendAscii("USERNAME,");
1446*cdf0e10cSrcweir 
1447*cdf0e10cSrcweir     if ( aValue.getLength() )
1448*cdf0e10cSrcweir         aValue.setLength(aValue.getLength()-1);
1449*cdf0e10cSrcweir 
1450*cdf0e10cSrcweir 	return aValue.makeStringAndClear();
1451*cdf0e10cSrcweir }
1452*cdf0e10cSrcweir // -------------------------------------------------------------------------
1453*cdf0e10cSrcweir ::rtl::OUString SAL_CALL ODatabaseMetaData::getNumericFunctions(  ) throw(SQLException, RuntimeException)
1454*cdf0e10cSrcweir {
1455*cdf0e10cSrcweir 	SQLUINTEGER nValue;
1456*cdf0e10cSrcweir 	::rtl::OUStringBuffer aValue;
1457*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_NUMERIC_FUNCTIONS,nValue,*this);
1458*cdf0e10cSrcweir 
1459*cdf0e10cSrcweir 	if(nValue & SQL_FN_NUM_ABS)
1460*cdf0e10cSrcweir 		aValue.appendAscii("ABS,");
1461*cdf0e10cSrcweir 	if(nValue & SQL_FN_NUM_ACOS)
1462*cdf0e10cSrcweir 		aValue.appendAscii("ACOS,");
1463*cdf0e10cSrcweir 	if(nValue & SQL_FN_NUM_ASIN)
1464*cdf0e10cSrcweir 		aValue.appendAscii("ASIN,");
1465*cdf0e10cSrcweir 	if(nValue & SQL_FN_NUM_ATAN)
1466*cdf0e10cSrcweir 		aValue.appendAscii("ATAN,");
1467*cdf0e10cSrcweir 	if(nValue & SQL_FN_NUM_ATAN2)
1468*cdf0e10cSrcweir 		aValue.appendAscii("ATAN2,");
1469*cdf0e10cSrcweir 	if(nValue & SQL_FN_NUM_CEILING)
1470*cdf0e10cSrcweir 		aValue.appendAscii("CEILING,");
1471*cdf0e10cSrcweir 	if(nValue & SQL_FN_NUM_COS)
1472*cdf0e10cSrcweir 		aValue.appendAscii("COS,");
1473*cdf0e10cSrcweir 	if(nValue & SQL_FN_NUM_COT)
1474*cdf0e10cSrcweir 		aValue.appendAscii("COT,");
1475*cdf0e10cSrcweir 	if(nValue & SQL_FN_NUM_DEGREES)
1476*cdf0e10cSrcweir 		aValue.appendAscii("DEGREES,");
1477*cdf0e10cSrcweir 	if(nValue & SQL_FN_NUM_EXP)
1478*cdf0e10cSrcweir 		aValue.appendAscii("EXP,");
1479*cdf0e10cSrcweir 	if(nValue & SQL_FN_NUM_FLOOR)
1480*cdf0e10cSrcweir 		aValue.appendAscii("FLOOR,");
1481*cdf0e10cSrcweir 	if(nValue & SQL_FN_NUM_LOG)
1482*cdf0e10cSrcweir 		aValue.appendAscii("LOGF,");
1483*cdf0e10cSrcweir 	if(nValue & SQL_FN_NUM_LOG10)
1484*cdf0e10cSrcweir 		aValue.appendAscii("LOG10,");
1485*cdf0e10cSrcweir 	if(nValue & SQL_FN_NUM_MOD)
1486*cdf0e10cSrcweir 		aValue.appendAscii("MOD,");
1487*cdf0e10cSrcweir 	if(nValue & SQL_FN_NUM_PI)
1488*cdf0e10cSrcweir 		aValue.appendAscii("PI,");
1489*cdf0e10cSrcweir 	if(nValue & SQL_FN_NUM_POWER)
1490*cdf0e10cSrcweir 		aValue.appendAscii("POWER,");
1491*cdf0e10cSrcweir 	if(nValue & SQL_FN_NUM_RADIANS)
1492*cdf0e10cSrcweir 		aValue.appendAscii("RADIANS,");
1493*cdf0e10cSrcweir 	if(nValue & SQL_FN_NUM_RAND)
1494*cdf0e10cSrcweir 		aValue.appendAscii("RAND,");
1495*cdf0e10cSrcweir 	if(nValue & SQL_FN_NUM_ROUND)
1496*cdf0e10cSrcweir 		aValue.appendAscii("ROUND,");
1497*cdf0e10cSrcweir 	if(nValue & SQL_FN_NUM_SIGN)
1498*cdf0e10cSrcweir 		aValue.appendAscii("SIGN,");
1499*cdf0e10cSrcweir 	if(nValue & SQL_FN_NUM_SIN)
1500*cdf0e10cSrcweir 		aValue.appendAscii("SIN,");
1501*cdf0e10cSrcweir 	if(nValue & SQL_FN_NUM_SQRT)
1502*cdf0e10cSrcweir 		aValue.appendAscii("SQRT,");
1503*cdf0e10cSrcweir 	if(nValue & SQL_FN_NUM_TAN)
1504*cdf0e10cSrcweir 		aValue.appendAscii("TAN,");
1505*cdf0e10cSrcweir 	if(nValue & SQL_FN_NUM_TRUNCATE)
1506*cdf0e10cSrcweir 		aValue.appendAscii("TRUNCATE,");
1507*cdf0e10cSrcweir 
1508*cdf0e10cSrcweir 	if ( aValue.getLength() )
1509*cdf0e10cSrcweir         aValue.setLength(aValue.getLength()-1);
1510*cdf0e10cSrcweir 
1511*cdf0e10cSrcweir 	return aValue.makeStringAndClear();
1512*cdf0e10cSrcweir }
1513*cdf0e10cSrcweir // -------------------------------------------------------------------------
1514*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsExtendedSQLGrammar(  ) throw(SQLException, RuntimeException)
1515*cdf0e10cSrcweir {
1516*cdf0e10cSrcweir 	SQLUINTEGER nValue;
1517*cdf0e10cSrcweir 	if(m_bOdbc3)
1518*cdf0e10cSrcweir 	{
1519*cdf0e10cSrcweir 		OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ODBC_INTERFACE_CONFORMANCE,nValue,*this);
1520*cdf0e10cSrcweir 		return nValue == SQL_OIC_LEVEL2;
1521*cdf0e10cSrcweir 	}
1522*cdf0e10cSrcweir 	else
1523*cdf0e10cSrcweir 	{
1524*cdf0e10cSrcweir 		OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ODBC_INTERFACE_CONFORMANCE,nValue,*this);
1525*cdf0e10cSrcweir 		return nValue == SQL_OAC_LEVEL2;
1526*cdf0e10cSrcweir 	}
1527*cdf0e10cSrcweir }
1528*cdf0e10cSrcweir // -------------------------------------------------------------------------
1529*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsCoreSQLGrammar(  ) throw(SQLException, RuntimeException)
1530*cdf0e10cSrcweir {
1531*cdf0e10cSrcweir 	SQLUINTEGER nValue;
1532*cdf0e10cSrcweir 	if(m_bOdbc3)
1533*cdf0e10cSrcweir 	{
1534*cdf0e10cSrcweir 		OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ODBC_INTERFACE_CONFORMANCE,nValue,*this);
1535*cdf0e10cSrcweir 		return nValue == SQL_OIC_CORE || nValue == SQL_OIC_LEVEL2 || nValue == SQL_OIC_LEVEL1;
1536*cdf0e10cSrcweir 	}
1537*cdf0e10cSrcweir 	else
1538*cdf0e10cSrcweir 	{
1539*cdf0e10cSrcweir 		OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ODBC_SQL_CONFORMANCE,nValue,*this);
1540*cdf0e10cSrcweir 		return nValue == SQL_OSC_CORE || nValue == SQL_OAC_LEVEL1 || nValue == SQL_OAC_LEVEL2;
1541*cdf0e10cSrcweir 	}
1542*cdf0e10cSrcweir }
1543*cdf0e10cSrcweir // -------------------------------------------------------------------------
1544*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsMinimumSQLGrammar(  ) throw(SQLException, RuntimeException)
1545*cdf0e10cSrcweir {
1546*cdf0e10cSrcweir 	SQLUINTEGER nValue;
1547*cdf0e10cSrcweir 	if(m_bOdbc3)
1548*cdf0e10cSrcweir 	{
1549*cdf0e10cSrcweir 		OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ODBC_INTERFACE_CONFORMANCE,nValue,*this);
1550*cdf0e10cSrcweir 		return nValue == SQL_OIC_LEVEL1 || nValue == SQL_OIC_LEVEL2;
1551*cdf0e10cSrcweir 	}
1552*cdf0e10cSrcweir 	else
1553*cdf0e10cSrcweir 	{
1554*cdf0e10cSrcweir 		OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ODBC_INTERFACE_CONFORMANCE,nValue,*this);
1555*cdf0e10cSrcweir 		return nValue == SQL_OAC_LEVEL1 || nValue == SQL_OAC_LEVEL2;
1556*cdf0e10cSrcweir 	}
1557*cdf0e10cSrcweir }
1558*cdf0e10cSrcweir // -------------------------------------------------------------------------
1559*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsFullOuterJoins(  ) throw(SQLException, RuntimeException)
1560*cdf0e10cSrcweir {
1561*cdf0e10cSrcweir 	SQLUINTEGER nValue;
1562*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_OJ_CAPABILITIES,nValue,*this);
1563*cdf0e10cSrcweir 	return (nValue & SQL_OJ_FULL) == SQL_OJ_FULL;
1564*cdf0e10cSrcweir }
1565*cdf0e10cSrcweir // -------------------------------------------------------------------------
1566*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsLimitedOuterJoins(  ) throw(SQLException, RuntimeException)
1567*cdf0e10cSrcweir {
1568*cdf0e10cSrcweir 	return supportsFullOuterJoins(  );
1569*cdf0e10cSrcweir }
1570*cdf0e10cSrcweir // -------------------------------------------------------------------------
1571*cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInGroupBy(  ) throw(SQLException, RuntimeException)
1572*cdf0e10cSrcweir {
1573*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
1574*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMNS_IN_GROUP_BY,nValue,*this);
1575*cdf0e10cSrcweir 	return nValue;
1576*cdf0e10cSrcweir }
1577*cdf0e10cSrcweir // -------------------------------------------------------------------------
1578*cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInOrderBy(  ) throw(SQLException, RuntimeException)
1579*cdf0e10cSrcweir {
1580*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
1581*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMNS_IN_ORDER_BY,nValue,*this);
1582*cdf0e10cSrcweir 	return nValue;
1583*cdf0e10cSrcweir }
1584*cdf0e10cSrcweir // -------------------------------------------------------------------------
1585*cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxColumnsInSelect(  ) throw(SQLException, RuntimeException)
1586*cdf0e10cSrcweir {
1587*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
1588*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_COLUMNS_IN_SELECT,nValue,*this);
1589*cdf0e10cSrcweir 	return nValue;
1590*cdf0e10cSrcweir }
1591*cdf0e10cSrcweir // -------------------------------------------------------------------------
1592*cdf0e10cSrcweir sal_Int32 SAL_CALL ODatabaseMetaData::getMaxUserNameLength(  ) throw(SQLException, RuntimeException)
1593*cdf0e10cSrcweir {
1594*cdf0e10cSrcweir 	SQLUSMALLINT nValue;
1595*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_MAX_USER_NAME_LEN,nValue,*this);
1596*cdf0e10cSrcweir 	return nValue;
1597*cdf0e10cSrcweir }
1598*cdf0e10cSrcweir // -------------------------------------------------------------------------
1599*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetType( sal_Int32 setType ) throw(SQLException, RuntimeException)
1600*cdf0e10cSrcweir {
1601*cdf0e10cSrcweir 	SQLUINTEGER nValue;
1602*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_CURSOR_SENSITIVITY,nValue,*this);
1603*cdf0e10cSrcweir 	return (nValue & static_cast<SQLUINTEGER>(setType)) == static_cast<SQLUINTEGER>(setType);
1604*cdf0e10cSrcweir }
1605*cdf0e10cSrcweir // -------------------------------------------------------------------------
1606*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 concurrency ) throw(SQLException, RuntimeException)
1607*cdf0e10cSrcweir {
1608*cdf0e10cSrcweir 	SQLUINTEGER nValue;
1609*cdf0e10cSrcweir     SQLUSMALLINT nAskFor( SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 );
1610*cdf0e10cSrcweir 	switch(setType)
1611*cdf0e10cSrcweir 	{
1612*cdf0e10cSrcweir         default:
1613*cdf0e10cSrcweir 		case ResultSetType::FORWARD_ONLY:
1614*cdf0e10cSrcweir 			nAskFor = SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2;
1615*cdf0e10cSrcweir 			break;
1616*cdf0e10cSrcweir 		case ResultSetType::SCROLL_INSENSITIVE:
1617*cdf0e10cSrcweir 			nAskFor = SQL_STATIC_CURSOR_ATTRIBUTES2;
1618*cdf0e10cSrcweir 			break;
1619*cdf0e10cSrcweir 		case ResultSetType::SCROLL_SENSITIVE:
1620*cdf0e10cSrcweir 			nAskFor = SQL_DYNAMIC_CURSOR_ATTRIBUTES2;
1621*cdf0e10cSrcweir 			break;
1622*cdf0e10cSrcweir 	}
1623*cdf0e10cSrcweir 
1624*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,nAskFor,nValue,*this);
1625*cdf0e10cSrcweir 	sal_Bool bRet = sal_False;
1626*cdf0e10cSrcweir 	switch(concurrency)
1627*cdf0e10cSrcweir 	{
1628*cdf0e10cSrcweir 		case ResultSetConcurrency::READ_ONLY:
1629*cdf0e10cSrcweir 			bRet = (nValue & SQL_CA2_READ_ONLY_CONCURRENCY) == SQL_CA2_READ_ONLY_CONCURRENCY;
1630*cdf0e10cSrcweir 			break;
1631*cdf0e10cSrcweir 		case ResultSetConcurrency::UPDATABLE:
1632*cdf0e10cSrcweir 			bRet = (nValue & SQL_CA2_OPT_VALUES_CONCURRENCY) == SQL_CA2_OPT_VALUES_CONCURRENCY;
1633*cdf0e10cSrcweir 			break;
1634*cdf0e10cSrcweir 	}
1635*cdf0e10cSrcweir 	return bRet;
1636*cdf0e10cSrcweir }
1637*cdf0e10cSrcweir // -------------------------------------------------------------------------
1638*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::ownUpdatesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
1639*cdf0e10cSrcweir {
1640*cdf0e10cSrcweir 	SQLUINTEGER nValue;
1641*cdf0e10cSrcweir     SQLUSMALLINT nAskFor( SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 );
1642*cdf0e10cSrcweir 	switch(setType)
1643*cdf0e10cSrcweir 	{
1644*cdf0e10cSrcweir         default:
1645*cdf0e10cSrcweir 		case ResultSetType::FORWARD_ONLY:
1646*cdf0e10cSrcweir 			nAskFor = SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2;
1647*cdf0e10cSrcweir 			break;
1648*cdf0e10cSrcweir 		case ResultSetType::SCROLL_INSENSITIVE:
1649*cdf0e10cSrcweir 			nAskFor = SQL_STATIC_CURSOR_ATTRIBUTES2;
1650*cdf0e10cSrcweir 			break;
1651*cdf0e10cSrcweir 		case ResultSetType::SCROLL_SENSITIVE:
1652*cdf0e10cSrcweir 			nAskFor = SQL_DYNAMIC_CURSOR_ATTRIBUTES2;
1653*cdf0e10cSrcweir 			break;
1654*cdf0e10cSrcweir 	}
1655*cdf0e10cSrcweir 
1656*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,nAskFor,nValue,*this);
1657*cdf0e10cSrcweir 	return (nValue & SQL_CA2_SENSITIVITY_UPDATES) == SQL_CA2_SENSITIVITY_UPDATES;
1658*cdf0e10cSrcweir }
1659*cdf0e10cSrcweir // -------------------------------------------------------------------------
1660*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::ownDeletesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
1661*cdf0e10cSrcweir {
1662*cdf0e10cSrcweir 	SQLUINTEGER nValue;
1663*cdf0e10cSrcweir     SQLUSMALLINT nAskFor( SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 );
1664*cdf0e10cSrcweir 	switch(setType)
1665*cdf0e10cSrcweir 	{
1666*cdf0e10cSrcweir         default:
1667*cdf0e10cSrcweir 		case ResultSetType::FORWARD_ONLY:
1668*cdf0e10cSrcweir 			nAskFor = SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2;
1669*cdf0e10cSrcweir 			break;
1670*cdf0e10cSrcweir 		case ResultSetType::SCROLL_INSENSITIVE:
1671*cdf0e10cSrcweir 			nAskFor = SQL_STATIC_CURSOR_ATTRIBUTES2;
1672*cdf0e10cSrcweir 			break;
1673*cdf0e10cSrcweir 		case ResultSetType::SCROLL_SENSITIVE:
1674*cdf0e10cSrcweir 			nAskFor = SQL_DYNAMIC_CURSOR_ATTRIBUTES2;
1675*cdf0e10cSrcweir 			break;
1676*cdf0e10cSrcweir 	}
1677*cdf0e10cSrcweir 
1678*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,nAskFor,nValue,*this);
1679*cdf0e10cSrcweir 	return (nValue & SQL_CA2_SENSITIVITY_DELETIONS) != SQL_CA2_SENSITIVITY_DELETIONS;
1680*cdf0e10cSrcweir }
1681*cdf0e10cSrcweir // -------------------------------------------------------------------------
1682*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::ownInsertsAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
1683*cdf0e10cSrcweir {
1684*cdf0e10cSrcweir 	SQLUINTEGER nValue;
1685*cdf0e10cSrcweir     SQLUSMALLINT nAskFor( SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 );
1686*cdf0e10cSrcweir 	switch(setType)
1687*cdf0e10cSrcweir 	{
1688*cdf0e10cSrcweir         default:
1689*cdf0e10cSrcweir 		case ResultSetType::FORWARD_ONLY:
1690*cdf0e10cSrcweir 			nAskFor = SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2;
1691*cdf0e10cSrcweir 			break;
1692*cdf0e10cSrcweir 		case ResultSetType::SCROLL_INSENSITIVE:
1693*cdf0e10cSrcweir 			nAskFor = SQL_STATIC_CURSOR_ATTRIBUTES2;
1694*cdf0e10cSrcweir 			break;
1695*cdf0e10cSrcweir 		case ResultSetType::SCROLL_SENSITIVE:
1696*cdf0e10cSrcweir 			nAskFor = SQL_DYNAMIC_CURSOR_ATTRIBUTES2;
1697*cdf0e10cSrcweir 			break;
1698*cdf0e10cSrcweir 	}
1699*cdf0e10cSrcweir 
1700*cdf0e10cSrcweir 	OTools::GetInfo(m_pConnection,m_aConnectionHandle,nAskFor,nValue,*this);
1701*cdf0e10cSrcweir 	return (nValue & SQL_CA2_SENSITIVITY_ADDITIONS) == SQL_CA2_SENSITIVITY_ADDITIONS;
1702*cdf0e10cSrcweir }
1703*cdf0e10cSrcweir // -------------------------------------------------------------------------
1704*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::othersUpdatesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
1705*cdf0e10cSrcweir {
1706*cdf0e10cSrcweir 	return ownUpdatesAreVisible(setType);
1707*cdf0e10cSrcweir }
1708*cdf0e10cSrcweir // -------------------------------------------------------------------------
1709*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::othersDeletesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
1710*cdf0e10cSrcweir {
1711*cdf0e10cSrcweir 	return ownDeletesAreVisible(setType);
1712*cdf0e10cSrcweir }
1713*cdf0e10cSrcweir // -------------------------------------------------------------------------
1714*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::othersInsertsAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
1715*cdf0e10cSrcweir {
1716*cdf0e10cSrcweir 	return ownInsertsAreVisible(setType);
1717*cdf0e10cSrcweir }
1718*cdf0e10cSrcweir // -------------------------------------------------------------------------
1719*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::updatesAreDetected( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
1720*cdf0e10cSrcweir {
1721*cdf0e10cSrcweir 	return sal_False;
1722*cdf0e10cSrcweir }
1723*cdf0e10cSrcweir // -------------------------------------------------------------------------
1724*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::deletesAreDetected( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
1725*cdf0e10cSrcweir {
1726*cdf0e10cSrcweir 	return sal_False;
1727*cdf0e10cSrcweir }
1728*cdf0e10cSrcweir // -------------------------------------------------------------------------
1729*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::insertsAreDetected( sal_Int32 /*setType*/ ) throw(SQLException, RuntimeException)
1730*cdf0e10cSrcweir {
1731*cdf0e10cSrcweir 	return sal_False;
1732*cdf0e10cSrcweir }
1733*cdf0e10cSrcweir // -------------------------------------------------------------------------
1734*cdf0e10cSrcweir sal_Bool SAL_CALL ODatabaseMetaData::supportsBatchUpdates(  ) throw(SQLException, RuntimeException)
1735*cdf0e10cSrcweir {
1736*cdf0e10cSrcweir 	return sal_False;
1737*cdf0e10cSrcweir }
1738*cdf0e10cSrcweir // -------------------------------------------------------------------------
1739*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL ODatabaseMetaData::getUDTs( const Any& /*catalog*/, const ::rtl::OUString& /*schemaPattern*/, const ::rtl::OUString& /*typeNamePattern*/, const Sequence< sal_Int32 >& /*types*/ ) throw(SQLException, RuntimeException)
1740*cdf0e10cSrcweir {
1741*cdf0e10cSrcweir 	return NULL;
1742*cdf0e10cSrcweir }
1743*cdf0e10cSrcweir // -----------------------------------------------------------------------------
1744