merge the formfield patch from ooo-build
[ooovba.git] / connectivity / source / drivers / jdbc / DatabaseMetaData.cxx
blob55c8b698382bd5c1a88de55c10b845e192d17976
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: DatabaseMetaData.cxx,v $
10 * $Revision: 1.29 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_connectivity.hxx"
33 #include "java/sql/DatabaseMetaData.hxx"
34 #include "java/sql/Connection.hxx"
35 #include "java/sql/ResultSet.hxx"
36 #include "java/tools.hxx"
37 #include "java/lang/String.hxx"
38 #include "connectivity/CommonTools.hxx"
39 #include "FDatabaseMetaDataResultSet.hxx"
40 #include <comphelper/types.hxx>
41 #include "TPrivilegesResultSet.hxx"
42 #include "diagnose_ex.h"
43 #include "resource/jdbc_log.hrc"
45 using namespace ::comphelper;
47 using namespace connectivity;
48 using namespace ::com::sun::star::uno;
49 using namespace ::com::sun::star::beans;
50 using namespace ::com::sun::star::sdbc;
51 using namespace ::com::sun::star::container;
52 using namespace ::com::sun::star::lang;
54 //**************************************************************
55 //************ Class: java.sql.DatabaseMetaData
56 //**************************************************************
58 jclass java_sql_DatabaseMetaData::theClass = 0;
60 java_sql_DatabaseMetaData::~java_sql_DatabaseMetaData()
62 SDBThreadAttach::releaseRef();
65 jclass java_sql_DatabaseMetaData::getMyClass() const
67 // die Klasse muss nur einmal geholt werden, daher statisch
68 if( !theClass )
69 theClass = findMyClass("java/sql/DatabaseMetaData");
70 return theClass;
72 // -----------------------------------------------------------------------------
73 java_sql_DatabaseMetaData::java_sql_DatabaseMetaData( JNIEnv * pEnv, jobject myObj, java_sql_Connection& _rConnection )
74 :ODatabaseMetaDataBase( &_rConnection,_rConnection.getConnectionInfo() )
75 ,java_lang_Object( pEnv, myObj )
76 ,m_pConnection( &_rConnection )
77 ,m_aLogger( _rConnection.getLogger() )
79 SDBThreadAttach::addRef();
82 // -------------------------------------------------------------------------
83 Reference< XResultSet > java_sql_DatabaseMetaData::impl_getTypeInfo_throw( )
85 static jmethodID mID(NULL);
86 return impl_callResultSetMethod( "getTypeInfo", mID );
88 // -------------------------------------------------------------------------
89 Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getCatalogs( ) throw(SQLException, RuntimeException)
91 static jmethodID mID(NULL);
92 return impl_callResultSetMethod( "getCatalogs", mID );
94 // -------------------------------------------------------------------------
95 ::rtl::OUString java_sql_DatabaseMetaData::impl_getCatalogSeparator_throw( )
97 static jmethodID mID(NULL);
98 return impl_callStringMethod( "getCatalogSeparator", mID );
100 // -------------------------------------------------------------------------
101 Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getSchemas( ) throw(SQLException, RuntimeException)
103 static jmethodID mID(NULL);
104 return impl_callResultSetMethod( "getSchemas", mID );
106 // -------------------------------------------------------------------------
107 Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getColumnPrivileges(
108 const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
110 static jmethodID mID(NULL);
111 return impl_callResultSetMethodWithStrings( "getColumnPrivileges", mID, catalog, schema, table, &columnNamePattern );
113 // -------------------------------------------------------------------------
114 Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getColumns(
115 const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
117 static jmethodID mID(NULL);
118 return impl_callResultSetMethodWithStrings( "getColumns", mID, catalog, schemaPattern, tableNamePattern, &columnNamePattern );
121 // -------------------------------------------------------------------------
122 Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTables(
123 const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const Sequence< ::rtl::OUString >& _types ) throw(SQLException, RuntimeException)
125 static const char * cSignature = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)Ljava/sql/ResultSet;";
126 static const char * cMethodName = "getTables";
128 m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, cMethodName );
130 jobject out(0);
131 SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
134 // Java-Call absetzen
135 static jmethodID mID(NULL);
136 obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
137 OSL_VERIFY_RES( !isExceptionOccured(t.pEnv,sal_True),"Exception occured!");
138 jvalue args[4];
140 args[3].l = 0;
141 sal_Int32 typeFilterCount = _types.getLength();
142 if ( typeFilterCount )
144 jobjectArray pObjArray = static_cast< jobjectArray >( t.pEnv->NewObjectArray( (jsize)typeFilterCount, java_lang_String::st_getMyClass(), 0 ) );
145 OSL_VERIFY_RES( !isExceptionOccured( t.pEnv, sal_True ), "Exception occured!" );
146 const ::rtl::OUString* typeFilter = _types.getConstArray();
147 bool bIncludeAllTypes = false;
148 for ( sal_Int32 i=0; i<typeFilterCount; ++i, ++typeFilter )
150 if ( typeFilter->equalsAsciiL( "%", 1 ) )
152 bIncludeAllTypes = true;
153 break;
155 jstring aT = convertwchar_tToJavaString( t.pEnv, *typeFilter );
156 t.pEnv->SetObjectArrayElement( pObjArray, (jsize)i, aT );
157 OSL_VERIFY_RES( !isExceptionOccured( t.pEnv, sal_True ), "Exception occured!" );
160 if ( bIncludeAllTypes )
162 // the SDBC API allows to pass "%" as table type filter, but in JDBC, "all table types"
163 // is represented by the table type being <null/>
164 t.pEnv->DeleteLocalRef( pObjArray );
165 OSL_VERIFY_RES( !isExceptionOccured( t.pEnv, sal_True ), "Exception occured!" );
167 else
169 args[3].l = pObjArray;
172 // if we are to display "all catalogs", then respect m_aCatalogRestriction
173 Any aCatalogFilter( catalog );
174 if ( !aCatalogFilter.hasValue() )
175 aCatalogFilter = m_pConnection->getCatalogRestriction();
176 // similar for schema
177 Any aSchemaFilter;
178 if ( schemaPattern.equalsAsciiL( "%", 1 ) )
179 aSchemaFilter = m_pConnection->getSchemaRestriction();
180 else
181 aSchemaFilter <<= schemaPattern;
183 args[0].l = aCatalogFilter.hasValue() ? convertwchar_tToJavaString( t.pEnv, ::comphelper::getString( aCatalogFilter ) ) : NULL;
184 args[1].l = aSchemaFilter.hasValue() ? convertwchar_tToJavaString( t.pEnv, ::comphelper::getString( aSchemaFilter ) ) : NULL;
185 args[2].l = convertwchar_tToJavaString(t.pEnv,tableNamePattern);
186 out = t.pEnv->CallObjectMethod( object, mID, args[0].l, args[1].l,args[2].l,args[3].l);
187 jthrowable jThrow = t.pEnv->ExceptionOccurred();
188 if ( jThrow )
189 t.pEnv->ExceptionClear();// we have to clear the exception here because we want to handle it below
190 if ( aCatalogFilter.hasValue() )
192 t.pEnv->DeleteLocalRef((jstring)args[0].l);
193 OSL_VERIFY_RES( !isExceptionOccured( t.pEnv, sal_True ), "Exception occured!" );
195 if(args[1].l)
197 t.pEnv->DeleteLocalRef((jstring)args[1].l);
198 OSL_VERIFY_RES( !isExceptionOccured( t.pEnv, sal_True ), "Exception occured!" );
200 if(tableNamePattern.getLength())
202 t.pEnv->DeleteLocalRef((jstring)args[2].l);
203 OSL_VERIFY_RES( !isExceptionOccured( t.pEnv, sal_True ), "Exception occured!" );
205 //for(INT16 i=0;i<len;i++)
206 if ( args[3].l )
208 t.pEnv->DeleteLocalRef( (jobjectArray)args[3].l );
209 OSL_VERIFY_RES( !isExceptionOccured( t.pEnv, sal_True ), "Exception occured!" );
212 if ( jThrow )
214 if ( t.pEnv->IsInstanceOf( jThrow,java_sql_SQLException_BASE::st_getMyClass() ) )
216 java_sql_SQLException_BASE* pException = new java_sql_SQLException_BASE( t.pEnv, jThrow );
217 SQLException e( pException->getMessage(),
218 *this,
219 pException->getSQLState(),
220 pException->getErrorCode(),
221 Any()
223 delete pException;
224 throw e;
229 if ( !out )
230 return NULL;
232 m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_SUCCESS, cMethodName );
233 return new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection);
235 // -------------------------------------------------------------------------
236 Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getProcedureColumns(
237 const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& procedureNamePattern, const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
239 static jmethodID mID(NULL);
240 return impl_callResultSetMethodWithStrings( "getProcedureColumns", mID, catalog, schemaPattern, procedureNamePattern, &columnNamePattern );
242 // -------------------------------------------------------------------------
243 Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getProcedures( const Any&
244 catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& procedureNamePattern ) throw(SQLException, RuntimeException)
246 static jmethodID mID(NULL);
247 return impl_callResultSetMethodWithStrings( "getProcedures", mID, catalog, schemaPattern, procedureNamePattern );
249 // -------------------------------------------------------------------------
250 Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getVersionColumns(
251 const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
253 static jmethodID mID(NULL);
254 return impl_callResultSetMethodWithStrings( "getVersionColumns", mID, catalog, schema, table );
256 // -------------------------------------------------------------------------
257 sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxBinaryLiteralLength( ) throw(SQLException, RuntimeException)
259 static jmethodID mID(NULL);
260 return impl_callIntMethod( "getMaxBinaryLiteralLength", mID );
262 // -------------------------------------------------------------------------
263 sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxRowSize( ) throw(SQLException, RuntimeException)
265 static jmethodID mID(NULL);
266 return impl_callIntMethod( "getMaxRowSize", mID );
268 // -------------------------------------------------------------------------
269 sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxCatalogNameLength( ) throw(SQLException, RuntimeException)
271 static jmethodID mID(NULL);
272 return impl_callIntMethod( "getMaxCatalogNameLength", mID );
274 // -------------------------------------------------------------------------
275 sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxCharLiteralLength( ) throw(SQLException, RuntimeException)
277 static jmethodID mID(NULL);
278 return impl_callIntMethod( "getMaxCharLiteralLength", mID );
280 // -------------------------------------------------------------------------
281 sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnNameLength( ) throw(SQLException, RuntimeException)
283 static jmethodID mID(NULL);
284 return impl_callIntMethod( "getMaxColumnNameLength", mID );
286 // -------------------------------------------------------------------------
287 sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnsInIndex( ) throw(SQLException, RuntimeException)
289 static jmethodID mID(NULL);
290 return impl_callIntMethod( "getMaxColumnsInIndex", mID );
292 // -------------------------------------------------------------------------
293 sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxCursorNameLength( ) throw(SQLException, RuntimeException)
295 static jmethodID mID(NULL);
296 return impl_callIntMethod( "getMaxCursorNameLength", mID );
298 // -------------------------------------------------------------------------
299 sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxConnections( ) throw(SQLException, RuntimeException)
301 static jmethodID mID(NULL);
302 return impl_callIntMethod( "getMaxConnections", mID );
304 // -------------------------------------------------------------------------
305 sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnsInTable( ) throw(SQLException, RuntimeException)
307 static jmethodID mID(NULL);
308 return impl_callIntMethod( "getMaxColumnsInTable", mID );
310 // -------------------------------------------------------------------------
311 sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxStatementLength( ) throw(SQLException, RuntimeException)
313 static jmethodID mID(NULL);
314 return impl_callIntMethod( "getMaxStatementLength", mID );
316 // -------------------------------------------------------------------------
317 sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxTableNameLength( ) throw(SQLException, RuntimeException)
319 static jmethodID mID(NULL);
320 return impl_callIntMethod( "getMaxTableNameLength", mID );
322 // -------------------------------------------------------------------------
323 sal_Int32 java_sql_DatabaseMetaData::impl_getMaxTablesInSelect_throw( )
325 static jmethodID mID(NULL);
326 return impl_callIntMethod( "getMaxTablesInSelect", mID );
328 // -------------------------------------------------------------------------
329 Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getExportedKeys(
330 const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
332 static jmethodID mID(NULL);
333 return impl_callResultSetMethodWithStrings( "getExportedKeys", mID, catalog, schema, table );
335 // -------------------------------------------------------------------------
336 Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getImportedKeys(
337 const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
339 static jmethodID mID(NULL);
340 return impl_callResultSetMethodWithStrings( "getImportedKeys", mID, catalog, schema, table );
342 // -------------------------------------------------------------------------
343 Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getPrimaryKeys(
344 const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
346 static jmethodID mID(NULL);
347 return impl_callResultSetMethodWithStrings( "getPrimaryKeys", mID, catalog, schema, table );
349 // -------------------------------------------------------------------------
350 Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getIndexInfo(
351 const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table,
352 sal_Bool unique, sal_Bool approximate ) throw(SQLException, RuntimeException)
354 static const char * cSignature = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ)Ljava/sql/ResultSet;";
355 static const char * cMethodName = "getIndexInfo";
357 m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, cMethodName );
359 jobject out(0);
360 SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
363 // Java-Call absetzen
364 static jmethodID mID(NULL);
365 obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
366 jvalue args[5];
367 // Parameter konvertieren
368 args[0].l = catalog.hasValue() ? convertwchar_tToJavaString(t.pEnv,comphelper::getString(catalog)) : 0;
369 args[1].l = schema.toChar() == '%' ? NULL : convertwchar_tToJavaString(t.pEnv,schema);
370 args[2].l = convertwchar_tToJavaString(t.pEnv,table);
371 args[3].z = unique;
372 args[4].z = approximate;
373 out = t.pEnv->CallObjectMethod( object, mID, args[0].l,args[1].l,args[2].l,args[3].z,args[4].z );
375 // und aufraeumen
376 if(catalog.hasValue())
377 t.pEnv->DeleteLocalRef((jstring)args[0].l);
378 if(args[1].l)
379 t.pEnv->DeleteLocalRef((jstring)args[1].l);
380 if(table.getLength())
381 t.pEnv->DeleteLocalRef((jstring)args[2].l);
382 ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
384 if ( !out )
385 return NULL;
387 m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_SUCCESS, cMethodName );
388 return new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection);
390 // -------------------------------------------------------------------------
391 Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getBestRowIdentifier(
392 const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, sal_Int32 scope,
393 sal_Bool nullable ) throw(SQLException, RuntimeException)
395 static const char * cSignature = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZ)Ljava/sql/ResultSet;";
396 static const char * cMethodName = "getBestRowIdentifier";
398 m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, cMethodName );
400 jobject out(0);
401 SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
404 // Java-Call absetzen
405 static jmethodID mID(NULL);
406 obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
407 jvalue args[3];
408 // Parameter konvertieren
409 args[0].l = catalog.hasValue() ? convertwchar_tToJavaString(t.pEnv,comphelper::getString(catalog)) : 0;
410 args[1].l = schema.toChar() == '%' ? NULL : convertwchar_tToJavaString(t.pEnv,schema);
411 args[2].l = convertwchar_tToJavaString(t.pEnv,table);
412 out = t.pEnv->CallObjectMethod( object, mID, args[0].l,args[1].l,args[2].l,scope,nullable);
414 // und aufraeumen
415 if(catalog.hasValue())
416 t.pEnv->DeleteLocalRef((jstring)args[0].l);
417 if(args[1].l)
418 t.pEnv->DeleteLocalRef((jstring)args[1].l);
419 if(table.getLength())
420 t.pEnv->DeleteLocalRef((jstring)args[2].l);
421 ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
424 if ( !out )
425 return NULL;
427 m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_SUCCESS, cMethodName );
428 return new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection);
430 // -------------------------------------------------------------------------
431 Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTablePrivileges(
432 const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern ) throw(SQLException, RuntimeException)
434 if ( m_pConnection->isIgnoreDriverPrivilegesEnabled() )
435 return new OResultSetPrivileges(this,catalog,schemaPattern,tableNamePattern);
437 static jmethodID mID(NULL);
438 Reference< XResultSet > xReturn( impl_callResultSetMethodWithStrings( "getTablePrivileges", mID, catalog, schemaPattern, tableNamePattern ) );
440 if ( xReturn.is() )
442 // we have to check the result columns for the tables privleges
443 // #106324#
444 Reference< XResultSetMetaDataSupplier > xMetaSup(xReturn,UNO_QUERY);
445 if ( xMetaSup.is() )
447 Reference< XResultSetMetaData> xMeta = xMetaSup->getMetaData();
448 if ( xMeta.is() && xMeta->getColumnCount() != 7 )
450 // here we know that the count of column doesn't match
451 ::std::map<sal_Int32,sal_Int32> aColumnMatching;
452 static const ::rtl::OUString sPrivs[] = {
453 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE_CAT")),
454 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE_SCHEM")),
455 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TABLE_NAME")),
456 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GRANTOR")),
457 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GRANTEE")),
458 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PRIVILEGE")),
459 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IS_GRANTABLE"))
462 ::rtl::OUString sColumnName;
463 sal_Int32 nCount = xMeta->getColumnCount();
464 for (sal_Int32 i = 1 ; i <= nCount ; ++i)
466 sColumnName = xMeta->getColumnName(i);
467 for (sal_uInt32 j = 0 ; j < sizeof(sPrivs)/sizeof(sPrivs[0]); ++j)
469 if ( sPrivs[j] == sColumnName )
471 aColumnMatching.insert( ::std::map<sal_Int32,sal_Int32>::value_type(i,j+1) );
472 break;
477 // fill our own resultset
478 ODatabaseMetaDataResultSet* pNewPrivRes = new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eTablePrivileges );
479 Reference< XResultSet > xTemp = xReturn;
480 xReturn = pNewPrivRes;
481 ODatabaseMetaDataResultSet::ORows aRows;
482 Reference< XRow > xRow(xTemp,UNO_QUERY);
483 ::rtl::OUString sValue;
485 ODatabaseMetaDataResultSet::ORow aRow(8);
486 while ( xRow.is() && xTemp->next() )
488 ::std::map<sal_Int32,sal_Int32>::iterator aIter = aColumnMatching.begin();
489 ::std::map<sal_Int32,sal_Int32>::iterator aEnd = aColumnMatching.end();
490 for (;aIter != aEnd ; ++aIter)
492 sValue = xRow->getString(aIter->first);
493 if ( xRow->wasNull() )
494 aRow[aIter->second] = ODatabaseMetaDataResultSet::getEmptyValue();
495 else
496 aRow[aIter->second] = new ORowSetValueDecorator(sValue);
499 aRows.push_back(aRow);
501 pNewPrivRes->setRows(aRows);
505 return xReturn;
507 // -------------------------------------------------------------------------
508 Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getCrossReference(
509 const Any& primaryCatalog, const ::rtl::OUString& primarySchema,
510 const ::rtl::OUString& primaryTable, const Any& foreignCatalog,
511 const ::rtl::OUString& foreignSchema, const ::rtl::OUString& foreignTable ) throw(SQLException, RuntimeException)
513 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;";
514 static const char * cMethodName = "getCrossReference";
515 m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, cMethodName );
517 jobject out(0);
518 SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
521 // Java-Call absetzen
522 static jmethodID mID(NULL);
523 obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
524 jvalue args[6];
525 // Parameter konvertieren
526 args[0].l = primaryCatalog.hasValue() ? convertwchar_tToJavaString(t.pEnv,comphelper::getString(primaryCatalog)) : 0;
527 args[1].l = primarySchema.toChar() == '%' ? NULL : convertwchar_tToJavaString(t.pEnv,primarySchema);
528 args[2].l = convertwchar_tToJavaString(t.pEnv,primaryTable);
529 args[3].l = foreignCatalog.hasValue() ? convertwchar_tToJavaString(t.pEnv,comphelper::getString(foreignCatalog)) : 0;
530 args[4].l = foreignSchema.toChar() == '%' ? NULL : convertwchar_tToJavaString(t.pEnv,foreignSchema);
531 args[5].l = convertwchar_tToJavaString(t.pEnv,foreignTable);
532 out = t.pEnv->CallObjectMethod( object, mID, args[0].l,args[2].l,args[2].l,args[3].l,args[4].l,args[5].l );
534 // und aufraeumen
535 if(primaryCatalog.hasValue())
536 t.pEnv->DeleteLocalRef((jstring)args[0].l);
537 if(args[1].l)
538 t.pEnv->DeleteLocalRef((jstring)args[1].l);
539 if(primaryTable.getLength())
540 t.pEnv->DeleteLocalRef((jstring)args[2].l);
541 if(foreignCatalog.hasValue())
542 t.pEnv->DeleteLocalRef((jstring)args[3].l);
543 if(args[4].l)
544 t.pEnv->DeleteLocalRef((jstring)args[4].l);
545 if(foreignTable.getLength())
546 t.pEnv->DeleteLocalRef((jstring)args[5].l);
547 ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
550 if ( !out )
551 return NULL;
553 m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_SUCCESS, cMethodName );
554 return new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection);
557 // -------------------------------------------------------------------------
558 sal_Bool java_sql_DatabaseMetaData::impl_callBooleanMethod( const char* _pMethodName, jmethodID& _inout_MethodID )
560 m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, _pMethodName );
561 jboolean out( java_lang_Object::callBooleanMethod(_pMethodName,_inout_MethodID) );
562 m_aLogger.log< const sal_Char*, sal_Int16>( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, _pMethodName, out );
563 return out;
566 // -------------------------------------------------------------------------
567 ::rtl::OUString java_sql_DatabaseMetaData::impl_callStringMethod( const char* _pMethodName, jmethodID& _inout_MethodID )
569 m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, _pMethodName );
571 const ::rtl::OUString sReturn( callStringMethod(_pMethodName,_inout_MethodID) );
572 if ( m_aLogger.isLoggable( LogLevel::FINEST ) )
574 ::rtl::OUString sLoggedResult( sReturn );
575 if ( !sLoggedResult.getLength() )
576 sLoggedResult = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "<empty string>" ) );
577 m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, _pMethodName, sLoggedResult );
580 return sReturn;
583 // -------------------------------------------------------------------------
584 sal_Int32 java_sql_DatabaseMetaData::impl_callIntMethod( const char* _pMethodName, jmethodID& _inout_MethodID )
586 m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, _pMethodName );
587 sal_Int32 out( (sal_Int32)callIntMethod(_pMethodName,_inout_MethodID) );
588 m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, _pMethodName, (sal_Int32)out );
589 return out;
592 // -------------------------------------------------------------------------
593 sal_Bool java_sql_DatabaseMetaData::impl_callBooleanMethodWithIntArg( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument )
595 m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD_ARG1, _pMethodName, _nArgument );
597 jboolean out( callBooleanMethodWithIntArg(_pMethodName,_inout_MethodID,_nArgument) );
599 m_aLogger.log< const sal_Char*, sal_Int16 >( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, _pMethodName, out );
600 return out;
603 // -------------------------------------------------------------------------
604 Reference< XResultSet > java_sql_DatabaseMetaData::impl_callResultSetMethod( const char* _pMethodName, jmethodID& _inout_MethodID )
606 SDBThreadAttach t;
607 m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD, _pMethodName );
608 jobject out(callResultSetMethod(t.env(),_pMethodName,_inout_MethodID));
609 m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_SUCCESS, _pMethodName );
610 return new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection);
613 // -------------------------------------------------------------------------
614 Reference< XResultSet > java_sql_DatabaseMetaData::impl_callResultSetMethodWithStrings( const char* _pMethodName, jmethodID& _inout_MethodID,
615 const Any& _rCatalog, const ::rtl::OUString& _rSchemaPattern, const ::rtl::OUString& _rLeastPattern,
616 const ::rtl::OUString* _pOptionalAdditionalString )
618 bool bCatalog = _rCatalog.hasValue();
619 ::rtl::OUString sCatalog;
620 _rCatalog >>= sCatalog;
622 bool bSchema = _rSchemaPattern.toChar() != '%';
624 // log the call
625 if ( m_aLogger.isLoggable( LogLevel::FINEST ) )
627 ::rtl::OUString sCatalogLog = bCatalog ? sCatalog : ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "null" ) );
628 ::rtl::OUString sSchemaLog = bSchema ? _rSchemaPattern : ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "null" ) );
629 if ( _pOptionalAdditionalString )
630 m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD_ARG4, _pMethodName, sCatalogLog, sSchemaLog, _rLeastPattern, *_pOptionalAdditionalString );
631 else
632 m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD_ARG3, _pMethodName, sCatalogLog, sSchemaLog, _rLeastPattern );
635 jobject out(0);
637 SDBThreadAttach t;
638 OSL_ENSURE( t.pEnv, "java_sql_DatabaseMetaData::impl_callResultSetMethodWithStrings: no Java enviroment anymore!" );
641 const char* pSignature = _pOptionalAdditionalString
642 ? "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/sql/ResultSet;"
643 : "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/sql/ResultSet;";
644 // obtain method ID
645 obtainMethodId(t.pEnv, _pMethodName,pSignature, _inout_MethodID);
647 // call method
650 jvalue args[4];
651 // convert parameters
652 args[0].l = bCatalog ? convertwchar_tToJavaString( t.pEnv, sCatalog ) : NULL;
653 args[1].l = bSchema ? convertwchar_tToJavaString( t.pEnv, _rSchemaPattern ) : NULL;
654 args[2].l = convertwchar_tToJavaString( t.pEnv, _rLeastPattern );
655 args[3].l = _pOptionalAdditionalString ? convertwchar_tToJavaString( t.pEnv, *_pOptionalAdditionalString ) : NULL;
657 // actually do the call
658 if ( _pOptionalAdditionalString )
659 out = t.pEnv->CallObjectMethod( object, _inout_MethodID, args[0].l, args[1].l, args[2].l, args[3].l );
660 else
661 out = t.pEnv->CallObjectMethod( object, _inout_MethodID, args[0].l, args[1].l, args[2].l );
663 // clean up
664 if ( args[0].l )
665 t.pEnv->DeleteLocalRef( (jstring)args[0].l );
666 if ( args[1].l )
667 t.pEnv->DeleteLocalRef( (jstring)args[1].l );
668 if ( args[2].l )
669 t.pEnv->DeleteLocalRef( (jstring)args[2].l );
670 if ( args[3].l )
671 t.pEnv->DeleteLocalRef( (jstring)args[3].l );
673 ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
677 if ( !out )
678 return NULL;
680 m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_SUCCESS, _pMethodName );
681 return new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection);
684 // -------------------------------------------------------------------------
685 sal_Bool SAL_CALL java_sql_DatabaseMetaData::doesMaxRowSizeIncludeBlobs( ) throw(SQLException, RuntimeException)
687 static jmethodID mID(NULL);
688 return impl_callBooleanMethod( "doesMaxRowSizeIncludeBlobs", mID );
690 // -------------------------------------------------------------------------
691 sal_Bool SAL_CALL java_sql_DatabaseMetaData::storesLowerCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
693 static jmethodID mID(NULL);
694 return impl_callBooleanMethod( "storesLowerCaseQuotedIdentifiers", mID );
696 // -------------------------------------------------------------------------
697 sal_Bool SAL_CALL java_sql_DatabaseMetaData::storesLowerCaseIdentifiers( ) throw(SQLException, RuntimeException)
699 static jmethodID mID(NULL);
700 return impl_callBooleanMethod( "storesLowerCaseIdentifiers", mID );
702 // -------------------------------------------------------------------------
703 sal_Bool java_sql_DatabaseMetaData::impl_storesMixedCaseQuotedIdentifiers_throw( )
705 static jmethodID mID(NULL);
706 return impl_callBooleanMethod( "storesMixedCaseQuotedIdentifiers", mID );
708 // -------------------------------------------------------------------------
709 sal_Bool SAL_CALL java_sql_DatabaseMetaData::storesMixedCaseIdentifiers( ) throw(SQLException, RuntimeException)
711 static jmethodID mID(NULL);
712 return impl_callBooleanMethod( "storesMixedCaseIdentifiers", mID );
714 // -------------------------------------------------------------------------
715 sal_Bool SAL_CALL java_sql_DatabaseMetaData::storesUpperCaseQuotedIdentifiers( ) throw(SQLException, RuntimeException)
717 static jmethodID mID(NULL);
718 return impl_callBooleanMethod( "storesUpperCaseQuotedIdentifiers", mID );
720 // -------------------------------------------------------------------------
721 sal_Bool SAL_CALL java_sql_DatabaseMetaData::storesUpperCaseIdentifiers( ) throw(SQLException, RuntimeException)
723 static jmethodID mID(NULL);
724 return impl_callBooleanMethod( "storesUpperCaseIdentifiers", mID );
726 // -------------------------------------------------------------------------
727 sal_Bool java_sql_DatabaseMetaData::impl_supportsAlterTableWithAddColumn_throw( )
729 static jmethodID mID(NULL);
730 return impl_callBooleanMethod( "supportsAlterTableWithAddColumn", mID );
732 // -------------------------------------------------------------------------
733 sal_Bool java_sql_DatabaseMetaData::impl_supportsAlterTableWithDropColumn_throw( )
735 static jmethodID mID(NULL);
736 return impl_callBooleanMethod( "supportsAlterTableWithDropColumn", mID );
738 // -------------------------------------------------------------------------
739 sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxIndexLength( ) throw(SQLException, RuntimeException)
741 static jmethodID mID(NULL);
742 return impl_callIntMethod( "getMaxIndexLength", mID );
744 // -------------------------------------------------------------------------
745 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsNonNullableColumns( ) throw(SQLException, RuntimeException)
747 static jmethodID mID(NULL);
748 return impl_callBooleanMethod( "supportsNonNullableColumns", mID );
750 // -------------------------------------------------------------------------
751 ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getCatalogTerm( ) throw(SQLException, RuntimeException)
753 static jmethodID mID(NULL);
754 return impl_callStringMethod( "getCatalogTerm", mID );
756 // -------------------------------------------------------------------------
757 ::rtl::OUString java_sql_DatabaseMetaData::impl_getIdentifierQuoteString_throw( )
759 static jmethodID mID(NULL);
760 return impl_callStringMethod( "getIdentifierQuoteString", mID );
762 // -------------------------------------------------------------------------
763 ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getExtraNameCharacters( ) throw(SQLException, RuntimeException)
765 static jmethodID mID(NULL);
766 return impl_callStringMethod( "getExtraNameCharacters", mID );
768 // -------------------------------------------------------------------------
769 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsDifferentTableCorrelationNames( ) throw(SQLException, RuntimeException)
771 static jmethodID mID(NULL);
772 return impl_callBooleanMethod( "supportsDifferentTableCorrelationNames", mID );
774 // -------------------------------------------------------------------------
775 sal_Bool java_sql_DatabaseMetaData::impl_isCatalogAtStart_throw( )
777 static jmethodID mID(NULL);
778 return impl_callBooleanMethod( "isCatalogAtStart", mID );
780 // -------------------------------------------------------------------------
781 sal_Bool SAL_CALL java_sql_DatabaseMetaData::dataDefinitionIgnoredInTransactions( ) throw(SQLException, RuntimeException)
783 static jmethodID mID(NULL);
784 return impl_callBooleanMethod( "dataDefinitionIgnoredInTransactions", mID );
786 // -------------------------------------------------------------------------
787 sal_Bool SAL_CALL java_sql_DatabaseMetaData::dataDefinitionCausesTransactionCommit( ) throw(SQLException, RuntimeException)
789 static jmethodID mID(NULL);
790 return impl_callBooleanMethod( "dataDefinitionCausesTransactionCommit", mID );
792 // -------------------------------------------------------------------------
793 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsDataManipulationTransactionsOnly( ) throw(SQLException, RuntimeException)
795 static jmethodID mID(NULL);
796 return impl_callBooleanMethod( "supportsDataManipulationTransactionsOnly", mID );
798 // -------------------------------------------------------------------------
799 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsDataDefinitionAndDataManipulationTransactions( ) throw(SQLException, RuntimeException)
801 static jmethodID mID(NULL);
802 return impl_callBooleanMethod( "supportsDataDefinitionAndDataManipulationTransactions", mID );
804 // -------------------------------------------------------------------------
805 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsPositionedDelete( ) throw(SQLException, RuntimeException)
807 static jmethodID mID(NULL);
808 return impl_callBooleanMethod( "supportsPositionedDelete", mID );
810 // -------------------------------------------------------------------------
811 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsPositionedUpdate( ) throw(SQLException, RuntimeException)
813 static jmethodID mID(NULL);
814 return impl_callBooleanMethod( "supportsPositionedUpdate", mID );
816 // -------------------------------------------------------------------------
817 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsOpenStatementsAcrossRollback( ) throw(SQLException, RuntimeException)
819 static jmethodID mID(NULL);
820 return impl_callBooleanMethod( "supportsOpenStatementsAcrossRollback", mID );
822 // -------------------------------------------------------------------------
823 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsOpenStatementsAcrossCommit( ) throw(SQLException, RuntimeException)
825 static jmethodID mID(NULL);
826 return impl_callBooleanMethod( "supportsOpenStatementsAcrossCommit", mID );
828 // -------------------------------------------------------------------------
829 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsOpenCursorsAcrossCommit( ) throw(SQLException, RuntimeException)
831 static jmethodID mID(NULL);
832 return impl_callBooleanMethod( "supportsOpenCursorsAcrossCommit", mID );
834 // -------------------------------------------------------------------------
835 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsOpenCursorsAcrossRollback( ) throw(SQLException, RuntimeException)
837 static jmethodID mID(NULL);
838 return impl_callBooleanMethod( "supportsOpenCursorsAcrossRollback", mID );
840 // -------------------------------------------------------------------------
841 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsTransactionIsolationLevel( sal_Int32 level ) throw(SQLException, RuntimeException)
843 static jmethodID mID(NULL);
844 return impl_callBooleanMethodWithIntArg( "supportsTransactionIsolationLevel", mID, level );
846 // -------------------------------------------------------------------------
847 sal_Bool java_sql_DatabaseMetaData::impl_supportsSchemasInDataManipulation_throw( )
849 static jmethodID mID(NULL);
850 return impl_callBooleanMethod( "supportsSchemasInDataManipulation", mID );
852 // -------------------------------------------------------------------------
853 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsANSI92FullSQL( ) throw(SQLException, RuntimeException)
855 static jmethodID mID(NULL);
856 return impl_callBooleanMethod( "supportsANSI92FullSQL", mID );
858 // -------------------------------------------------------------------------
859 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsANSI92EntryLevelSQL( ) throw(SQLException, RuntimeException)
861 static jmethodID mID(NULL);
862 return impl_callBooleanMethod( "supportsANSI92EntryLevelSQL", mID );
864 // -------------------------------------------------------------------------
865 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsIntegrityEnhancementFacility( ) throw(SQLException, RuntimeException)
867 static jmethodID mID(NULL);
868 return impl_callBooleanMethod( "supportsIntegrityEnhancementFacility", mID );
870 // -------------------------------------------------------------------------
871 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSchemasInIndexDefinitions( ) throw(SQLException, RuntimeException)
873 static jmethodID mID(NULL);
874 return impl_callBooleanMethod( "supportsSchemasInIndexDefinitions", mID );
876 // -------------------------------------------------------------------------
877 sal_Bool java_sql_DatabaseMetaData::impl_supportsSchemasInTableDefinitions_throw( )
879 static jmethodID mID(NULL);
880 return impl_callBooleanMethod( "supportsSchemasInTableDefinitions", mID );
882 // -------------------------------------------------------------------------
883 sal_Bool java_sql_DatabaseMetaData::impl_supportsCatalogsInTableDefinitions_throw( )
885 static jmethodID mID(NULL);
886 return impl_callBooleanMethod( "supportsCatalogsInTableDefinitions", mID );
888 // -------------------------------------------------------------------------
889 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsCatalogsInIndexDefinitions( ) throw(SQLException, RuntimeException)
891 static jmethodID mID(NULL);
892 return impl_callBooleanMethod( "supportsCatalogsInIndexDefinitions", mID );
894 // -------------------------------------------------------------------------
895 sal_Bool java_sql_DatabaseMetaData::impl_supportsCatalogsInDataManipulation_throw( )
897 static jmethodID mID(NULL);
898 return impl_callBooleanMethod( "supportsCatalogsInDataManipulation", mID );
900 // -------------------------------------------------------------------------
901 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsOuterJoins( ) throw(SQLException, RuntimeException)
903 static jmethodID mID(NULL);
904 return impl_callBooleanMethod( "supportsOuterJoins", mID );
906 // -------------------------------------------------------------------------
907 Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTableTypes( ) throw(SQLException, RuntimeException)
909 static jmethodID mID(NULL);
910 return impl_callResultSetMethod( "getTableTypes", mID );
912 // -------------------------------------------------------------------------
913 sal_Int32 java_sql_DatabaseMetaData::impl_getMaxStatements_throw( )
915 static jmethodID mID(NULL);
916 return impl_callIntMethod( "getMaxStatements", mID );
918 // -------------------------------------------------------------------------
919 sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxProcedureNameLength( ) throw(SQLException, RuntimeException)
921 static jmethodID mID(NULL);
922 return impl_callIntMethod( "getMaxProcedureNameLength", mID );
924 // -------------------------------------------------------------------------
925 sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxSchemaNameLength( ) throw(SQLException, RuntimeException)
927 static jmethodID mID(NULL);
928 return impl_callIntMethod( "getMaxSchemaNameLength", mID );
930 // -------------------------------------------------------------------------
931 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsTransactions( ) throw(SQLException, RuntimeException)
933 static jmethodID mID(NULL);
934 return impl_callBooleanMethod( "supportsTransactions", mID );
937 // -------------------------------------------------------------------------
938 sal_Bool SAL_CALL java_sql_DatabaseMetaData::allProceduresAreCallable( ) throw(SQLException, RuntimeException)
940 static jmethodID mID(NULL);
941 return impl_callBooleanMethod( "allProceduresAreCallable", mID );
943 // -------------------------------------------------------------------------
944 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsStoredProcedures( ) throw(SQLException, RuntimeException)
946 static jmethodID mID(NULL);
947 return impl_callBooleanMethod( "supportsStoredProcedures", mID );
949 // -------------------------------------------------------------------------
950 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSelectForUpdate( ) throw(SQLException, RuntimeException)
952 static jmethodID mID(NULL);
953 return impl_callBooleanMethod( "supportsSelectForUpdate", mID );
955 // -------------------------------------------------------------------------
956 sal_Bool SAL_CALL java_sql_DatabaseMetaData::allTablesAreSelectable( ) throw(SQLException, RuntimeException)
958 static jmethodID mID(NULL);
959 return impl_callBooleanMethod( "allTablesAreSelectable", mID );
961 // -------------------------------------------------------------------------
962 sal_Bool SAL_CALL java_sql_DatabaseMetaData::isReadOnly( ) throw(SQLException, RuntimeException)
964 static jmethodID mID(NULL);
965 return impl_callBooleanMethod( "isReadOnly", mID );
967 // -------------------------------------------------------------------------
968 sal_Bool SAL_CALL java_sql_DatabaseMetaData::usesLocalFiles( ) throw(SQLException, RuntimeException)
970 static jmethodID mID(NULL);
971 return impl_callBooleanMethod( "usesLocalFiles", mID );
973 // -------------------------------------------------------------------------
974 sal_Bool SAL_CALL java_sql_DatabaseMetaData::usesLocalFilePerTable( ) throw(SQLException, RuntimeException)
976 static jmethodID mID(NULL);
977 return impl_callBooleanMethod( "usesLocalFilePerTable", mID );
979 // -------------------------------------------------------------------------
980 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsTypeConversion( ) throw(SQLException, RuntimeException)
982 static jmethodID mID(NULL);
983 return impl_callBooleanMethod( "supportsTypeConversion", mID );
985 // -------------------------------------------------------------------------
986 sal_Bool SAL_CALL java_sql_DatabaseMetaData::nullPlusNonNullIsNull( ) throw(SQLException, RuntimeException)
988 static jmethodID mID(NULL);
989 return impl_callBooleanMethod( "nullPlusNonNullIsNull", mID );
991 // -------------------------------------------------------------------------
992 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsColumnAliasing( ) throw(SQLException, RuntimeException)
994 static jmethodID mID(NULL);
995 return impl_callBooleanMethod( "supportsColumnAliasing", mID );
997 // -------------------------------------------------------------------------
998 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsTableCorrelationNames( ) throw(SQLException, RuntimeException)
1000 static jmethodID mID(NULL);
1001 return impl_callBooleanMethod( "supportsTableCorrelationNames", mID );
1003 // -------------------------------------------------------------------------
1004 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsConvert( sal_Int32 fromType, sal_Int32 toType ) throw(SQLException, RuntimeException)
1006 static const char* pMethodName = "supportsConvert";
1007 m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD_ARG2, pMethodName, fromType, toType );
1009 jboolean out( sal_False );
1010 SDBThreadAttach t;
1013 static jmethodID mID(NULL);
1014 obtainMethodId(t.pEnv, pMethodName,"(II)Z", mID);
1015 out = t.pEnv->CallBooleanMethod( object, mID, fromType, toType );
1016 ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
1019 m_aLogger.log< const sal_Char*, sal_Int16 >( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, pMethodName, out );
1020 return out;
1022 // -------------------------------------------------------------------------
1023 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsExpressionsInOrderBy( ) throw(SQLException, RuntimeException)
1025 static jmethodID mID(NULL);
1026 return impl_callBooleanMethod( "supportsExpressionsInOrderBy", mID );
1028 // -------------------------------------------------------------------------
1029 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsGroupBy( ) throw(SQLException, RuntimeException)
1031 static jmethodID mID(NULL);
1032 return impl_callBooleanMethod( "supportsGroupBy", mID );
1034 // -------------------------------------------------------------------------
1035 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsGroupByBeyondSelect( ) throw(SQLException, RuntimeException)
1037 static jmethodID mID(NULL);
1038 return impl_callBooleanMethod( "supportsGroupByBeyondSelect", mID );
1040 // -------------------------------------------------------------------------
1041 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsGroupByUnrelated( ) throw(SQLException, RuntimeException)
1043 static jmethodID mID(NULL);
1044 return impl_callBooleanMethod( "supportsGroupByUnrelated", mID );
1046 // -------------------------------------------------------------------------
1047 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsMultipleTransactions( ) throw(SQLException, RuntimeException)
1049 static jmethodID mID(NULL);
1050 return impl_callBooleanMethod( "supportsMultipleTransactions", mID );
1052 // -------------------------------------------------------------------------
1053 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsMultipleResultSets( ) throw(SQLException, RuntimeException)
1055 static jmethodID mID(NULL);
1056 return impl_callBooleanMethod( "supportsMultipleResultSets", mID );
1058 // -------------------------------------------------------------------------
1059 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsLikeEscapeClause( ) throw(SQLException, RuntimeException)
1061 static jmethodID mID(NULL);
1062 return impl_callBooleanMethod( "supportsLikeEscapeClause", mID );
1064 // -------------------------------------------------------------------------
1065 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsOrderByUnrelated( ) throw(SQLException, RuntimeException)
1067 static jmethodID mID(NULL);
1068 return impl_callBooleanMethod( "supportsOrderByUnrelated", mID );
1070 // -------------------------------------------------------------------------
1071 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsUnion( ) throw(SQLException, RuntimeException)
1073 static jmethodID mID(NULL);
1074 return impl_callBooleanMethod( "supportsUnion", mID );
1076 // -------------------------------------------------------------------------
1077 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsUnionAll( ) throw(SQLException, RuntimeException)
1079 static jmethodID mID(NULL);
1080 return impl_callBooleanMethod( "supportsUnionAll", mID );
1082 // -------------------------------------------------------------------------
1083 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsMixedCaseIdentifiers( ) throw(SQLException, RuntimeException)
1085 static jmethodID mID(NULL);
1086 return impl_callBooleanMethod( "supportsMixedCaseIdentifiers", mID );
1088 // -------------------------------------------------------------------------
1089 sal_Bool java_sql_DatabaseMetaData::impl_supportsMixedCaseQuotedIdentifiers_throw( )
1091 static jmethodID mID(NULL);
1092 return impl_callBooleanMethod( "supportsMixedCaseQuotedIdentifiers", mID );
1094 // -------------------------------------------------------------------------
1095 sal_Bool SAL_CALL java_sql_DatabaseMetaData::nullsAreSortedAtEnd( ) throw(SQLException, RuntimeException)
1097 static jmethodID mID(NULL);
1098 return impl_callBooleanMethod( "nullsAreSortedAtEnd", mID );
1100 // -------------------------------------------------------------------------
1101 sal_Bool SAL_CALL java_sql_DatabaseMetaData::nullsAreSortedAtStart( ) throw(SQLException, RuntimeException)
1103 static jmethodID mID(NULL);
1104 return impl_callBooleanMethod( "nullsAreSortedAtStart", mID );
1106 // -------------------------------------------------------------------------
1107 sal_Bool SAL_CALL java_sql_DatabaseMetaData::nullsAreSortedHigh( ) throw(SQLException, RuntimeException)
1109 static jmethodID mID(NULL);
1110 return impl_callBooleanMethod( "nullsAreSortedHigh", mID );
1112 // -------------------------------------------------------------------------
1113 sal_Bool SAL_CALL java_sql_DatabaseMetaData::nullsAreSortedLow( ) throw(SQLException, RuntimeException)
1115 static jmethodID mID(NULL);
1116 return impl_callBooleanMethod( "nullsAreSortedLow", mID );
1118 // -------------------------------------------------------------------------
1119 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSchemasInProcedureCalls( ) throw(SQLException, RuntimeException)
1121 static jmethodID mID(NULL);
1122 return impl_callBooleanMethod( "supportsSchemasInProcedureCalls", mID );
1124 // -------------------------------------------------------------------------
1125 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSchemasInPrivilegeDefinitions( ) throw(SQLException, RuntimeException)
1127 static jmethodID mID(NULL);
1128 return impl_callBooleanMethod( "supportsSchemasInPrivilegeDefinitions", mID );
1130 // -------------------------------------------------------------------------
1131 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsCatalogsInProcedureCalls( ) throw(SQLException, RuntimeException)
1133 static jmethodID mID(NULL);
1134 return impl_callBooleanMethod( "supportsCatalogsInProcedureCalls", mID );
1136 // -------------------------------------------------------------------------
1137 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsCatalogsInPrivilegeDefinitions( ) throw(SQLException, RuntimeException)
1139 static jmethodID mID(NULL);
1140 return impl_callBooleanMethod( "supportsCatalogsInPrivilegeDefinitions", mID );
1142 // -------------------------------------------------------------------------
1143 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsCorrelatedSubqueries( ) throw(SQLException, RuntimeException)
1145 static jmethodID mID(NULL);
1146 return impl_callBooleanMethod( "supportsCorrelatedSubqueries", mID );
1148 // -------------------------------------------------------------------------
1149 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSubqueriesInComparisons( ) throw(SQLException, RuntimeException)
1151 static jmethodID mID(NULL);
1152 return impl_callBooleanMethod( "supportsSubqueriesInComparisons", mID );
1154 // -------------------------------------------------------------------------
1155 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSubqueriesInExists( ) throw(SQLException, RuntimeException)
1157 static jmethodID mID(NULL);
1158 return impl_callBooleanMethod( "supportsSubqueriesInExists", mID );
1160 // -------------------------------------------------------------------------
1161 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSubqueriesInIns( ) throw(SQLException, RuntimeException)
1163 static jmethodID mID(NULL);
1164 return impl_callBooleanMethod( "supportsSubqueriesInIns", mID );
1166 // -------------------------------------------------------------------------
1167 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsSubqueriesInQuantifieds( ) throw(SQLException, RuntimeException)
1169 static jmethodID mID(NULL);
1170 return impl_callBooleanMethod( "supportsSubqueriesInQuantifieds", mID );
1172 // -------------------------------------------------------------------------
1173 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsANSI92IntermediateSQL( ) throw(SQLException, RuntimeException)
1175 static jmethodID mID(NULL);
1176 return impl_callBooleanMethod( "supportsANSI92IntermediateSQL", mID );
1178 // -------------------------------------------------------------------------
1179 ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getURL( ) throw(SQLException, RuntimeException)
1181 ::rtl::OUString sURL = m_pConnection->getURL();
1182 if ( !sURL.getLength() )
1184 static jmethodID mID(NULL);
1185 sURL = impl_callStringMethod( "getURL", mID );
1187 return sURL;
1189 // -------------------------------------------------------------------------
1190 ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getUserName( ) throw(SQLException, RuntimeException)
1192 static jmethodID mID(NULL);
1193 return impl_callStringMethod( "getUserName", mID );
1195 // -------------------------------------------------------------------------
1196 ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getDriverName( ) throw(SQLException, RuntimeException)
1198 static jmethodID mID(NULL);
1199 return impl_callStringMethod( "getDriverName", mID );
1201 // -------------------------------------------------------------------------
1202 ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getDriverVersion( ) throw(SQLException, RuntimeException)
1204 static jmethodID mID(NULL);
1205 return impl_callStringMethod( "getDriverVersion", mID );
1207 // -------------------------------------------------------------------------
1208 ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getDatabaseProductVersion( ) throw(SQLException, RuntimeException)
1210 static jmethodID mID(NULL);
1211 return impl_callStringMethod( "getDatabaseProductVersion", mID );
1213 // -------------------------------------------------------------------------
1214 ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getDatabaseProductName( ) throw(SQLException, RuntimeException)
1216 static jmethodID mID(NULL);
1217 return impl_callStringMethod( "getDatabaseProductName", mID );
1219 // -------------------------------------------------------------------------
1220 ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getProcedureTerm( ) throw(SQLException, RuntimeException)
1222 static jmethodID mID(NULL);
1223 return impl_callStringMethod( "getProcedureTerm", mID );
1225 // -------------------------------------------------------------------------
1226 ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getSchemaTerm( ) throw(SQLException, RuntimeException)
1228 static jmethodID mID(NULL);
1229 return impl_callStringMethod( "getSchemaTerm", mID );
1231 // -------------------------------------------------------------------------
1232 sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getDriverMajorVersion( ) throw(RuntimeException)
1234 static jmethodID mID(NULL);
1235 return impl_callIntMethod( "getDriverMajorVersion", mID );
1237 // -------------------------------------------------------------------------
1238 sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getDefaultTransactionIsolation( ) throw(SQLException, RuntimeException)
1240 static jmethodID mID(NULL);
1241 return impl_callIntMethod( "getDefaultTransactionIsolation", mID );
1243 // -------------------------------------------------------------------------
1244 sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeException)
1246 static jmethodID mID(NULL);
1247 return impl_callIntMethod( "getDriverMinorVersion", mID );
1249 // -------------------------------------------------------------------------
1250 ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getSQLKeywords( ) throw(SQLException, RuntimeException)
1252 static jmethodID mID(NULL);
1253 return impl_callStringMethod( "getSQLKeywords", mID );
1255 // -------------------------------------------------------------------------
1256 ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getSearchStringEscape( ) throw(SQLException, RuntimeException)
1258 static jmethodID mID(NULL);
1259 return impl_callStringMethod( "getSearchStringEscape", mID );
1261 // -------------------------------------------------------------------------
1262 ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getStringFunctions( ) throw(SQLException, RuntimeException)
1264 static jmethodID mID(NULL);
1265 return impl_callStringMethod( "getStringFunctions", mID );
1267 // -------------------------------------------------------------------------
1268 ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getTimeDateFunctions( ) throw(SQLException, RuntimeException)
1270 static jmethodID mID(NULL);
1271 return impl_callStringMethod( "getTimeDateFunctions", mID );
1273 // -------------------------------------------------------------------------
1274 ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getSystemFunctions( ) throw(SQLException, RuntimeException)
1276 static jmethodID mID(NULL);
1277 return impl_callStringMethod( "getSystemFunctions", mID );
1279 // -------------------------------------------------------------------------
1280 ::rtl::OUString SAL_CALL java_sql_DatabaseMetaData::getNumericFunctions( ) throw(SQLException, RuntimeException)
1282 static jmethodID mID(NULL);
1283 return impl_callStringMethod( "getNumericFunctions", mID );
1285 // -------------------------------------------------------------------------
1286 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsExtendedSQLGrammar( ) throw(SQLException, RuntimeException)
1288 static jmethodID mID(NULL);
1289 return impl_callBooleanMethod( "supportsExtendedSQLGrammar", mID );
1291 // -------------------------------------------------------------------------
1292 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsCoreSQLGrammar( ) throw(SQLException, RuntimeException)
1294 static jmethodID mID(NULL);
1295 return impl_callBooleanMethod( "supportsCoreSQLGrammar", mID );
1297 // -------------------------------------------------------------------------
1298 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsMinimumSQLGrammar( ) throw(SQLException, RuntimeException)
1300 static jmethodID mID(NULL);
1301 return impl_callBooleanMethod( "supportsMinimumSQLGrammar", mID );
1303 // -------------------------------------------------------------------------
1304 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsFullOuterJoins( ) throw(SQLException, RuntimeException)
1306 static jmethodID mID(NULL);
1307 return impl_callBooleanMethod( "supportsFullOuterJoins", mID );
1309 // -------------------------------------------------------------------------
1310 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsLimitedOuterJoins( ) throw(SQLException, RuntimeException)
1312 static jmethodID mID(NULL);
1313 return impl_callBooleanMethod( "supportsLimitedOuterJoins", mID );
1315 // -------------------------------------------------------------------------
1316 sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnsInGroupBy( ) throw(SQLException, RuntimeException)
1318 static jmethodID mID(NULL);
1319 return impl_callIntMethod( "getMaxColumnsInGroupBy", mID );
1321 // -------------------------------------------------------------------------
1322 sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnsInOrderBy( ) throw(SQLException, RuntimeException)
1324 static jmethodID mID(NULL);
1325 return impl_callIntMethod( "getMaxColumnsInOrderBy", mID );
1327 // -------------------------------------------------------------------------
1328 sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxColumnsInSelect( ) throw(SQLException, RuntimeException)
1330 static jmethodID mID(NULL);
1331 return impl_callIntMethod( "getMaxColumnsInSelect", mID );
1333 // -------------------------------------------------------------------------
1334 sal_Int32 SAL_CALL java_sql_DatabaseMetaData::getMaxUserNameLength( ) throw(SQLException, RuntimeException)
1336 static jmethodID mID(NULL);
1337 return impl_callIntMethod( "getMaxUserNameLength", mID );
1339 // -------------------------------------------------------------------------
1340 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsResultSetType( sal_Int32 setType ) throw(SQLException, RuntimeException)
1342 static jmethodID mID(NULL);
1343 return impl_callBooleanMethodWithIntArg( "supportsResultSetType", mID, setType );
1345 // -------------------------------------------------------------------------
1346 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 concurrency ) throw(SQLException, RuntimeException)
1348 static const char* pMethodName = "supportsResultSetConcurrency";
1349 m_aLogger.log( LogLevel::FINEST, STR_LOG_META_DATA_METHOD_ARG2, pMethodName, setType, concurrency );
1351 jboolean out( sal_False );
1352 SDBThreadAttach t;
1355 static jmethodID mID(NULL);
1356 obtainMethodId(t.pEnv, pMethodName,"(II)Z", mID);
1357 out = t.pEnv->CallBooleanMethod( object, mID, setType, concurrency);
1358 ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
1361 m_aLogger.log< const sal_Char*, sal_Int16 >( LogLevel::FINEST, STR_LOG_META_DATA_RESULT, pMethodName, out );
1362 return out;
1364 // -------------------------------------------------------------------------
1365 sal_Bool SAL_CALL java_sql_DatabaseMetaData::ownUpdatesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
1367 static jmethodID mID(NULL);
1368 return impl_callBooleanMethodWithIntArg( "ownUpdatesAreVisible", mID, setType );
1370 // -------------------------------------------------------------------------
1371 sal_Bool SAL_CALL java_sql_DatabaseMetaData::ownDeletesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
1373 static jmethodID mID(NULL);
1374 return impl_callBooleanMethodWithIntArg( "ownDeletesAreVisible", mID, setType );
1376 // -------------------------------------------------------------------------
1377 sal_Bool SAL_CALL java_sql_DatabaseMetaData::ownInsertsAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
1379 static jmethodID mID(NULL);
1380 return impl_callBooleanMethodWithIntArg( "ownInsertsAreVisible", mID, setType );
1382 // -------------------------------------------------------------------------
1383 sal_Bool SAL_CALL java_sql_DatabaseMetaData::othersUpdatesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
1385 static jmethodID mID(NULL);
1386 return impl_callBooleanMethodWithIntArg( "othersUpdatesAreVisible", mID, setType );
1388 // -------------------------------------------------------------------------
1389 sal_Bool SAL_CALL java_sql_DatabaseMetaData::othersDeletesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
1391 static jmethodID mID(NULL);
1392 return impl_callBooleanMethodWithIntArg( "othersDeletesAreVisible", mID, setType );
1394 // -------------------------------------------------------------------------
1395 sal_Bool SAL_CALL java_sql_DatabaseMetaData::othersInsertsAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException)
1397 static jmethodID mID(NULL);
1398 return impl_callBooleanMethodWithIntArg( "othersInsertsAreVisible", mID, setType );
1400 // -------------------------------------------------------------------------
1401 sal_Bool SAL_CALL java_sql_DatabaseMetaData::updatesAreDetected( sal_Int32 setType ) throw(SQLException, RuntimeException)
1403 static jmethodID mID(NULL);
1404 return impl_callBooleanMethodWithIntArg( "updatesAreDetected", mID, setType );
1406 // -------------------------------------------------------------------------
1407 sal_Bool SAL_CALL java_sql_DatabaseMetaData::deletesAreDetected( sal_Int32 setType ) throw(SQLException, RuntimeException)
1409 static jmethodID mID(NULL);
1410 return impl_callBooleanMethodWithIntArg( "deletesAreDetected", mID, setType );
1412 // -------------------------------------------------------------------------
1413 sal_Bool SAL_CALL java_sql_DatabaseMetaData::insertsAreDetected( sal_Int32 setType ) throw(SQLException, RuntimeException)
1415 static jmethodID mID(NULL);
1416 return impl_callBooleanMethodWithIntArg( "insertsAreDetected", mID, setType );
1418 // -------------------------------------------------------------------------
1419 sal_Bool SAL_CALL java_sql_DatabaseMetaData::supportsBatchUpdates( ) throw(SQLException, RuntimeException)
1421 static jmethodID mID(NULL);
1422 return impl_callBooleanMethod( "supportsBatchUpdates", mID );
1424 // -------------------------------------------------------------------------
1425 Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getUDTs(
1426 const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& typeNamePattern,
1427 const Sequence< sal_Int32 >& types ) throw(SQLException, RuntimeException)
1429 jobject out(0);
1430 SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
1434 static const char * cSignature = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[I)Ljava/sql/ResultSet;";
1435 static const char * cMethodName = "getUDTs";
1436 // Java-Call absetzen
1437 static jmethodID mID(NULL);
1438 obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
1440 jvalue args[4];
1441 // temporaere Variable initialisieren
1442 args[0].l = catalog.hasValue() ? convertwchar_tToJavaString(t.pEnv,comphelper::getString(catalog)) : 0;
1443 args[1].l = schemaPattern.toChar() == '%' ? NULL : convertwchar_tToJavaString(t.pEnv,schemaPattern);
1444 args[2].l = convertwchar_tToJavaString(t.pEnv,typeNamePattern);
1445 jintArray pArray = t.pEnv->NewIntArray(types.getLength());
1446 t.pEnv->SetIntArrayRegion(pArray,0,types.getLength(),(jint*)types.getConstArray());
1447 args[3].l = pArray;
1449 out = t.pEnv->CallObjectMethod( object, mID, args[0].l, args[1].l,args[2].l,args[3].l);
1451 if(catalog.hasValue())
1452 t.pEnv->DeleteLocalRef((jstring)args[0].l);
1453 if(schemaPattern.getLength())
1454 t.pEnv->DeleteLocalRef((jstring)args[1].l);
1455 if(typeNamePattern.getLength())
1456 t.pEnv->DeleteLocalRef((jstring)args[2].l);
1457 if(args[3].l)
1458 t.pEnv->DeleteLocalRef((jintArray)args[3].l);
1459 ThrowLoggedSQLException( m_aLogger, t.pEnv, *this );
1463 return out ? new java_sql_ResultSet( t.pEnv, out, m_aLogger,*m_pConnection ) : 0;
1465 // -------------------------------------------------------------------------