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 "java/sql/DatabaseMetaData.hxx"
31*cdf0e10cSrcweir #include "java/sql/Connection.hxx"
32*cdf0e10cSrcweir #include "java/sql/ResultSet.hxx"
33*cdf0e10cSrcweir #include "java/tools.hxx"
34*cdf0e10cSrcweir #include "java/lang/String.hxx"
35*cdf0e10cSrcweir #include "connectivity/CommonTools.hxx"
36*cdf0e10cSrcweir #include "FDatabaseMetaDataResultSet.hxx"
37*cdf0e10cSrcweir #include <comphelper/types.hxx>
38*cdf0e10cSrcweir #include "TPrivilegesResultSet.hxx"
39*cdf0e10cSrcweir #include "diagnose_ex.h"
40*cdf0e10cSrcweir #include "resource/jdbc_log.hrc"
41*cdf0e10cSrcweir 
42*cdf0e10cSrcweir using namespace ::comphelper;
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir using namespace connectivity;
45*cdf0e10cSrcweir using namespace ::com::sun::star::uno;
46*cdf0e10cSrcweir using namespace ::com::sun::star::beans;
47*cdf0e10cSrcweir using namespace ::com::sun::star::sdbc;
48*cdf0e10cSrcweir using namespace ::com::sun::star::container;
49*cdf0e10cSrcweir using namespace ::com::sun::star::lang;
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir //**************************************************************
52*cdf0e10cSrcweir //************ Class: java.sql.DatabaseMetaData
53*cdf0e10cSrcweir //**************************************************************
54*cdf0e10cSrcweir 
55*cdf0e10cSrcweir jclass java_sql_DatabaseMetaData::theClass				= 0;
56*cdf0e10cSrcweir 
57*cdf0e10cSrcweir java_sql_DatabaseMetaData::~java_sql_DatabaseMetaData()
58*cdf0e10cSrcweir {
59*cdf0e10cSrcweir 	SDBThreadAttach::releaseRef();
60*cdf0e10cSrcweir }
61*cdf0e10cSrcweir 
62*cdf0e10cSrcweir jclass java_sql_DatabaseMetaData::getMyClass() const
63*cdf0e10cSrcweir {
64*cdf0e10cSrcweir 	// die Klasse muss nur einmal geholt werden, daher statisch
65*cdf0e10cSrcweir 	if( !theClass )
66*cdf0e10cSrcweir         theClass = findMyClass("java/sql/DatabaseMetaData");
67*cdf0e10cSrcweir 	return theClass;
68*cdf0e10cSrcweir }
69*cdf0e10cSrcweir // -----------------------------------------------------------------------------
70*cdf0e10cSrcweir java_sql_DatabaseMetaData::java_sql_DatabaseMetaData( JNIEnv * pEnv, jobject myObj, java_sql_Connection& _rConnection )
71*cdf0e10cSrcweir     :ODatabaseMetaDataBase( &_rConnection,_rConnection.getConnectionInfo() )
72*cdf0e10cSrcweir     ,java_lang_Object( pEnv, myObj )
73*cdf0e10cSrcweir 	,m_pConnection( &_rConnection )
74*cdf0e10cSrcweir     ,m_aLogger( _rConnection.getLogger() )
75*cdf0e10cSrcweir {
76*cdf0e10cSrcweir 	SDBThreadAttach::addRef();
77*cdf0e10cSrcweir }
78*cdf0e10cSrcweir 
79*cdf0e10cSrcweir // -------------------------------------------------------------------------
80*cdf0e10cSrcweir Reference< XResultSet > java_sql_DatabaseMetaData::impl_getTypeInfo_throw(  )
81*cdf0e10cSrcweir {
82*cdf0e10cSrcweir 	static jmethodID mID(NULL);
83*cdf0e10cSrcweir     return impl_callResultSetMethod( "getTypeInfo", mID );
84*cdf0e10cSrcweir }
85*cdf0e10cSrcweir // -------------------------------------------------------------------------
86*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getCatalogs(  ) throw(SQLException, RuntimeException)
87*cdf0e10cSrcweir {
88*cdf0e10cSrcweir 	static jmethodID mID(NULL);
89*cdf0e10cSrcweir     return impl_callResultSetMethod( "getCatalogs", mID );
90*cdf0e10cSrcweir }
91*cdf0e10cSrcweir // -------------------------------------------------------------------------
92*cdf0e10cSrcweir ::rtl::OUString java_sql_DatabaseMetaData::impl_getCatalogSeparator_throw(  )
93*cdf0e10cSrcweir {
94*cdf0e10cSrcweir 	static jmethodID mID(NULL);
95*cdf0e10cSrcweir     return impl_callStringMethod( "getCatalogSeparator", mID );
96*cdf0e10cSrcweir }
97*cdf0e10cSrcweir // -------------------------------------------------------------------------
98*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getSchemas(  ) throw(SQLException, RuntimeException)
99*cdf0e10cSrcweir {
100*cdf0e10cSrcweir 	static jmethodID mID(NULL);
101*cdf0e10cSrcweir     return impl_callResultSetMethod( "getSchemas", mID );
102*cdf0e10cSrcweir }
103*cdf0e10cSrcweir // -------------------------------------------------------------------------
104*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getColumnPrivileges(
105*cdf0e10cSrcweir         const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
106*cdf0e10cSrcweir {
107*cdf0e10cSrcweir 	static jmethodID mID(NULL);
108*cdf0e10cSrcweir     return impl_callResultSetMethodWithStrings( "getColumnPrivileges", mID, catalog, schema, table, &columnNamePattern );
109*cdf0e10cSrcweir }
110*cdf0e10cSrcweir // -------------------------------------------------------------------------
111*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getColumns(
112*cdf0e10cSrcweir         const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
113*cdf0e10cSrcweir {
114*cdf0e10cSrcweir 	static jmethodID mID(NULL);
115*cdf0e10cSrcweir     return impl_callResultSetMethodWithStrings( "getColumns", mID, catalog, schemaPattern, tableNamePattern, &columnNamePattern );
116*cdf0e10cSrcweir }
117*cdf0e10cSrcweir 
118*cdf0e10cSrcweir // -------------------------------------------------------------------------
119*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTables(
120*cdf0e10cSrcweir         const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const Sequence< ::rtl::OUString >& _types ) throw(SQLException, RuntimeException)
121*cdf0e10cSrcweir {
122*cdf0e10cSrcweir 	static const char * cSignature = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)Ljava/sql/ResultSet;";
123*cdf0e10cSrcweir 	static const char * cMethodName = "getTables";
124*cdf0e10cSrcweir 
125*cdf0e10cSrcweir     m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, cMethodName );
126*cdf0e10cSrcweir 
127*cdf0e10cSrcweir     jobject out(0);
128*cdf0e10cSrcweir     SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
129*cdf0e10cSrcweir 
130*cdf0e10cSrcweir     {
131*cdf0e10cSrcweir 		// Java-Call absetzen
132*cdf0e10cSrcweir 		static jmethodID mID(NULL);
133*cdf0e10cSrcweir         obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
134*cdf0e10cSrcweir 		OSL_VERIFY_RES( !isExceptionOccured(t.pEnv,sal_True),"Exception occured!");
135*cdf0e10cSrcweir 		jvalue args[4];
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir 		args[3].l = 0;
138*cdf0e10cSrcweir         sal_Int32 typeFilterCount = _types.getLength();
139*cdf0e10cSrcweir         if ( typeFilterCount )
140*cdf0e10cSrcweir         {
141*cdf0e10cSrcweir             jobjectArray pObjArray = static_cast< jobjectArray >( t.pEnv->NewObjectArray( (jsize)typeFilterCount, java_lang_String::st_getMyClass(), 0 ) );
142*cdf0e10cSrcweir             OSL_VERIFY_RES( !isExceptionOccured( t.pEnv, sal_True ), "Exception occured!" );
143*cdf0e10cSrcweir             const ::rtl::OUString* typeFilter = _types.getConstArray();
144*cdf0e10cSrcweir             bool bIncludeAllTypes = false;
145*cdf0e10cSrcweir             for ( sal_Int32 i=0; i<typeFilterCount; ++i, ++typeFilter )
146*cdf0e10cSrcweir             {
147*cdf0e10cSrcweir                 if ( typeFilter->equalsAsciiL( "%", 1 ) )
148*cdf0e10cSrcweir                 {
149*cdf0e10cSrcweir                     bIncludeAllTypes = true;
150*cdf0e10cSrcweir                     break;
151*cdf0e10cSrcweir                 }
152*cdf0e10cSrcweir                 jstring aT = convertwchar_tToJavaString( t.pEnv, *typeFilter );
153*cdf0e10cSrcweir                 t.pEnv->SetObjectArrayElement( pObjArray, (jsize)i, aT );
154*cdf0e10cSrcweir                 OSL_VERIFY_RES( !isExceptionOccured( t.pEnv, sal_True ), "Exception occured!" );
155*cdf0e10cSrcweir             }
156*cdf0e10cSrcweir 
157*cdf0e10cSrcweir             if ( bIncludeAllTypes )
158*cdf0e10cSrcweir             {
159*cdf0e10cSrcweir                 // the SDBC API allows to pass "%" as table type filter, but in JDBC, "all table types"
160*cdf0e10cSrcweir                 // is represented by the table type being <null/>
161*cdf0e10cSrcweir                 t.pEnv->DeleteLocalRef( pObjArray );
162*cdf0e10cSrcweir                 OSL_VERIFY_RES( !isExceptionOccured( t.pEnv, sal_True ), "Exception occured!" );
163*cdf0e10cSrcweir             }
164*cdf0e10cSrcweir             else
165*cdf0e10cSrcweir             {
166*cdf0e10cSrcweir                 args[3].l = pObjArray;
167*cdf0e10cSrcweir             }
168*cdf0e10cSrcweir         }
169*cdf0e10cSrcweir         // if we are to display "all catalogs", then respect m_aCatalogRestriction
170*cdf0e10cSrcweir         Any aCatalogFilter( catalog );
171*cdf0e10cSrcweir         if ( !aCatalogFilter.hasValue() )
172*cdf0e10cSrcweir             aCatalogFilter = m_pConnection->getCatalogRestriction();
173*cdf0e10cSrcweir         // similar for schema
174*cdf0e10cSrcweir         Any aSchemaFilter;
175*cdf0e10cSrcweir         if ( schemaPattern.equalsAsciiL( "%", 1 ) )
176*cdf0e10cSrcweir             aSchemaFilter = m_pConnection->getSchemaRestriction();
177*cdf0e10cSrcweir         else
178*cdf0e10cSrcweir             aSchemaFilter <<= schemaPattern;
179*cdf0e10cSrcweir 
180*cdf0e10cSrcweir         args[0].l = aCatalogFilter.hasValue() ? convertwchar_tToJavaString( t.pEnv, ::comphelper::getString( aCatalogFilter ) ) : NULL;
181*cdf0e10cSrcweir         args[1].l = aSchemaFilter.hasValue() ? convertwchar_tToJavaString( t.pEnv, ::comphelper::getString( aSchemaFilter ) ) : NULL;
182*cdf0e10cSrcweir         args[2].l = convertwchar_tToJavaString(t.pEnv,tableNamePattern);
183*cdf0e10cSrcweir         out = t.pEnv->CallObjectMethod( object, mID, args[0].l, args[1].l,args[2].l,args[3].l);
184*cdf0e10cSrcweir         jthrowable jThrow = t.pEnv->ExceptionOccurred();
185*cdf0e10cSrcweir         if ( jThrow )
186*cdf0e10cSrcweir             t.pEnv->ExceptionClear();// we have to clear the exception here because we want to handle it below
187*cdf0e10cSrcweir         if ( aCatalogFilter.hasValue() )
188*cdf0e10cSrcweir         {
189*cdf0e10cSrcweir             t.pEnv->DeleteLocalRef((jstring)args[0].l);
190*cdf0e10cSrcweir             OSL_VERIFY_RES( !isExceptionOccured( t.pEnv, sal_True ), "Exception occured!" );
191*cdf0e10cSrcweir         }
192*cdf0e10cSrcweir         if(args[1].l)
193*cdf0e10cSrcweir         {
194*cdf0e10cSrcweir             t.pEnv->DeleteLocalRef((jstring)args[1].l);
195*cdf0e10cSrcweir             OSL_VERIFY_RES( !isExceptionOccured( t.pEnv, sal_True ), "Exception occured!" );
196*cdf0e10cSrcweir         }
197*cdf0e10cSrcweir         if(tableNamePattern.getLength())
198*cdf0e10cSrcweir         {
199*cdf0e10cSrcweir             t.pEnv->DeleteLocalRef((jstring)args[2].l);
200*cdf0e10cSrcweir             OSL_VERIFY_RES( !isExceptionOccured( t.pEnv, sal_True ), "Exception occured!" );
201*cdf0e10cSrcweir         }
202*cdf0e10cSrcweir         //for(INT16 i=0;i<len;i++)
203*cdf0e10cSrcweir         if ( args[3].l )
204*cdf0e10cSrcweir         {
205*cdf0e10cSrcweir             t.pEnv->DeleteLocalRef( (jobjectArray)args[3].l );
206*cdf0e10cSrcweir             OSL_VERIFY_RES( !isExceptionOccured( t.pEnv, sal_True ), "Exception occured!" );
207*cdf0e10cSrcweir         }
208*cdf0e10cSrcweir 
209*cdf0e10cSrcweir         if ( jThrow )
210*cdf0e10cSrcweir         {
211*cdf0e10cSrcweir             if ( t.pEnv->IsInstanceOf( jThrow,java_sql_SQLException_BASE::st_getMyClass() ) )
212*cdf0e10cSrcweir             {
213*cdf0e10cSrcweir                 java_sql_SQLException_BASE* pException = new java_sql_SQLException_BASE( t.pEnv, jThrow );
214*cdf0e10cSrcweir                 SQLException e(	pException->getMessage(),
215*cdf0e10cSrcweir                                     *this,
216*cdf0e10cSrcweir                                     pException->getSQLState(),
217*cdf0e10cSrcweir                                     pException->getErrorCode(),
218*cdf0e10cSrcweir                                     Any()
219*cdf0e10cSrcweir                                 );
220*cdf0e10cSrcweir                 delete pException;
221*cdf0e10cSrcweir                 throw  e;
222*cdf0e10cSrcweir             }
223*cdf0e10cSrcweir         }
224*cdf0e10cSrcweir 	}
225*cdf0e10cSrcweir 
226*cdf0e10cSrcweir     if ( !out )
227*cdf0e10cSrcweir         return NULL;
228*cdf0e10cSrcweir 
229*cdf0e10cSrcweir     m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_SUCCESS, cMethodName );
230*cdf0e10cSrcweir 	return new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection);
231*cdf0e10cSrcweir }
232*cdf0e10cSrcweir // -------------------------------------------------------------------------
233*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getProcedureColumns(
234*cdf0e10cSrcweir         const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& procedureNamePattern, const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
235*cdf0e10cSrcweir {
236*cdf0e10cSrcweir 	static jmethodID mID(NULL);
237*cdf0e10cSrcweir     return impl_callResultSetMethodWithStrings( "getProcedureColumns", mID, catalog, schemaPattern, procedureNamePattern, &columnNamePattern );
238*cdf0e10cSrcweir }
239*cdf0e10cSrcweir // -------------------------------------------------------------------------
240*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getProcedures( const Any&
241*cdf0e10cSrcweir                 catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& procedureNamePattern ) throw(SQLException, RuntimeException)
242*cdf0e10cSrcweir {
243*cdf0e10cSrcweir 	static jmethodID mID(NULL);
244*cdf0e10cSrcweir     return impl_callResultSetMethodWithStrings( "getProcedures", mID, catalog, schemaPattern, procedureNamePattern );
245*cdf0e10cSrcweir }
246*cdf0e10cSrcweir // -------------------------------------------------------------------------
247*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getVersionColumns(
248*cdf0e10cSrcweir         const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
249*cdf0e10cSrcweir {
250*cdf0e10cSrcweir 	static jmethodID mID(NULL);
251*cdf0e10cSrcweir     return impl_callResultSetMethodWithStrings( "getVersionColumns", mID, catalog, schema, table );
252*cdf0e10cSrcweir }
253*cdf0e10cSrcweir // -------------------------------------------------------------------------
254*cdf0e10cSrcweir sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxBinaryLiteralLength(  ) throw(SQLException, RuntimeException)
255*cdf0e10cSrcweir {
256*cdf0e10cSrcweir 	static jmethodID mID(NULL);
257*cdf0e10cSrcweir     return impl_callIntMethod( "getMaxBinaryLiteralLength", mID );
258*cdf0e10cSrcweir }
259*cdf0e10cSrcweir // -------------------------------------------------------------------------
260*cdf0e10cSrcweir sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxRowSize(  ) throw(SQLException, RuntimeException)
261*cdf0e10cSrcweir {
262*cdf0e10cSrcweir 	static jmethodID mID(NULL);
263*cdf0e10cSrcweir     return impl_callIntMethod( "getMaxRowSize", mID );
264*cdf0e10cSrcweir }
265*cdf0e10cSrcweir // -------------------------------------------------------------------------
266*cdf0e10cSrcweir sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxCatalogNameLength(  ) throw(SQLException, RuntimeException)
267*cdf0e10cSrcweir {
268*cdf0e10cSrcweir 	static jmethodID mID(NULL);
269*cdf0e10cSrcweir     return impl_callIntMethod( "getMaxCatalogNameLength", mID );
270*cdf0e10cSrcweir }
271*cdf0e10cSrcweir // -------------------------------------------------------------------------
272*cdf0e10cSrcweir sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxCharLiteralLength(  ) throw(SQLException, RuntimeException)
273*cdf0e10cSrcweir {
274*cdf0e10cSrcweir 	static jmethodID mID(NULL);
275*cdf0e10cSrcweir     return impl_callIntMethod( "getMaxCharLiteralLength", mID );
276*cdf0e10cSrcweir }
277*cdf0e10cSrcweir // -------------------------------------------------------------------------
278*cdf0e10cSrcweir sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnNameLength(  ) throw(SQLException, RuntimeException)
279*cdf0e10cSrcweir {
280*cdf0e10cSrcweir 	static jmethodID mID(NULL);
281*cdf0e10cSrcweir     return impl_callIntMethod( "getMaxColumnNameLength", mID );
282*cdf0e10cSrcweir }
283*cdf0e10cSrcweir // -------------------------------------------------------------------------
284*cdf0e10cSrcweir sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnsInIndex(  ) throw(SQLException, RuntimeException)
285*cdf0e10cSrcweir {
286*cdf0e10cSrcweir 	static jmethodID mID(NULL);
287*cdf0e10cSrcweir     return impl_callIntMethod( "getMaxColumnsInIndex", mID );
288*cdf0e10cSrcweir }
289*cdf0e10cSrcweir // -------------------------------------------------------------------------
290*cdf0e10cSrcweir sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxCursorNameLength(  ) throw(SQLException, RuntimeException)
291*cdf0e10cSrcweir {
292*cdf0e10cSrcweir 	static jmethodID mID(NULL);
293*cdf0e10cSrcweir     return impl_callIntMethod( "getMaxCursorNameLength", mID );
294*cdf0e10cSrcweir }
295*cdf0e10cSrcweir // -------------------------------------------------------------------------
296*cdf0e10cSrcweir sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxConnections(  ) throw(SQLException, RuntimeException)
297*cdf0e10cSrcweir {
298*cdf0e10cSrcweir 	static jmethodID mID(NULL);
299*cdf0e10cSrcweir     return impl_callIntMethod( "getMaxConnections", mID );
300*cdf0e10cSrcweir }
301*cdf0e10cSrcweir // -------------------------------------------------------------------------
302*cdf0e10cSrcweir sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnsInTable(  ) throw(SQLException, RuntimeException)
303*cdf0e10cSrcweir {
304*cdf0e10cSrcweir 	static jmethodID mID(NULL);
305*cdf0e10cSrcweir     return impl_callIntMethod( "getMaxColumnsInTable", mID );
306*cdf0e10cSrcweir }
307*cdf0e10cSrcweir // -------------------------------------------------------------------------
308*cdf0e10cSrcweir sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxStatementLength(  ) throw(SQLException, RuntimeException)
309*cdf0e10cSrcweir {
310*cdf0e10cSrcweir 	static jmethodID mID(NULL);
311*cdf0e10cSrcweir     return impl_callIntMethod( "getMaxStatementLength", mID );
312*cdf0e10cSrcweir }
313*cdf0e10cSrcweir // -------------------------------------------------------------------------
314*cdf0e10cSrcweir sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxTableNameLength(  ) throw(SQLException, RuntimeException)
315*cdf0e10cSrcweir {
316*cdf0e10cSrcweir 	static jmethodID mID(NULL);
317*cdf0e10cSrcweir     return impl_callIntMethod( "getMaxTableNameLength", mID );
318*cdf0e10cSrcweir }
319*cdf0e10cSrcweir // -------------------------------------------------------------------------
320*cdf0e10cSrcweir sal_Int32 java_sql_DatabaseMetaData::impl_getMaxTablesInSelect_throw(  )
321*cdf0e10cSrcweir {
322*cdf0e10cSrcweir 	static jmethodID mID(NULL);
323*cdf0e10cSrcweir     return impl_callIntMethod( "getMaxTablesInSelect", mID );
324*cdf0e10cSrcweir }
325*cdf0e10cSrcweir // -------------------------------------------------------------------------
326*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getExportedKeys(
327*cdf0e10cSrcweir         const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
328*cdf0e10cSrcweir {
329*cdf0e10cSrcweir 	static jmethodID mID(NULL);
330*cdf0e10cSrcweir     return impl_callResultSetMethodWithStrings( "getExportedKeys", mID, catalog, schema, table );
331*cdf0e10cSrcweir }
332*cdf0e10cSrcweir // -------------------------------------------------------------------------
333*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getImportedKeys(
334*cdf0e10cSrcweir         const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
335*cdf0e10cSrcweir {
336*cdf0e10cSrcweir 	static jmethodID mID(NULL);
337*cdf0e10cSrcweir     return impl_callResultSetMethodWithStrings( "getImportedKeys", mID, catalog, schema, table );
338*cdf0e10cSrcweir }
339*cdf0e10cSrcweir // -------------------------------------------------------------------------
340*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getPrimaryKeys(
341*cdf0e10cSrcweir         const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
342*cdf0e10cSrcweir {
343*cdf0e10cSrcweir 	static jmethodID mID(NULL);
344*cdf0e10cSrcweir     return impl_callResultSetMethodWithStrings( "getPrimaryKeys", mID, catalog, schema, table );
345*cdf0e10cSrcweir }
346*cdf0e10cSrcweir // -------------------------------------------------------------------------
347*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getIndexInfo(
348*cdf0e10cSrcweir         const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table,
349*cdf0e10cSrcweir         sal_Bool unique, sal_Bool approximate ) throw(SQLException, RuntimeException)
350*cdf0e10cSrcweir {
351*cdf0e10cSrcweir 	static const char * cSignature = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ)Ljava/sql/ResultSet;";
352*cdf0e10cSrcweir 	static const char * cMethodName = "getIndexInfo";
353*cdf0e10cSrcweir 
354*cdf0e10cSrcweir     m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, cMethodName );
355*cdf0e10cSrcweir 
356*cdf0e10cSrcweir     jobject out(0);
357*cdf0e10cSrcweir     SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
358*cdf0e10cSrcweir 
359*cdf0e10cSrcweir     {
360*cdf0e10cSrcweir 		// Java-Call absetzen
361*cdf0e10cSrcweir 		static jmethodID mID(NULL);
362*cdf0e10cSrcweir         obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
363*cdf0e10cSrcweir 		jvalue args[5];
364*cdf0e10cSrcweir 		// Parameter konvertieren
365*cdf0e10cSrcweir 		args[0].l = catalog.hasValue() ? convertwchar_tToJavaString(t.pEnv,comphelper::getString(catalog)) : 0;
366*cdf0e10cSrcweir 		args[1].l = schema.toChar() == '%' ? NULL : convertwchar_tToJavaString(t.pEnv,schema);
367*cdf0e10cSrcweir 		args[2].l = convertwchar_tToJavaString(t.pEnv,table);
368*cdf0e10cSrcweir 		args[3].z = unique;
369*cdf0e10cSrcweir 		args[4].z = approximate;
370*cdf0e10cSrcweir 		out = t.pEnv->CallObjectMethod( object, mID, args[0].l,args[1].l,args[2].l,args[3].z,args[4].z );
371*cdf0e10cSrcweir 
372*cdf0e10cSrcweir 		// und aufraeumen
373*cdf0e10cSrcweir 		if(catalog.hasValue())
374*cdf0e10cSrcweir 			t.pEnv->DeleteLocalRef((jstring)args[0].l);
375*cdf0e10cSrcweir 		if(args[1].l)
376*cdf0e10cSrcweir 			t.pEnv->DeleteLocalRef((jstring)args[1].l);
377*cdf0e10cSrcweir 		if(table.getLength())
378*cdf0e10cSrcweir 			t.pEnv->DeleteLocalRef((jstring)args[2].l);
379*cdf0e10cSrcweir 		ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
380*cdf0e10cSrcweir 	}
381*cdf0e10cSrcweir     if ( !out )
382*cdf0e10cSrcweir         return NULL;
383*cdf0e10cSrcweir 
384*cdf0e10cSrcweir     m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_SUCCESS, cMethodName );
385*cdf0e10cSrcweir 	return new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection);
386*cdf0e10cSrcweir }
387*cdf0e10cSrcweir // -------------------------------------------------------------------------
388*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getBestRowIdentifier(
389*cdf0e10cSrcweir         const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, sal_Int32 scope,
390*cdf0e10cSrcweir         sal_Bool nullable ) throw(SQLException, RuntimeException)
391*cdf0e10cSrcweir {
392*cdf0e10cSrcweir 	static const char * cSignature = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZ)Ljava/sql/ResultSet;";
393*cdf0e10cSrcweir 	static const char * cMethodName = "getBestRowIdentifier";
394*cdf0e10cSrcweir 
395*cdf0e10cSrcweir     m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, cMethodName );
396*cdf0e10cSrcweir 
397*cdf0e10cSrcweir     jobject out(0);
398*cdf0e10cSrcweir     SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
399*cdf0e10cSrcweir 
400*cdf0e10cSrcweir     {
401*cdf0e10cSrcweir 		// Java-Call absetzen
402*cdf0e10cSrcweir 		static jmethodID mID(NULL);
403*cdf0e10cSrcweir         obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
404*cdf0e10cSrcweir 		jvalue args[3];
405*cdf0e10cSrcweir 		// Parameter konvertieren
406*cdf0e10cSrcweir 		args[0].l = catalog.hasValue() ? convertwchar_tToJavaString(t.pEnv,comphelper::getString(catalog)) : 0;
407*cdf0e10cSrcweir 		args[1].l = schema.toChar() == '%' ? NULL : convertwchar_tToJavaString(t.pEnv,schema);
408*cdf0e10cSrcweir 		args[2].l = convertwchar_tToJavaString(t.pEnv,table);
409*cdf0e10cSrcweir 		out = t.pEnv->CallObjectMethod( object, mID, args[0].l,args[1].l,args[2].l,scope,nullable);
410*cdf0e10cSrcweir 
411*cdf0e10cSrcweir 		// und aufraeumen
412*cdf0e10cSrcweir 		if(catalog.hasValue())
413*cdf0e10cSrcweir 			t.pEnv->DeleteLocalRef((jstring)args[0].l);
414*cdf0e10cSrcweir 		if(args[1].l)
415*cdf0e10cSrcweir 			t.pEnv->DeleteLocalRef((jstring)args[1].l);
416*cdf0e10cSrcweir 		if(table.getLength())
417*cdf0e10cSrcweir 			t.pEnv->DeleteLocalRef((jstring)args[2].l);
418*cdf0e10cSrcweir 		ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
419*cdf0e10cSrcweir 	}
420*cdf0e10cSrcweir 
421*cdf0e10cSrcweir     if ( !out )
422*cdf0e10cSrcweir         return NULL;
423*cdf0e10cSrcweir 
424*cdf0e10cSrcweir     m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_SUCCESS, cMethodName );
425*cdf0e10cSrcweir 	return new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection);
426*cdf0e10cSrcweir }
427*cdf0e10cSrcweir // -------------------------------------------------------------------------
428*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTablePrivileges(
429*cdf0e10cSrcweir         const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern ) throw(SQLException, RuntimeException)
430*cdf0e10cSrcweir {
431*cdf0e10cSrcweir 	if ( m_pConnection->isIgnoreDriverPrivilegesEnabled() )
432*cdf0e10cSrcweir 		return new OResultSetPrivileges(this,catalog,schemaPattern,tableNamePattern);
433*cdf0e10cSrcweir 
434*cdf0e10cSrcweir 	static jmethodID mID(NULL);
435*cdf0e10cSrcweir     Reference< XResultSet > xReturn( impl_callResultSetMethodWithStrings( "getTablePrivileges", mID, catalog, schemaPattern, tableNamePattern ) );
436*cdf0e10cSrcweir 
437*cdf0e10cSrcweir 	if ( xReturn.is() )
438*cdf0e10cSrcweir 	{
439*cdf0e10cSrcweir 		// we have to check the result columns for the tables privleges
440*cdf0e10cSrcweir         // #106324#
441*cdf0e10cSrcweir 		Reference< XResultSetMetaDataSupplier > xMetaSup(xReturn,UNO_QUERY);
442*cdf0e10cSrcweir 		if ( xMetaSup.is() )
443*cdf0e10cSrcweir 		{
444*cdf0e10cSrcweir 			Reference< XResultSetMetaData> xMeta = xMetaSup->getMetaData();
445*cdf0e10cSrcweir 			if ( xMeta.is() && xMeta->getColumnCount() != 7 )
446*cdf0e10cSrcweir 			{
447*cdf0e10cSrcweir 				// here we know that the count of column doesn't match
448*cdf0e10cSrcweir 				::std::map<sal_Int32,sal_Int32> aColumnMatching;
449*cdf0e10cSrcweir 				static const ::rtl::OUString sPrivs[] = {
450*cdf0e10cSrcweir 											::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE_CAT")),
451*cdf0e10cSrcweir 											::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE_SCHEM")),
452*cdf0e10cSrcweir 											::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE_NAME")),
453*cdf0e10cSrcweir 											::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GRANTOR")),
454*cdf0e10cSrcweir 											::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GRANTEE")),
455*cdf0e10cSrcweir 											::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PRIVILEGE")),
456*cdf0e10cSrcweir 											::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IS_GRANTABLE"))
457*cdf0e10cSrcweir 										};
458*cdf0e10cSrcweir 
459*cdf0e10cSrcweir 				::rtl::OUString sColumnName;
460*cdf0e10cSrcweir 				sal_Int32 nCount = xMeta->getColumnCount();
461*cdf0e10cSrcweir 				for (sal_Int32 i = 1 ; i <= nCount ; ++i)
462*cdf0e10cSrcweir 				{
463*cdf0e10cSrcweir 					sColumnName = xMeta->getColumnName(i);
464*cdf0e10cSrcweir 					for (sal_uInt32 j = 0 ; j < sizeof(sPrivs)/sizeof(sPrivs[0]); ++j)
465*cdf0e10cSrcweir 					{
466*cdf0e10cSrcweir 						if ( sPrivs[j] == sColumnName )
467*cdf0e10cSrcweir 						{
468*cdf0e10cSrcweir 							aColumnMatching.insert( ::std::map<sal_Int32,sal_Int32>::value_type(i,j+1) );
469*cdf0e10cSrcweir 							break;
470*cdf0e10cSrcweir 						}
471*cdf0e10cSrcweir 					}
472*cdf0e10cSrcweir 
473*cdf0e10cSrcweir 				}
474*cdf0e10cSrcweir 				// fill our own resultset
475*cdf0e10cSrcweir                 ODatabaseMetaDataResultSet* pNewPrivRes = new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eTablePrivileges );
476*cdf0e10cSrcweir 				Reference< XResultSet > xTemp = xReturn;
477*cdf0e10cSrcweir 				xReturn = pNewPrivRes;
478*cdf0e10cSrcweir 				ODatabaseMetaDataResultSet::ORows aRows;
479*cdf0e10cSrcweir 				Reference< XRow > xRow(xTemp,UNO_QUERY);
480*cdf0e10cSrcweir 				::rtl::OUString sValue;
481*cdf0e10cSrcweir 
482*cdf0e10cSrcweir 				ODatabaseMetaDataResultSet::ORow aRow(8);
483*cdf0e10cSrcweir 				while ( xRow.is() && xTemp->next() )
484*cdf0e10cSrcweir 				{
485*cdf0e10cSrcweir 					::std::map<sal_Int32,sal_Int32>::iterator aIter = aColumnMatching.begin();
486*cdf0e10cSrcweir 					::std::map<sal_Int32,sal_Int32>::iterator aEnd  = aColumnMatching.end();
487*cdf0e10cSrcweir 					for (;aIter != aEnd ; ++aIter)
488*cdf0e10cSrcweir 					{
489*cdf0e10cSrcweir 						sValue = xRow->getString(aIter->first);
490*cdf0e10cSrcweir 						if ( xRow->wasNull() )
491*cdf0e10cSrcweir 							aRow[aIter->second] = ODatabaseMetaDataResultSet::getEmptyValue();
492*cdf0e10cSrcweir 						else
493*cdf0e10cSrcweir 							aRow[aIter->second] = new ORowSetValueDecorator(sValue);
494*cdf0e10cSrcweir 					}
495*cdf0e10cSrcweir 
496*cdf0e10cSrcweir 					aRows.push_back(aRow);
497*cdf0e10cSrcweir 				}
498*cdf0e10cSrcweir 				pNewPrivRes->setRows(aRows);
499*cdf0e10cSrcweir 			}
500*cdf0e10cSrcweir 		}
501*cdf0e10cSrcweir 	}
502*cdf0e10cSrcweir 	return xReturn;
503*cdf0e10cSrcweir }
504*cdf0e10cSrcweir // -------------------------------------------------------------------------
505*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getCrossReference(
506*cdf0e10cSrcweir         const Any& primaryCatalog, const ::rtl::OUString& primarySchema,
507*cdf0e10cSrcweir         const ::rtl::OUString& primaryTable, const Any& foreignCatalog,
508*cdf0e10cSrcweir         const ::rtl::OUString& foreignSchema, const ::rtl::OUString& foreignTable ) throw(SQLException, RuntimeException)
509*cdf0e10cSrcweir {
510*cdf0e10cSrcweir 	static const char * cSignature = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/sql/ResultSet;";
511*cdf0e10cSrcweir 	static const char * cMethodName = "getCrossReference";
512*cdf0e10cSrcweir     m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, cMethodName );
513*cdf0e10cSrcweir 
514*cdf0e10cSrcweir     jobject out(0);
515*cdf0e10cSrcweir     SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
516*cdf0e10cSrcweir 	{
517*cdf0e10cSrcweir 
518*cdf0e10cSrcweir 		// Java-Call absetzen
519*cdf0e10cSrcweir 		static jmethodID mID(NULL);
520*cdf0e10cSrcweir         obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
521*cdf0e10cSrcweir 		jvalue args[6];
522*cdf0e10cSrcweir 		// Parameter konvertieren
523*cdf0e10cSrcweir 		args[0].l = primaryCatalog.hasValue() ? convertwchar_tToJavaString(t.pEnv,comphelper::getString(primaryCatalog)) : 0;
524*cdf0e10cSrcweir 		args[1].l = primarySchema.toChar() == '%' ? NULL : convertwchar_tToJavaString(t.pEnv,primarySchema);
525*cdf0e10cSrcweir 		args[2].l = convertwchar_tToJavaString(t.pEnv,primaryTable);
526*cdf0e10cSrcweir 		args[3].l = foreignCatalog.hasValue() ? convertwchar_tToJavaString(t.pEnv,comphelper::getString(foreignCatalog)) : 0;
527*cdf0e10cSrcweir 		args[4].l = foreignSchema.toChar() == '%' ? NULL : convertwchar_tToJavaString(t.pEnv,foreignSchema);
528*cdf0e10cSrcweir 		args[5].l = convertwchar_tToJavaString(t.pEnv,foreignTable);
529*cdf0e10cSrcweir 		out = t.pEnv->CallObjectMethod( object, mID, args[0].l,args[2].l,args[2].l,args[3].l,args[4].l,args[5].l );
530*cdf0e10cSrcweir 
531*cdf0e10cSrcweir 		// und aufraeumen
532*cdf0e10cSrcweir 		if(primaryCatalog.hasValue())
533*cdf0e10cSrcweir 			t.pEnv->DeleteLocalRef((jstring)args[0].l);
534*cdf0e10cSrcweir 		if(args[1].l)
535*cdf0e10cSrcweir 			t.pEnv->DeleteLocalRef((jstring)args[1].l);
536*cdf0e10cSrcweir 		if(primaryTable.getLength())
537*cdf0e10cSrcweir 			t.pEnv->DeleteLocalRef((jstring)args[2].l);
538*cdf0e10cSrcweir 		if(foreignCatalog.hasValue())
539*cdf0e10cSrcweir 			t.pEnv->DeleteLocalRef((jstring)args[3].l);
540*cdf0e10cSrcweir 		if(args[4].l)
541*cdf0e10cSrcweir 			t.pEnv->DeleteLocalRef((jstring)args[4].l);
542*cdf0e10cSrcweir 		if(foreignTable.getLength())
543*cdf0e10cSrcweir 			t.pEnv->DeleteLocalRef((jstring)args[5].l);
544*cdf0e10cSrcweir 		ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
545*cdf0e10cSrcweir 	}
546*cdf0e10cSrcweir 
547*cdf0e10cSrcweir     if ( !out )
548*cdf0e10cSrcweir         return NULL;
549*cdf0e10cSrcweir 
550*cdf0e10cSrcweir     m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_SUCCESS, cMethodName );
551*cdf0e10cSrcweir 	return new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection);
552*cdf0e10cSrcweir }
553*cdf0e10cSrcweir 
554*cdf0e10cSrcweir // -------------------------------------------------------------------------
555*cdf0e10cSrcweir sal_Bool java_sql_DatabaseMetaData::impl_callBooleanMethod( const char* _pMethodName, jmethodID& _inout_MethodID )
556*cdf0e10cSrcweir {
557*cdf0e10cSrcweir     m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, _pMethodName );
558*cdf0e10cSrcweir 	jboolean out( java_lang_Object::callBooleanMethod(_pMethodName,_inout_MethodID) );
559*cdf0e10cSrcweir     m_aLogger.log< const sal_Char*, sal_Int16>( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, _pMethodName, out );
560*cdf0e10cSrcweir 	return out;
561*cdf0e10cSrcweir }
562*cdf0e10cSrcweir 
563*cdf0e10cSrcweir // -------------------------------------------------------------------------
564*cdf0e10cSrcweir ::rtl::OUString java_sql_DatabaseMetaData::impl_callStringMethod( const char* _pMethodName, jmethodID& _inout_MethodID )
565*cdf0e10cSrcweir {
566*cdf0e10cSrcweir     m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, _pMethodName );
567*cdf0e10cSrcweir 
568*cdf0e10cSrcweir 	const ::rtl::OUString sReturn( callStringMethod(_pMethodName,_inout_MethodID) );
569*cdf0e10cSrcweir     if ( m_aLogger.isLoggable( LogLevel::FINEST ) )
570*cdf0e10cSrcweir     {
571*cdf0e10cSrcweir         ::rtl::OUString sLoggedResult( sReturn );
572*cdf0e10cSrcweir         if ( !sLoggedResult.getLength() )
573*cdf0e10cSrcweir             sLoggedResult = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "<empty string>" ) );
574*cdf0e10cSrcweir         m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, _pMethodName, sLoggedResult );
575*cdf0e10cSrcweir     }
576*cdf0e10cSrcweir 
577*cdf0e10cSrcweir     return sReturn;
578*cdf0e10cSrcweir }
579*cdf0e10cSrcweir 
580*cdf0e10cSrcweir // -------------------------------------------------------------------------
581*cdf0e10cSrcweir sal_Int32 java_sql_DatabaseMetaData::impl_callIntMethod( const char* _pMethodName, jmethodID& _inout_MethodID )
582*cdf0e10cSrcweir {
583*cdf0e10cSrcweir     m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, _pMethodName );
584*cdf0e10cSrcweir     sal_Int32 out( (sal_Int32)callIntMethod(_pMethodName,_inout_MethodID) );
585*cdf0e10cSrcweir     m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, _pMethodName, (sal_Int32)out );
586*cdf0e10cSrcweir 	return out;
587*cdf0e10cSrcweir }
588*cdf0e10cSrcweir 
589*cdf0e10cSrcweir // -------------------------------------------------------------------------
590*cdf0e10cSrcweir sal_Bool java_sql_DatabaseMetaData::impl_callBooleanMethodWithIntArg( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument )
591*cdf0e10cSrcweir {
592*cdf0e10cSrcweir     m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD_ARG1, _pMethodName, _nArgument );
593*cdf0e10cSrcweir 
594*cdf0e10cSrcweir 	jboolean out( callBooleanMethodWithIntArg(_pMethodName,_inout_MethodID,_nArgument) );
595*cdf0e10cSrcweir 
596*cdf0e10cSrcweir     m_aLogger.log< const sal_Char*, sal_Int16 >( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, _pMethodName, out );
597*cdf0e10cSrcweir 	return out;
598*cdf0e10cSrcweir }
599*cdf0e10cSrcweir 
600*cdf0e10cSrcweir // -------------------------------------------------------------------------
601*cdf0e10cSrcweir Reference< XResultSet > java_sql_DatabaseMetaData::impl_callResultSetMethod( const char* _pMethodName, jmethodID& _inout_MethodID )
602*cdf0e10cSrcweir {
603*cdf0e10cSrcweir     SDBThreadAttach t;
604*cdf0e10cSrcweir     m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, _pMethodName );
605*cdf0e10cSrcweir     jobject out(callResultSetMethod(t.env(),_pMethodName,_inout_MethodID));
606*cdf0e10cSrcweir     m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_SUCCESS, _pMethodName );
607*cdf0e10cSrcweir     return new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection);
608*cdf0e10cSrcweir }
609*cdf0e10cSrcweir 
610*cdf0e10cSrcweir // -------------------------------------------------------------------------
611*cdf0e10cSrcweir Reference< XResultSet > java_sql_DatabaseMetaData::impl_callResultSetMethodWithStrings( const char* _pMethodName, jmethodID& _inout_MethodID,
612*cdf0e10cSrcweir     const Any& _rCatalog, const ::rtl::OUString& _rSchemaPattern, const ::rtl::OUString& _rLeastPattern,
613*cdf0e10cSrcweir     const ::rtl::OUString* _pOptionalAdditionalString )
614*cdf0e10cSrcweir {
615*cdf0e10cSrcweir     bool bCatalog = _rCatalog.hasValue();
616*cdf0e10cSrcweir     ::rtl::OUString sCatalog;
617*cdf0e10cSrcweir     _rCatalog >>= sCatalog;
618*cdf0e10cSrcweir 
619*cdf0e10cSrcweir     bool bSchema = _rSchemaPattern.toChar() != '%';
620*cdf0e10cSrcweir 
621*cdf0e10cSrcweir     // log the call
622*cdf0e10cSrcweir     if ( m_aLogger.isLoggable( LogLevel::FINEST ) )
623*cdf0e10cSrcweir     {
624*cdf0e10cSrcweir         ::rtl::OUString sCatalogLog = bCatalog ? sCatalog : ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "null" ) );
625*cdf0e10cSrcweir         ::rtl::OUString sSchemaLog = bSchema ? _rSchemaPattern : ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "null" ) );
626*cdf0e10cSrcweir         if ( _pOptionalAdditionalString )
627*cdf0e10cSrcweir             m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD_ARG4, _pMethodName, sCatalogLog, sSchemaLog, _rLeastPattern, *_pOptionalAdditionalString );
628*cdf0e10cSrcweir         else
629*cdf0e10cSrcweir             m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD_ARG3, _pMethodName, sCatalogLog, sSchemaLog, _rLeastPattern );
630*cdf0e10cSrcweir     }
631*cdf0e10cSrcweir 
632*cdf0e10cSrcweir     jobject out(0);
633*cdf0e10cSrcweir 
634*cdf0e10cSrcweir     SDBThreadAttach t;
635*cdf0e10cSrcweir     OSL_ENSURE( t.pEnv, "java_sql_DatabaseMetaData::impl_callResultSetMethodWithStrings: no Java enviroment anymore!" );
636*cdf0e10cSrcweir 
637*cdf0e10cSrcweir     {
638*cdf0e10cSrcweir         const  char* pSignature = _pOptionalAdditionalString
639*cdf0e10cSrcweir             ?   "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/sql/ResultSet;"
640*cdf0e10cSrcweir             :   "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/sql/ResultSet;";
641*cdf0e10cSrcweir         // obtain method ID
642*cdf0e10cSrcweir         obtainMethodId(t.pEnv, _pMethodName,pSignature, _inout_MethodID);
643*cdf0e10cSrcweir 
644*cdf0e10cSrcweir         // call method
645*cdf0e10cSrcweir 
646*cdf0e10cSrcweir         {
647*cdf0e10cSrcweir             jvalue args[4];
648*cdf0e10cSrcweir             // convert parameters
649*cdf0e10cSrcweir             args[0].l = bCatalog ? convertwchar_tToJavaString( t.pEnv, sCatalog ) : NULL;
650*cdf0e10cSrcweir             args[1].l = bSchema ? convertwchar_tToJavaString( t.pEnv, _rSchemaPattern ) : NULL;
651*cdf0e10cSrcweir 			args[2].l = convertwchar_tToJavaString( t.pEnv, _rLeastPattern );
652*cdf0e10cSrcweir             args[3].l = _pOptionalAdditionalString ? convertwchar_tToJavaString( t.pEnv, *_pOptionalAdditionalString ) : NULL;
653*cdf0e10cSrcweir 
654*cdf0e10cSrcweir             // actually do the call
655*cdf0e10cSrcweir             if ( _pOptionalAdditionalString )
656*cdf0e10cSrcweir 			    out = t.pEnv->CallObjectMethod( object, _inout_MethodID, args[0].l, args[1].l, args[2].l, args[3].l );
657*cdf0e10cSrcweir             else
658*cdf0e10cSrcweir 			    out = t.pEnv->CallObjectMethod( object, _inout_MethodID, args[0].l, args[1].l, args[2].l );
659*cdf0e10cSrcweir 
660*cdf0e10cSrcweir 			// clean up
661*cdf0e10cSrcweir 			if ( args[0].l )
662*cdf0e10cSrcweir 				t.pEnv->DeleteLocalRef( (jstring)args[0].l );
663*cdf0e10cSrcweir 			if ( args[1].l )
664*cdf0e10cSrcweir 				t.pEnv->DeleteLocalRef( (jstring)args[1].l );
665*cdf0e10cSrcweir 			if ( args[2].l )
666*cdf0e10cSrcweir 				t.pEnv->DeleteLocalRef( (jstring)args[2].l );
667*cdf0e10cSrcweir             if ( args[3].l )
668*cdf0e10cSrcweir 				t.pEnv->DeleteLocalRef( (jstring)args[3].l );
669*cdf0e10cSrcweir 
670*cdf0e10cSrcweir 			ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
671*cdf0e10cSrcweir 		}
672*cdf0e10cSrcweir     }
673*cdf0e10cSrcweir 
674*cdf0e10cSrcweir     if ( !out )
675*cdf0e10cSrcweir         return NULL;
676*cdf0e10cSrcweir 
677*cdf0e10cSrcweir     m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_SUCCESS, _pMethodName );
678*cdf0e10cSrcweir     return new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection);
679*cdf0e10cSrcweir }
680*cdf0e10cSrcweir 
681*cdf0e10cSrcweir // -------------------------------------------------------------------------
682*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::doesMaxRowSizeIncludeBlobs(  ) throw(SQLException, RuntimeException)
683*cdf0e10cSrcweir {
684*cdf0e10cSrcweir 	static jmethodID mID(NULL);
685*cdf0e10cSrcweir     return impl_callBooleanMethod( "doesMaxRowSizeIncludeBlobs", mID );
686*cdf0e10cSrcweir }
687*cdf0e10cSrcweir // -------------------------------------------------------------------------
688*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::storesLowerCaseQuotedIdentifiers(  ) throw(SQLException, RuntimeException)
689*cdf0e10cSrcweir {
690*cdf0e10cSrcweir 	static jmethodID mID(NULL);
691*cdf0e10cSrcweir     return impl_callBooleanMethod( "storesLowerCaseQuotedIdentifiers", mID );
692*cdf0e10cSrcweir }
693*cdf0e10cSrcweir // -------------------------------------------------------------------------
694*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::storesLowerCaseIdentifiers(  ) throw(SQLException, RuntimeException)
695*cdf0e10cSrcweir {
696*cdf0e10cSrcweir 	static jmethodID mID(NULL);
697*cdf0e10cSrcweir     return impl_callBooleanMethod( "storesLowerCaseIdentifiers", mID );
698*cdf0e10cSrcweir }
699*cdf0e10cSrcweir // -------------------------------------------------------------------------
700*cdf0e10cSrcweir sal_Bool java_sql_DatabaseMetaData::impl_storesMixedCaseQuotedIdentifiers_throw(  )
701*cdf0e10cSrcweir {
702*cdf0e10cSrcweir 	static jmethodID mID(NULL);
703*cdf0e10cSrcweir     return impl_callBooleanMethod( "storesMixedCaseQuotedIdentifiers", mID );
704*cdf0e10cSrcweir }
705*cdf0e10cSrcweir // -------------------------------------------------------------------------
706*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::storesMixedCaseIdentifiers(  ) throw(SQLException, RuntimeException)
707*cdf0e10cSrcweir {
708*cdf0e10cSrcweir 	static jmethodID mID(NULL);
709*cdf0e10cSrcweir     return impl_callBooleanMethod( "storesMixedCaseIdentifiers", mID );
710*cdf0e10cSrcweir }
711*cdf0e10cSrcweir // -------------------------------------------------------------------------
712*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::storesUpperCaseQuotedIdentifiers(  ) throw(SQLException, RuntimeException)
713*cdf0e10cSrcweir {
714*cdf0e10cSrcweir 	static jmethodID mID(NULL);
715*cdf0e10cSrcweir     return impl_callBooleanMethod( "storesUpperCaseQuotedIdentifiers", mID );
716*cdf0e10cSrcweir }
717*cdf0e10cSrcweir // -------------------------------------------------------------------------
718*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::storesUpperCaseIdentifiers(  ) throw(SQLException, RuntimeException)
719*cdf0e10cSrcweir {
720*cdf0e10cSrcweir 	static jmethodID mID(NULL);
721*cdf0e10cSrcweir     return impl_callBooleanMethod( "storesUpperCaseIdentifiers", mID );
722*cdf0e10cSrcweir }
723*cdf0e10cSrcweir // -------------------------------------------------------------------------
724*cdf0e10cSrcweir sal_Bool java_sql_DatabaseMetaData::impl_supportsAlterTableWithAddColumn_throw(  )
725*cdf0e10cSrcweir {
726*cdf0e10cSrcweir 	static jmethodID mID(NULL);
727*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsAlterTableWithAddColumn", mID );
728*cdf0e10cSrcweir }
729*cdf0e10cSrcweir // -------------------------------------------------------------------------
730*cdf0e10cSrcweir sal_Bool java_sql_DatabaseMetaData::impl_supportsAlterTableWithDropColumn_throw(  )
731*cdf0e10cSrcweir {
732*cdf0e10cSrcweir 	static jmethodID mID(NULL);
733*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsAlterTableWithDropColumn", mID );
734*cdf0e10cSrcweir }
735*cdf0e10cSrcweir // -------------------------------------------------------------------------
736*cdf0e10cSrcweir sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxIndexLength(  ) throw(SQLException, RuntimeException)
737*cdf0e10cSrcweir {
738*cdf0e10cSrcweir 	static jmethodID mID(NULL);
739*cdf0e10cSrcweir     return impl_callIntMethod( "getMaxIndexLength", mID );
740*cdf0e10cSrcweir }
741*cdf0e10cSrcweir // -------------------------------------------------------------------------
742*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsNonNullableColumns(  ) throw(SQLException, RuntimeException)
743*cdf0e10cSrcweir {
744*cdf0e10cSrcweir 	static jmethodID mID(NULL);
745*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsNonNullableColumns", mID );
746*cdf0e10cSrcweir }
747*cdf0e10cSrcweir // -------------------------------------------------------------------------
748*cdf0e10cSrcweir ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getCatalogTerm(  ) throw(SQLException, RuntimeException)
749*cdf0e10cSrcweir {
750*cdf0e10cSrcweir 	static jmethodID mID(NULL);
751*cdf0e10cSrcweir     return impl_callStringMethod( "getCatalogTerm", mID );
752*cdf0e10cSrcweir }
753*cdf0e10cSrcweir // -------------------------------------------------------------------------
754*cdf0e10cSrcweir ::rtl::OUString java_sql_DatabaseMetaData::impl_getIdentifierQuoteString_throw(  )
755*cdf0e10cSrcweir {
756*cdf0e10cSrcweir 	static jmethodID mID(NULL);
757*cdf0e10cSrcweir     return impl_callStringMethod( "getIdentifierQuoteString", mID );
758*cdf0e10cSrcweir }
759*cdf0e10cSrcweir // -------------------------------------------------------------------------
760*cdf0e10cSrcweir ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getExtraNameCharacters(  ) throw(SQLException, RuntimeException)
761*cdf0e10cSrcweir {
762*cdf0e10cSrcweir 	static jmethodID mID(NULL);
763*cdf0e10cSrcweir     return impl_callStringMethod( "getExtraNameCharacters", mID );
764*cdf0e10cSrcweir }
765*cdf0e10cSrcweir // -------------------------------------------------------------------------
766*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsDifferentTableCorrelationNames(  ) throw(SQLException, RuntimeException)
767*cdf0e10cSrcweir {
768*cdf0e10cSrcweir 	static jmethodID mID(NULL);
769*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsDifferentTableCorrelationNames", mID );
770*cdf0e10cSrcweir }
771*cdf0e10cSrcweir // -------------------------------------------------------------------------
772*cdf0e10cSrcweir sal_Bool java_sql_DatabaseMetaData::impl_isCatalogAtStart_throw(  )
773*cdf0e10cSrcweir {
774*cdf0e10cSrcweir 	static jmethodID mID(NULL);
775*cdf0e10cSrcweir     return impl_callBooleanMethod( "isCatalogAtStart", mID );
776*cdf0e10cSrcweir }
777*cdf0e10cSrcweir // -------------------------------------------------------------------------
778*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::dataDefinitionIgnoredInTransactions(  ) throw(SQLException, RuntimeException)
779*cdf0e10cSrcweir {
780*cdf0e10cSrcweir 	static jmethodID mID(NULL);
781*cdf0e10cSrcweir     return impl_callBooleanMethod( "dataDefinitionIgnoredInTransactions", mID );
782*cdf0e10cSrcweir }
783*cdf0e10cSrcweir // -------------------------------------------------------------------------
784*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::dataDefinitionCausesTransactionCommit(  ) throw(SQLException, RuntimeException)
785*cdf0e10cSrcweir {
786*cdf0e10cSrcweir 	static jmethodID mID(NULL);
787*cdf0e10cSrcweir     return impl_callBooleanMethod( "dataDefinitionCausesTransactionCommit", mID );
788*cdf0e10cSrcweir }
789*cdf0e10cSrcweir // -------------------------------------------------------------------------
790*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsDataManipulationTransactionsOnly(  ) throw(SQLException, RuntimeException)
791*cdf0e10cSrcweir {
792*cdf0e10cSrcweir 	static jmethodID mID(NULL);
793*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsDataManipulationTransactionsOnly", mID );
794*cdf0e10cSrcweir }
795*cdf0e10cSrcweir // -------------------------------------------------------------------------
796*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions(  ) throw(SQLException, RuntimeException)
797*cdf0e10cSrcweir {
798*cdf0e10cSrcweir 	static jmethodID mID(NULL);
799*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsDataDefinitionAndDataManipulationTransactions", mID );
800*cdf0e10cSrcweir }
801*cdf0e10cSrcweir // -------------------------------------------------------------------------
802*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsPositionedDelete(  ) throw(SQLException, RuntimeException)
803*cdf0e10cSrcweir {
804*cdf0e10cSrcweir 	static jmethodID mID(NULL);
805*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsPositionedDelete", mID );
806*cdf0e10cSrcweir }
807*cdf0e10cSrcweir // -------------------------------------------------------------------------
808*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsPositionedUpdate(  ) throw(SQLException, RuntimeException)
809*cdf0e10cSrcweir {
810*cdf0e10cSrcweir 	static jmethodID mID(NULL);
811*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsPositionedUpdate", mID );
812*cdf0e10cSrcweir }
813*cdf0e10cSrcweir // -------------------------------------------------------------------------
814*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsOpenStatementsAcrossRollback(  ) throw(SQLException, RuntimeException)
815*cdf0e10cSrcweir {
816*cdf0e10cSrcweir 	static jmethodID mID(NULL);
817*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsOpenStatementsAcrossRollback", mID );
818*cdf0e10cSrcweir }
819*cdf0e10cSrcweir // -------------------------------------------------------------------------
820*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsOpenStatementsAcrossCommit(  ) throw(SQLException, RuntimeException)
821*cdf0e10cSrcweir {
822*cdf0e10cSrcweir 	static jmethodID mID(NULL);
823*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsOpenStatementsAcrossCommit", mID );
824*cdf0e10cSrcweir }
825*cdf0e10cSrcweir // -------------------------------------------------------------------------
826*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsOpenCursorsAcrossCommit(  ) throw(SQLException, RuntimeException)
827*cdf0e10cSrcweir {
828*cdf0e10cSrcweir 	static jmethodID mID(NULL);
829*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsOpenCursorsAcrossCommit", mID );
830*cdf0e10cSrcweir }
831*cdf0e10cSrcweir // -------------------------------------------------------------------------
832*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsOpenCursorsAcrossRollback(  ) throw(SQLException, RuntimeException)
833*cdf0e10cSrcweir {
834*cdf0e10cSrcweir 	static jmethodID mID(NULL);
835*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsOpenCursorsAcrossRollback", mID );
836*cdf0e10cSrcweir }
837*cdf0e10cSrcweir // -------------------------------------------------------------------------
838*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsTransactionIsolationLevel( sal_Int32 level ) throw(SQLException, RuntimeException)
839*cdf0e10cSrcweir {
840*cdf0e10cSrcweir 	static jmethodID mID(NULL);
841*cdf0e10cSrcweir     return impl_callBooleanMethodWithIntArg( "supportsTransactionIsolationLevel", mID, level );
842*cdf0e10cSrcweir }
843*cdf0e10cSrcweir // -------------------------------------------------------------------------
844*cdf0e10cSrcweir sal_Bool java_sql_DatabaseMetaData::impl_supportsSchemasInDataManipulation_throw(  )
845*cdf0e10cSrcweir {
846*cdf0e10cSrcweir 	static jmethodID mID(NULL);
847*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsSchemasInDataManipulation", mID );
848*cdf0e10cSrcweir }
849*cdf0e10cSrcweir // -------------------------------------------------------------------------
850*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsANSI92FullSQL(  ) throw(SQLException, RuntimeException)
851*cdf0e10cSrcweir {
852*cdf0e10cSrcweir 	static jmethodID mID(NULL);
853*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsANSI92FullSQL", mID );
854*cdf0e10cSrcweir }
855*cdf0e10cSrcweir // -------------------------------------------------------------------------
856*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsANSI92EntryLevelSQL(  ) throw(SQLException, RuntimeException)
857*cdf0e10cSrcweir {
858*cdf0e10cSrcweir 	static jmethodID mID(NULL);
859*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsANSI92EntryLevelSQL", mID );
860*cdf0e10cSrcweir }
861*cdf0e10cSrcweir // -------------------------------------------------------------------------
862*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsIntegrityEnhancementFacility(  ) throw(SQLException, RuntimeException)
863*cdf0e10cSrcweir {
864*cdf0e10cSrcweir 	static jmethodID mID(NULL);
865*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsIntegrityEnhancementFacility", mID );
866*cdf0e10cSrcweir }
867*cdf0e10cSrcweir // -------------------------------------------------------------------------
868*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSchemasInIndexDefinitions(  ) throw(SQLException, RuntimeException)
869*cdf0e10cSrcweir {
870*cdf0e10cSrcweir 	static jmethodID mID(NULL);
871*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsSchemasInIndexDefinitions", mID );
872*cdf0e10cSrcweir }
873*cdf0e10cSrcweir // -------------------------------------------------------------------------
874*cdf0e10cSrcweir sal_Bool java_sql_DatabaseMetaData::impl_supportsSchemasInTableDefinitions_throw(  )
875*cdf0e10cSrcweir {
876*cdf0e10cSrcweir 	static jmethodID mID(NULL);
877*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsSchemasInTableDefinitions", mID );
878*cdf0e10cSrcweir }
879*cdf0e10cSrcweir // -------------------------------------------------------------------------
880*cdf0e10cSrcweir sal_Bool java_sql_DatabaseMetaData::impl_supportsCatalogsInTableDefinitions_throw(  )
881*cdf0e10cSrcweir {
882*cdf0e10cSrcweir 	static jmethodID mID(NULL);
883*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsCatalogsInTableDefinitions", mID );
884*cdf0e10cSrcweir }
885*cdf0e10cSrcweir // -------------------------------------------------------------------------
886*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsCatalogsInIndexDefinitions(  ) throw(SQLException, RuntimeException)
887*cdf0e10cSrcweir {
888*cdf0e10cSrcweir 	static jmethodID mID(NULL);
889*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsCatalogsInIndexDefinitions", mID );
890*cdf0e10cSrcweir }
891*cdf0e10cSrcweir // -------------------------------------------------------------------------
892*cdf0e10cSrcweir sal_Bool java_sql_DatabaseMetaData::impl_supportsCatalogsInDataManipulation_throw(  )
893*cdf0e10cSrcweir {
894*cdf0e10cSrcweir 	static jmethodID mID(NULL);
895*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsCatalogsInDataManipulation", mID );
896*cdf0e10cSrcweir }
897*cdf0e10cSrcweir // -------------------------------------------------------------------------
898*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsOuterJoins(  ) throw(SQLException, RuntimeException)
899*cdf0e10cSrcweir {
900*cdf0e10cSrcweir 	static jmethodID mID(NULL);
901*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsOuterJoins", mID );
902*cdf0e10cSrcweir }
903*cdf0e10cSrcweir // -------------------------------------------------------------------------
904*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTableTypes(  ) throw(SQLException, RuntimeException)
905*cdf0e10cSrcweir {
906*cdf0e10cSrcweir 	static jmethodID mID(NULL);
907*cdf0e10cSrcweir     return impl_callResultSetMethod( "getTableTypes", mID );
908*cdf0e10cSrcweir }
909*cdf0e10cSrcweir // -------------------------------------------------------------------------
910*cdf0e10cSrcweir sal_Int32 java_sql_DatabaseMetaData::impl_getMaxStatements_throw(  )
911*cdf0e10cSrcweir {
912*cdf0e10cSrcweir 	static jmethodID mID(NULL);
913*cdf0e10cSrcweir     return impl_callIntMethod( "getMaxStatements", mID );
914*cdf0e10cSrcweir }
915*cdf0e10cSrcweir // -------------------------------------------------------------------------
916*cdf0e10cSrcweir sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxProcedureNameLength(  ) throw(SQLException, RuntimeException)
917*cdf0e10cSrcweir {
918*cdf0e10cSrcweir 	static jmethodID mID(NULL);
919*cdf0e10cSrcweir     return impl_callIntMethod( "getMaxProcedureNameLength", mID );
920*cdf0e10cSrcweir }
921*cdf0e10cSrcweir // -------------------------------------------------------------------------
922*cdf0e10cSrcweir sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxSchemaNameLength(  ) throw(SQLException, RuntimeException)
923*cdf0e10cSrcweir {
924*cdf0e10cSrcweir 	static jmethodID mID(NULL);
925*cdf0e10cSrcweir     return impl_callIntMethod( "getMaxSchemaNameLength", mID );
926*cdf0e10cSrcweir }
927*cdf0e10cSrcweir // -------------------------------------------------------------------------
928*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsTransactions(  ) throw(SQLException, RuntimeException)
929*cdf0e10cSrcweir {
930*cdf0e10cSrcweir 	static jmethodID mID(NULL);
931*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsTransactions", mID );
932*cdf0e10cSrcweir }
933*cdf0e10cSrcweir 
934*cdf0e10cSrcweir // -------------------------------------------------------------------------
935*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::allProceduresAreCallable(  ) throw(SQLException, RuntimeException)
936*cdf0e10cSrcweir {
937*cdf0e10cSrcweir 	static jmethodID mID(NULL);
938*cdf0e10cSrcweir     return impl_callBooleanMethod( "allProceduresAreCallable", mID );
939*cdf0e10cSrcweir }
940*cdf0e10cSrcweir // -------------------------------------------------------------------------
941*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsStoredProcedures(  ) throw(SQLException, RuntimeException)
942*cdf0e10cSrcweir {
943*cdf0e10cSrcweir 	static jmethodID mID(NULL);
944*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsStoredProcedures", mID );
945*cdf0e10cSrcweir }
946*cdf0e10cSrcweir // -------------------------------------------------------------------------
947*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSelectForUpdate(  ) throw(SQLException, RuntimeException)
948*cdf0e10cSrcweir {
949*cdf0e10cSrcweir 	static jmethodID mID(NULL);
950*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsSelectForUpdate", mID );
951*cdf0e10cSrcweir }
952*cdf0e10cSrcweir // -------------------------------------------------------------------------
953*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::allTablesAreSelectable(  ) throw(SQLException, RuntimeException)
954*cdf0e10cSrcweir {
955*cdf0e10cSrcweir 	static jmethodID mID(NULL);
956*cdf0e10cSrcweir     return impl_callBooleanMethod( "allTablesAreSelectable", mID );
957*cdf0e10cSrcweir }
958*cdf0e10cSrcweir // -------------------------------------------------------------------------
959*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::isReadOnly(  ) throw(SQLException, RuntimeException)
960*cdf0e10cSrcweir {
961*cdf0e10cSrcweir 	static jmethodID mID(NULL);
962*cdf0e10cSrcweir     return impl_callBooleanMethod( "isReadOnly", mID );
963*cdf0e10cSrcweir }
964*cdf0e10cSrcweir // -------------------------------------------------------------------------
965*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::usesLocalFiles(  ) throw(SQLException, RuntimeException)
966*cdf0e10cSrcweir {
967*cdf0e10cSrcweir 	static jmethodID mID(NULL);
968*cdf0e10cSrcweir     return impl_callBooleanMethod( "usesLocalFiles", mID );
969*cdf0e10cSrcweir }
970*cdf0e10cSrcweir // -------------------------------------------------------------------------
971*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::usesLocalFilePerTable(  ) throw(SQLException, RuntimeException)
972*cdf0e10cSrcweir {
973*cdf0e10cSrcweir 	static jmethodID mID(NULL);
974*cdf0e10cSrcweir     return impl_callBooleanMethod( "usesLocalFilePerTable", mID );
975*cdf0e10cSrcweir }
976*cdf0e10cSrcweir // -------------------------------------------------------------------------
977*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsTypeConversion(  ) throw(SQLException, RuntimeException)
978*cdf0e10cSrcweir {
979*cdf0e10cSrcweir 	static jmethodID mID(NULL);
980*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsTypeConversion", mID );
981*cdf0e10cSrcweir }
982*cdf0e10cSrcweir // -------------------------------------------------------------------------
983*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::nullPlusNonNullIsNull(  ) throw(SQLException, RuntimeException)
984*cdf0e10cSrcweir {
985*cdf0e10cSrcweir 	static jmethodID mID(NULL);
986*cdf0e10cSrcweir     return impl_callBooleanMethod( "nullPlusNonNullIsNull", mID );
987*cdf0e10cSrcweir }
988*cdf0e10cSrcweir // -------------------------------------------------------------------------
989*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsColumnAliasing(  ) throw(SQLException, RuntimeException)
990*cdf0e10cSrcweir {
991*cdf0e10cSrcweir 	static jmethodID mID(NULL);
992*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsColumnAliasing", mID );
993*cdf0e10cSrcweir }
994*cdf0e10cSrcweir // -------------------------------------------------------------------------
995*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsTableCorrelationNames(  ) throw(SQLException, RuntimeException)
996*cdf0e10cSrcweir {
997*cdf0e10cSrcweir 	static jmethodID mID(NULL);
998*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsTableCorrelationNames", mID );
999*cdf0e10cSrcweir }
1000*cdf0e10cSrcweir // -------------------------------------------------------------------------
1001*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsConvert( sal_Int32 fromType, sal_Int32 toType ) throw(SQLException, RuntimeException)
1002*cdf0e10cSrcweir {
1003*cdf0e10cSrcweir     static const char* pMethodName = "supportsConvert";
1004*cdf0e10cSrcweir     m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD_ARG2, pMethodName, fromType, toType );
1005*cdf0e10cSrcweir 
1006*cdf0e10cSrcweir     jboolean out( sal_False );
1007*cdf0e10cSrcweir 	SDBThreadAttach t;
1008*cdf0e10cSrcweir 
1009*cdf0e10cSrcweir     {
1010*cdf0e10cSrcweir         static jmethodID mID(NULL);
1011*cdf0e10cSrcweir         obtainMethodId(t.pEnv, pMethodName,"(II)Z", mID);
1012*cdf0e10cSrcweir 		out = t.pEnv->CallBooleanMethod( object, mID, fromType, toType );
1013*cdf0e10cSrcweir 		ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
1014*cdf0e10cSrcweir 	}
1015*cdf0e10cSrcweir 
1016*cdf0e10cSrcweir     m_aLogger.log< const sal_Char*, sal_Int16 >( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, pMethodName, out );
1017*cdf0e10cSrcweir     return out;
1018*cdf0e10cSrcweir }
1019*cdf0e10cSrcweir // -------------------------------------------------------------------------
1020*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsExpressionsInOrderBy(  ) throw(SQLException, RuntimeException)
1021*cdf0e10cSrcweir {
1022*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1023*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsExpressionsInOrderBy", mID );
1024*cdf0e10cSrcweir }
1025*cdf0e10cSrcweir // -------------------------------------------------------------------------
1026*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsGroupBy(  ) throw(SQLException, RuntimeException)
1027*cdf0e10cSrcweir {
1028*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1029*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsGroupBy", mID );
1030*cdf0e10cSrcweir }
1031*cdf0e10cSrcweir // -------------------------------------------------------------------------
1032*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsGroupByBeyondSelect(  ) throw(SQLException, RuntimeException)
1033*cdf0e10cSrcweir {
1034*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1035*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsGroupByBeyondSelect", mID );
1036*cdf0e10cSrcweir }
1037*cdf0e10cSrcweir // -------------------------------------------------------------------------
1038*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsGroupByUnrelated(  ) throw(SQLException, RuntimeException)
1039*cdf0e10cSrcweir {
1040*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1041*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsGroupByUnrelated", mID );
1042*cdf0e10cSrcweir }
1043*cdf0e10cSrcweir // -------------------------------------------------------------------------
1044*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsMultipleTransactions(  ) throw(SQLException, RuntimeException)
1045*cdf0e10cSrcweir {
1046*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1047*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsMultipleTransactions", mID );
1048*cdf0e10cSrcweir }
1049*cdf0e10cSrcweir // -------------------------------------------------------------------------
1050*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsMultipleResultSets(  ) throw(SQLException, RuntimeException)
1051*cdf0e10cSrcweir {
1052*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1053*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsMultipleResultSets", mID );
1054*cdf0e10cSrcweir }
1055*cdf0e10cSrcweir // -------------------------------------------------------------------------
1056*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsLikeEscapeClause(  ) throw(SQLException, RuntimeException)
1057*cdf0e10cSrcweir {
1058*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1059*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsLikeEscapeClause", mID );
1060*cdf0e10cSrcweir }
1061*cdf0e10cSrcweir // -------------------------------------------------------------------------
1062*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsOrderByUnrelated(  ) throw(SQLException, RuntimeException)
1063*cdf0e10cSrcweir {
1064*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1065*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsOrderByUnrelated", mID );
1066*cdf0e10cSrcweir }
1067*cdf0e10cSrcweir // -------------------------------------------------------------------------
1068*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsUnion(  ) throw(SQLException, RuntimeException)
1069*cdf0e10cSrcweir {
1070*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1071*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsUnion", mID );
1072*cdf0e10cSrcweir }
1073*cdf0e10cSrcweir // -------------------------------------------------------------------------
1074*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsUnionAll(  ) throw(SQLException, RuntimeException)
1075*cdf0e10cSrcweir {
1076*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1077*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsUnionAll", mID );
1078*cdf0e10cSrcweir }
1079*cdf0e10cSrcweir // -------------------------------------------------------------------------
1080*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsMixedCaseIdentifiers(  ) throw(SQLException, RuntimeException)
1081*cdf0e10cSrcweir {
1082*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1083*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsMixedCaseIdentifiers", mID );
1084*cdf0e10cSrcweir }
1085*cdf0e10cSrcweir // -------------------------------------------------------------------------
1086*cdf0e10cSrcweir sal_Bool java_sql_DatabaseMetaData::impl_supportsMixedCaseQuotedIdentifiers_throw(  )
1087*cdf0e10cSrcweir {
1088*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1089*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsMixedCaseQuotedIdentifiers", mID );
1090*cdf0e10cSrcweir }
1091*cdf0e10cSrcweir // -------------------------------------------------------------------------
1092*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::nullsAreSortedAtEnd(  ) throw(SQLException, RuntimeException)
1093*cdf0e10cSrcweir {
1094*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1095*cdf0e10cSrcweir     return impl_callBooleanMethod( "nullsAreSortedAtEnd", mID );
1096*cdf0e10cSrcweir }
1097*cdf0e10cSrcweir // -------------------------------------------------------------------------
1098*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::nullsAreSortedAtStart(  ) throw(SQLException, RuntimeException)
1099*cdf0e10cSrcweir {
1100*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1101*cdf0e10cSrcweir     return impl_callBooleanMethod( "nullsAreSortedAtStart", mID );
1102*cdf0e10cSrcweir }
1103*cdf0e10cSrcweir // -------------------------------------------------------------------------
1104*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::nullsAreSortedHigh(  ) throw(SQLException, RuntimeException)
1105*cdf0e10cSrcweir {
1106*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1107*cdf0e10cSrcweir     return impl_callBooleanMethod( "nullsAreSortedHigh", mID );
1108*cdf0e10cSrcweir }
1109*cdf0e10cSrcweir // -------------------------------------------------------------------------
1110*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::nullsAreSortedLow(  ) throw(SQLException, RuntimeException)
1111*cdf0e10cSrcweir {
1112*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1113*cdf0e10cSrcweir     return impl_callBooleanMethod( "nullsAreSortedLow", mID );
1114*cdf0e10cSrcweir }
1115*cdf0e10cSrcweir // -------------------------------------------------------------------------
1116*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSchemasInProcedureCalls(  ) throw(SQLException, RuntimeException)
1117*cdf0e10cSrcweir {
1118*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1119*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsSchemasInProcedureCalls", mID );
1120*cdf0e10cSrcweir }
1121*cdf0e10cSrcweir // -------------------------------------------------------------------------
1122*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSchemasInPrivilegeDefinitions(  ) throw(SQLException, RuntimeException)
1123*cdf0e10cSrcweir {
1124*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1125*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsSchemasInPrivilegeDefinitions", mID );
1126*cdf0e10cSrcweir }
1127*cdf0e10cSrcweir // -------------------------------------------------------------------------
1128*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsCatalogsInProcedureCalls(  ) throw(SQLException, RuntimeException)
1129*cdf0e10cSrcweir {
1130*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1131*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsCatalogsInProcedureCalls", mID );
1132*cdf0e10cSrcweir }
1133*cdf0e10cSrcweir // -------------------------------------------------------------------------
1134*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsCatalogsInPrivilegeDefinitions(  ) throw(SQLException, RuntimeException)
1135*cdf0e10cSrcweir {
1136*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1137*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsCatalogsInPrivilegeDefinitions", mID );
1138*cdf0e10cSrcweir }
1139*cdf0e10cSrcweir // -------------------------------------------------------------------------
1140*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsCorrelatedSubqueries(  ) throw(SQLException, RuntimeException)
1141*cdf0e10cSrcweir {
1142*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1143*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsCorrelatedSubqueries", mID );
1144*cdf0e10cSrcweir }
1145*cdf0e10cSrcweir // -------------------------------------------------------------------------
1146*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSubqueriesInComparisons(  ) throw(SQLException, RuntimeException)
1147*cdf0e10cSrcweir {
1148*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1149*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsSubqueriesInComparisons", mID );
1150*cdf0e10cSrcweir }
1151*cdf0e10cSrcweir // -------------------------------------------------------------------------
1152*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSubqueriesInExists(  ) throw(SQLException, RuntimeException)
1153*cdf0e10cSrcweir {
1154*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1155*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsSubqueriesInExists", mID );
1156*cdf0e10cSrcweir }
1157*cdf0e10cSrcweir // -------------------------------------------------------------------------
1158*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSubqueriesInIns(  ) throw(SQLException, RuntimeException)
1159*cdf0e10cSrcweir {
1160*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1161*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsSubqueriesInIns", mID );
1162*cdf0e10cSrcweir }
1163*cdf0e10cSrcweir // -------------------------------------------------------------------------
1164*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSubqueriesInQuantifieds(  ) throw(SQLException, RuntimeException)
1165*cdf0e10cSrcweir {
1166*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1167*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsSubqueriesInQuantifieds", mID );
1168*cdf0e10cSrcweir }
1169*cdf0e10cSrcweir // -------------------------------------------------------------------------
1170*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsANSI92IntermediateSQL(  ) throw(SQLException, RuntimeException)
1171*cdf0e10cSrcweir {
1172*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1173*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsANSI92IntermediateSQL", mID );
1174*cdf0e10cSrcweir }
1175*cdf0e10cSrcweir // -------------------------------------------------------------------------
1176*cdf0e10cSrcweir ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getURL(  ) throw(SQLException, RuntimeException)
1177*cdf0e10cSrcweir {
1178*cdf0e10cSrcweir 	::rtl::OUString sURL = m_pConnection->getURL();
1179*cdf0e10cSrcweir 	if ( !sURL.getLength() )
1180*cdf0e10cSrcweir 	{
1181*cdf0e10cSrcweir 	    static jmethodID mID(NULL);
1182*cdf0e10cSrcweir         sURL = impl_callStringMethod( "getURL", mID );
1183*cdf0e10cSrcweir 	}
1184*cdf0e10cSrcweir 	return sURL;
1185*cdf0e10cSrcweir }
1186*cdf0e10cSrcweir // -------------------------------------------------------------------------
1187*cdf0e10cSrcweir ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getUserName(  ) throw(SQLException, RuntimeException)
1188*cdf0e10cSrcweir {
1189*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1190*cdf0e10cSrcweir     return impl_callStringMethod( "getUserName", mID );
1191*cdf0e10cSrcweir }
1192*cdf0e10cSrcweir // -------------------------------------------------------------------------
1193*cdf0e10cSrcweir ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getDriverName(  ) throw(SQLException, RuntimeException)
1194*cdf0e10cSrcweir {
1195*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1196*cdf0e10cSrcweir     return impl_callStringMethod( "getDriverName", mID );
1197*cdf0e10cSrcweir }
1198*cdf0e10cSrcweir // -------------------------------------------------------------------------
1199*cdf0e10cSrcweir ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getDriverVersion(  ) throw(SQLException, RuntimeException)
1200*cdf0e10cSrcweir {
1201*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1202*cdf0e10cSrcweir     return impl_callStringMethod( "getDriverVersion", mID );
1203*cdf0e10cSrcweir }
1204*cdf0e10cSrcweir // -------------------------------------------------------------------------
1205*cdf0e10cSrcweir ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getDatabaseProductVersion(  ) throw(SQLException, RuntimeException)
1206*cdf0e10cSrcweir {
1207*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1208*cdf0e10cSrcweir     return impl_callStringMethod( "getDatabaseProductVersion", mID );
1209*cdf0e10cSrcweir }
1210*cdf0e10cSrcweir // -------------------------------------------------------------------------
1211*cdf0e10cSrcweir ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getDatabaseProductName(  ) throw(SQLException, RuntimeException)
1212*cdf0e10cSrcweir {
1213*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1214*cdf0e10cSrcweir     return impl_callStringMethod( "getDatabaseProductName", mID );
1215*cdf0e10cSrcweir }
1216*cdf0e10cSrcweir // -------------------------------------------------------------------------
1217*cdf0e10cSrcweir ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getProcedureTerm(  ) throw(SQLException, RuntimeException)
1218*cdf0e10cSrcweir {
1219*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1220*cdf0e10cSrcweir     return impl_callStringMethod( "getProcedureTerm", mID );
1221*cdf0e10cSrcweir }
1222*cdf0e10cSrcweir // -------------------------------------------------------------------------
1223*cdf0e10cSrcweir ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getSchemaTerm(  ) throw(SQLException, RuntimeException)
1224*cdf0e10cSrcweir {
1225*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1226*cdf0e10cSrcweir     return impl_callStringMethod( "getSchemaTerm", mID );
1227*cdf0e10cSrcweir }
1228*cdf0e10cSrcweir // -------------------------------------------------------------------------
1229*cdf0e10cSrcweir sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getDriverMajorVersion(  ) throw(RuntimeException)
1230*cdf0e10cSrcweir {
1231*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1232*cdf0e10cSrcweir     return impl_callIntMethod( "getDriverMajorVersion", mID );
1233*cdf0e10cSrcweir }
1234*cdf0e10cSrcweir // -------------------------------------------------------------------------
1235*cdf0e10cSrcweir sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getDefaultTransactionIsolation(  ) throw(SQLException, RuntimeException)
1236*cdf0e10cSrcweir {
1237*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1238*cdf0e10cSrcweir     return impl_callIntMethod( "getDefaultTransactionIsolation", mID );
1239*cdf0e10cSrcweir }
1240*cdf0e10cSrcweir // -------------------------------------------------------------------------
1241*cdf0e10cSrcweir sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getDriverMinorVersion(  ) throw(RuntimeException)
1242*cdf0e10cSrcweir {
1243*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1244*cdf0e10cSrcweir     return impl_callIntMethod( "getDriverMinorVersion", mID );
1245*cdf0e10cSrcweir }
1246*cdf0e10cSrcweir // -------------------------------------------------------------------------
1247*cdf0e10cSrcweir ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getSQLKeywords(  ) throw(SQLException, RuntimeException)
1248*cdf0e10cSrcweir {
1249*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1250*cdf0e10cSrcweir     return impl_callStringMethod( "getSQLKeywords", mID );
1251*cdf0e10cSrcweir }
1252*cdf0e10cSrcweir // -------------------------------------------------------------------------
1253*cdf0e10cSrcweir ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getSearchStringEscape(  ) throw(SQLException, RuntimeException)
1254*cdf0e10cSrcweir {
1255*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1256*cdf0e10cSrcweir     return impl_callStringMethod( "getSearchStringEscape", mID );
1257*cdf0e10cSrcweir }
1258*cdf0e10cSrcweir // -------------------------------------------------------------------------
1259*cdf0e10cSrcweir ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getStringFunctions(  ) throw(SQLException, RuntimeException)
1260*cdf0e10cSrcweir {
1261*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1262*cdf0e10cSrcweir     return impl_callStringMethod( "getStringFunctions", mID );
1263*cdf0e10cSrcweir }
1264*cdf0e10cSrcweir // -------------------------------------------------------------------------
1265*cdf0e10cSrcweir ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getTimeDateFunctions(  ) throw(SQLException, RuntimeException)
1266*cdf0e10cSrcweir {
1267*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1268*cdf0e10cSrcweir     return impl_callStringMethod( "getTimeDateFunctions", mID );
1269*cdf0e10cSrcweir }
1270*cdf0e10cSrcweir // -------------------------------------------------------------------------
1271*cdf0e10cSrcweir ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getSystemFunctions(  ) throw(SQLException, RuntimeException)
1272*cdf0e10cSrcweir {
1273*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1274*cdf0e10cSrcweir     return impl_callStringMethod( "getSystemFunctions", mID );
1275*cdf0e10cSrcweir }
1276*cdf0e10cSrcweir // -------------------------------------------------------------------------
1277*cdf0e10cSrcweir ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getNumericFunctions(  ) throw(SQLException, RuntimeException)
1278*cdf0e10cSrcweir {
1279*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1280*cdf0e10cSrcweir     return impl_callStringMethod( "getNumericFunctions", mID );
1281*cdf0e10cSrcweir }
1282*cdf0e10cSrcweir // -------------------------------------------------------------------------
1283*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsExtendedSQLGrammar(  ) throw(SQLException, RuntimeException)
1284*cdf0e10cSrcweir {
1285*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1286*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsExtendedSQLGrammar", mID );
1287*cdf0e10cSrcweir }
1288*cdf0e10cSrcweir // -------------------------------------------------------------------------
1289*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsCoreSQLGrammar(  ) throw(SQLException, RuntimeException)
1290*cdf0e10cSrcweir {
1291*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1292*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsCoreSQLGrammar", mID );
1293*cdf0e10cSrcweir }
1294*cdf0e10cSrcweir // -------------------------------------------------------------------------
1295*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsMinimumSQLGrammar(  ) throw(SQLException, RuntimeException)
1296*cdf0e10cSrcweir {
1297*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1298*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsMinimumSQLGrammar", mID );
1299*cdf0e10cSrcweir }
1300*cdf0e10cSrcweir // -------------------------------------------------------------------------
1301*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsFullOuterJoins(  ) throw(SQLException, RuntimeException)
1302*cdf0e10cSrcweir {
1303*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1304*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsFullOuterJoins", mID );
1305*cdf0e10cSrcweir }
1306*cdf0e10cSrcweir // -------------------------------------------------------------------------
1307*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsLimitedOuterJoins(  ) throw(SQLException, RuntimeException)
1308*cdf0e10cSrcweir {
1309*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1310*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsLimitedOuterJoins", mID );
1311*cdf0e10cSrcweir }
1312*cdf0e10cSrcweir // -------------------------------------------------------------------------
1313*cdf0e10cSrcweir sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnsInGroupBy(  ) throw(SQLException, RuntimeException)
1314*cdf0e10cSrcweir {
1315*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1316*cdf0e10cSrcweir     return impl_callIntMethod( "getMaxColumnsInGroupBy", mID );
1317*cdf0e10cSrcweir }
1318*cdf0e10cSrcweir // -------------------------------------------------------------------------
1319*cdf0e10cSrcweir sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnsInOrderBy(  ) throw(SQLException, RuntimeException)
1320*cdf0e10cSrcweir {
1321*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1322*cdf0e10cSrcweir     return impl_callIntMethod( "getMaxColumnsInOrderBy", mID );
1323*cdf0e10cSrcweir }
1324*cdf0e10cSrcweir // -------------------------------------------------------------------------
1325*cdf0e10cSrcweir sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnsInSelect(  ) throw(SQLException, RuntimeException)
1326*cdf0e10cSrcweir {
1327*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1328*cdf0e10cSrcweir     return impl_callIntMethod( "getMaxColumnsInSelect", mID );
1329*cdf0e10cSrcweir }
1330*cdf0e10cSrcweir // -------------------------------------------------------------------------
1331*cdf0e10cSrcweir sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxUserNameLength(  ) throw(SQLException, RuntimeException)
1332*cdf0e10cSrcweir {
1333*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1334*cdf0e10cSrcweir     return impl_callIntMethod( "getMaxUserNameLength", mID );
1335*cdf0e10cSrcweir }
1336*cdf0e10cSrcweir // -------------------------------------------------------------------------
1337*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsResultSetType( sal_Int32 setType ) throw(SQLException, RuntimeException)
1338*cdf0e10cSrcweir {
1339*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1340*cdf0e10cSrcweir     return impl_callBooleanMethodWithIntArg( "supportsResultSetType", mID, setType );
1341*cdf0e10cSrcweir }
1342*cdf0e10cSrcweir // -------------------------------------------------------------------------
1343*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 concurrency ) throw(SQLException, RuntimeException)
1344*cdf0e10cSrcweir {
1345*cdf0e10cSrcweir     static const char* pMethodName = "supportsResultSetConcurrency";
1346*cdf0e10cSrcweir     m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD_ARG2, pMethodName, setType, concurrency );
1347*cdf0e10cSrcweir 
1348*cdf0e10cSrcweir 	jboolean out( sal_False );
1349*cdf0e10cSrcweir     SDBThreadAttach t;
1350*cdf0e10cSrcweir 
1351*cdf0e10cSrcweir 	{
1352*cdf0e10cSrcweir 		static jmethodID mID(NULL);
1353*cdf0e10cSrcweir         obtainMethodId(t.pEnv, pMethodName,"(II)Z", mID);
1354*cdf0e10cSrcweir 		out = 	t.pEnv->CallBooleanMethod( object, mID, setType, concurrency);
1355*cdf0e10cSrcweir 		ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
1356*cdf0e10cSrcweir 	}
1357*cdf0e10cSrcweir 
1358*cdf0e10cSrcweir     m_aLogger.log< const sal_Char*, sal_Int16 >( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, pMethodName, out );
1359*cdf0e10cSrcweir 	return out;
1360*cdf0e10cSrcweir }
1361*cdf0e10cSrcweir // -------------------------------------------------------------------------
1362*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::ownUpdatesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
1363*cdf0e10cSrcweir {
1364*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1365*cdf0e10cSrcweir     return impl_callBooleanMethodWithIntArg( "ownUpdatesAreVisible", mID, setType );
1366*cdf0e10cSrcweir }
1367*cdf0e10cSrcweir // -------------------------------------------------------------------------
1368*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::ownDeletesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
1369*cdf0e10cSrcweir {
1370*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1371*cdf0e10cSrcweir     return impl_callBooleanMethodWithIntArg( "ownDeletesAreVisible", mID, setType );
1372*cdf0e10cSrcweir }
1373*cdf0e10cSrcweir // -------------------------------------------------------------------------
1374*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::ownInsertsAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
1375*cdf0e10cSrcweir {
1376*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1377*cdf0e10cSrcweir     return impl_callBooleanMethodWithIntArg( "ownInsertsAreVisible", mID, setType );
1378*cdf0e10cSrcweir }
1379*cdf0e10cSrcweir // -------------------------------------------------------------------------
1380*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::othersUpdatesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
1381*cdf0e10cSrcweir {
1382*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1383*cdf0e10cSrcweir     return impl_callBooleanMethodWithIntArg( "othersUpdatesAreVisible", mID, setType );
1384*cdf0e10cSrcweir }
1385*cdf0e10cSrcweir // -------------------------------------------------------------------------
1386*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::othersDeletesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
1387*cdf0e10cSrcweir {
1388*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1389*cdf0e10cSrcweir     return impl_callBooleanMethodWithIntArg( "othersDeletesAreVisible", mID, setType );
1390*cdf0e10cSrcweir }
1391*cdf0e10cSrcweir // -------------------------------------------------------------------------
1392*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::othersInsertsAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
1393*cdf0e10cSrcweir {
1394*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1395*cdf0e10cSrcweir     return impl_callBooleanMethodWithIntArg( "othersInsertsAreVisible", mID, setType );
1396*cdf0e10cSrcweir }
1397*cdf0e10cSrcweir // -------------------------------------------------------------------------
1398*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::updatesAreDetected( sal_Int32 setType ) throw(SQLException, RuntimeException)
1399*cdf0e10cSrcweir {
1400*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1401*cdf0e10cSrcweir     return impl_callBooleanMethodWithIntArg( "updatesAreDetected", mID, setType );
1402*cdf0e10cSrcweir }
1403*cdf0e10cSrcweir // -------------------------------------------------------------------------
1404*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::deletesAreDetected( sal_Int32 setType ) throw(SQLException, RuntimeException)
1405*cdf0e10cSrcweir {
1406*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1407*cdf0e10cSrcweir     return impl_callBooleanMethodWithIntArg( "deletesAreDetected", mID, setType );
1408*cdf0e10cSrcweir }
1409*cdf0e10cSrcweir // -------------------------------------------------------------------------
1410*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::insertsAreDetected( sal_Int32 setType ) throw(SQLException, RuntimeException)
1411*cdf0e10cSrcweir {
1412*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1413*cdf0e10cSrcweir     return impl_callBooleanMethodWithIntArg( "insertsAreDetected", mID, setType );
1414*cdf0e10cSrcweir }
1415*cdf0e10cSrcweir // -------------------------------------------------------------------------
1416*cdf0e10cSrcweir sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsBatchUpdates(  ) throw(SQLException, RuntimeException)
1417*cdf0e10cSrcweir {
1418*cdf0e10cSrcweir 	static jmethodID mID(NULL);
1419*cdf0e10cSrcweir     return impl_callBooleanMethod( "supportsBatchUpdates", mID );
1420*cdf0e10cSrcweir }
1421*cdf0e10cSrcweir // -------------------------------------------------------------------------
1422*cdf0e10cSrcweir Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getUDTs(
1423*cdf0e10cSrcweir         const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& typeNamePattern,
1424*cdf0e10cSrcweir         const Sequence< sal_Int32 >& types ) throw(SQLException, RuntimeException)
1425*cdf0e10cSrcweir {
1426*cdf0e10cSrcweir 	jobject out(0);
1427*cdf0e10cSrcweir     SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
1428*cdf0e10cSrcweir 	{
1429*cdf0e10cSrcweir 
1430*cdf0e10cSrcweir 
1431*cdf0e10cSrcweir 		static const char * cSignature = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[I)Ljava/sql/ResultSet;";
1432*cdf0e10cSrcweir 		static const char * cMethodName = "getUDTs";
1433*cdf0e10cSrcweir 		// Java-Call absetzen
1434*cdf0e10cSrcweir 		static jmethodID mID(NULL);
1435*cdf0e10cSrcweir         obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
1436*cdf0e10cSrcweir 		{
1437*cdf0e10cSrcweir 			jvalue args[4];
1438*cdf0e10cSrcweir 			// temporaere Variable initialisieren
1439*cdf0e10cSrcweir 			args[0].l = catalog.hasValue() ? convertwchar_tToJavaString(t.pEnv,comphelper::getString(catalog)) : 0;
1440*cdf0e10cSrcweir 			args[1].l = schemaPattern.toChar() == '%' ? NULL : convertwchar_tToJavaString(t.pEnv,schemaPattern);
1441*cdf0e10cSrcweir 			args[2].l = convertwchar_tToJavaString(t.pEnv,typeNamePattern);
1442*cdf0e10cSrcweir 			jintArray pArray = t.pEnv->NewIntArray(types.getLength());
1443*cdf0e10cSrcweir 			t.pEnv->SetIntArrayRegion(pArray,0,types.getLength(),(jint*)types.getConstArray());
1444*cdf0e10cSrcweir 			args[3].l = pArray;
1445*cdf0e10cSrcweir 
1446*cdf0e10cSrcweir 			out = t.pEnv->CallObjectMethod( object, mID, args[0].l, args[1].l,args[2].l,args[3].l);
1447*cdf0e10cSrcweir 
1448*cdf0e10cSrcweir 			if(catalog.hasValue())
1449*cdf0e10cSrcweir 				t.pEnv->DeleteLocalRef((jstring)args[0].l);
1450*cdf0e10cSrcweir 			if(schemaPattern.getLength())
1451*cdf0e10cSrcweir 				t.pEnv->DeleteLocalRef((jstring)args[1].l);
1452*cdf0e10cSrcweir 			if(typeNamePattern.getLength())
1453*cdf0e10cSrcweir 				t.pEnv->DeleteLocalRef((jstring)args[2].l);
1454*cdf0e10cSrcweir 			if(args[3].l)
1455*cdf0e10cSrcweir 				t.pEnv->DeleteLocalRef((jintArray)args[3].l);
1456*cdf0e10cSrcweir 			ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
1457*cdf0e10cSrcweir 		}
1458*cdf0e10cSrcweir 	}
1459*cdf0e10cSrcweir 
1460*cdf0e10cSrcweir 	return out ? new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection ) : 0;
1461*cdf0e10cSrcweir }
1462*cdf0e10cSrcweir // -------------------------------------------------------------------------
1463