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