1*9b5730f6SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*9b5730f6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*9b5730f6SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*9b5730f6SAndrew Rist * distributed with this work for additional information 6*9b5730f6SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*9b5730f6SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*9b5730f6SAndrew Rist * "License"); you may not use this file except in compliance 9*9b5730f6SAndrew Rist * with the License. You may obtain a copy of the License at 10*9b5730f6SAndrew Rist * 11*9b5730f6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*9b5730f6SAndrew Rist * 13*9b5730f6SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*9b5730f6SAndrew Rist * software distributed under the License is distributed on an 15*9b5730f6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*9b5730f6SAndrew Rist * KIND, either express or implied. See the License for the 17*9b5730f6SAndrew Rist * specific language governing permissions and limitations 18*9b5730f6SAndrew Rist * under the License. 19*9b5730f6SAndrew Rist * 20*9b5730f6SAndrew Rist *************************************************************/ 21*9b5730f6SAndrew Rist 22*9b5730f6SAndrew 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 53cdf0e10cSrcweir java_sql_DatabaseMetaData::~java_sql_DatabaseMetaData() 54cdf0e10cSrcweir { 55cdf0e10cSrcweir SDBThreadAttach::releaseRef(); 56cdf0e10cSrcweir } 57cdf0e10cSrcweir 58cdf0e10cSrcweir 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 // ----------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 76cdf0e10cSrcweir Reference< XResultSet > java_sql_DatabaseMetaData::impl_getTypeInfo_throw( ) 77cdf0e10cSrcweir { 78cdf0e10cSrcweir static jmethodID mID(NULL); 79cdf0e10cSrcweir return impl_callResultSetMethod( "getTypeInfo", mID ); 80cdf0e10cSrcweir } 81cdf0e10cSrcweir // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 88cdf0e10cSrcweir ::rtl::OUString java_sql_DatabaseMetaData::impl_getCatalogSeparator_throw( ) 89cdf0e10cSrcweir { 90cdf0e10cSrcweir static jmethodID mID(NULL); 91cdf0e10cSrcweir return impl_callStringMethod( "getCatalogSeparator", mID ); 92cdf0e10cSrcweir } 93cdf0e10cSrcweir // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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); 130cdf0e10cSrcweir OSL_VERIFY_RES( !isExceptionOccured(t.pEnv,sal_True),"Exception occured!"); 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 ) ); 138cdf0e10cSrcweir OSL_VERIFY_RES( !isExceptionOccured( t.pEnv, sal_True ), "Exception occured!" ); 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 ); 150cdf0e10cSrcweir OSL_VERIFY_RES( !isExceptionOccured( t.pEnv, sal_True ), "Exception occured!" ); 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 ); 158cdf0e10cSrcweir OSL_VERIFY_RES( !isExceptionOccured( t.pEnv, sal_True ), "Exception occured!" ); 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); 186cdf0e10cSrcweir OSL_VERIFY_RES( !isExceptionOccured( t.pEnv, sal_True ), "Exception occured!" ); 187cdf0e10cSrcweir } 188cdf0e10cSrcweir if(args[1].l) 189cdf0e10cSrcweir { 190cdf0e10cSrcweir t.pEnv->DeleteLocalRef((jstring)args[1].l); 191cdf0e10cSrcweir OSL_VERIFY_RES( !isExceptionOccured( t.pEnv, sal_True ), "Exception occured!" ); 192cdf0e10cSrcweir } 193cdf0e10cSrcweir if(tableNamePattern.getLength()) 194cdf0e10cSrcweir { 195cdf0e10cSrcweir t.pEnv->DeleteLocalRef((jstring)args[2].l); 196cdf0e10cSrcweir OSL_VERIFY_RES( !isExceptionOccured( t.pEnv, sal_True ), "Exception occured!" ); 197cdf0e10cSrcweir } 198cdf0e10cSrcweir //for(INT16 i=0;i<len;i++) 199cdf0e10cSrcweir if ( args[3].l ) 200cdf0e10cSrcweir { 201cdf0e10cSrcweir t.pEnv->DeleteLocalRef( (jobjectArray)args[3].l ); 202cdf0e10cSrcweir OSL_VERIFY_RES( !isExceptionOccured( t.pEnv, sal_True ), "Exception occured!" ); 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 316cdf0e10cSrcweir sal_Int32 java_sql_DatabaseMetaData::impl_getMaxTablesInSelect_throw( ) 317cdf0e10cSrcweir { 318cdf0e10cSrcweir static jmethodID mID(NULL); 319cdf0e10cSrcweir return impl_callIntMethod( "getMaxTablesInSelect", mID ); 320cdf0e10cSrcweir } 321cdf0e10cSrcweir // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 696cdf0e10cSrcweir sal_Bool java_sql_DatabaseMetaData::impl_storesMixedCaseQuotedIdentifiers_throw( ) 697cdf0e10cSrcweir { 698cdf0e10cSrcweir static jmethodID mID(NULL); 699cdf0e10cSrcweir return impl_callBooleanMethod( "storesMixedCaseQuotedIdentifiers", mID ); 700cdf0e10cSrcweir } 701cdf0e10cSrcweir // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 720cdf0e10cSrcweir sal_Bool java_sql_DatabaseMetaData::impl_supportsAlterTableWithAddColumn_throw( ) 721cdf0e10cSrcweir { 722cdf0e10cSrcweir static jmethodID mID(NULL); 723cdf0e10cSrcweir return impl_callBooleanMethod( "supportsAlterTableWithAddColumn", mID ); 724cdf0e10cSrcweir } 725cdf0e10cSrcweir // ------------------------------------------------------------------------- 726cdf0e10cSrcweir sal_Bool java_sql_DatabaseMetaData::impl_supportsAlterTableWithDropColumn_throw( ) 727cdf0e10cSrcweir { 728cdf0e10cSrcweir static jmethodID mID(NULL); 729cdf0e10cSrcweir return impl_callBooleanMethod( "supportsAlterTableWithDropColumn", mID ); 730cdf0e10cSrcweir } 731cdf0e10cSrcweir // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 750cdf0e10cSrcweir ::rtl::OUString java_sql_DatabaseMetaData::impl_getIdentifierQuoteString_throw( ) 751cdf0e10cSrcweir { 752cdf0e10cSrcweir static jmethodID mID(NULL); 753cdf0e10cSrcweir return impl_callStringMethod( "getIdentifierQuoteString", mID ); 754cdf0e10cSrcweir } 755cdf0e10cSrcweir // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 768cdf0e10cSrcweir sal_Bool java_sql_DatabaseMetaData::impl_isCatalogAtStart_throw( ) 769cdf0e10cSrcweir { 770cdf0e10cSrcweir static jmethodID mID(NULL); 771cdf0e10cSrcweir return impl_callBooleanMethod( "isCatalogAtStart", mID ); 772cdf0e10cSrcweir } 773cdf0e10cSrcweir // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 840cdf0e10cSrcweir sal_Bool java_sql_DatabaseMetaData::impl_supportsSchemasInDataManipulation_throw( ) 841cdf0e10cSrcweir { 842cdf0e10cSrcweir static jmethodID mID(NULL); 843cdf0e10cSrcweir return impl_callBooleanMethod( "supportsSchemasInDataManipulation", mID ); 844cdf0e10cSrcweir } 845cdf0e10cSrcweir // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 870cdf0e10cSrcweir sal_Bool java_sql_DatabaseMetaData::impl_supportsSchemasInTableDefinitions_throw( ) 871cdf0e10cSrcweir { 872cdf0e10cSrcweir static jmethodID mID(NULL); 873cdf0e10cSrcweir return impl_callBooleanMethod( "supportsSchemasInTableDefinitions", mID ); 874cdf0e10cSrcweir } 875cdf0e10cSrcweir // ------------------------------------------------------------------------- 876cdf0e10cSrcweir sal_Bool java_sql_DatabaseMetaData::impl_supportsCatalogsInTableDefinitions_throw( ) 877cdf0e10cSrcweir { 878cdf0e10cSrcweir static jmethodID mID(NULL); 879cdf0e10cSrcweir return impl_callBooleanMethod( "supportsCatalogsInTableDefinitions", mID ); 880cdf0e10cSrcweir } 881cdf0e10cSrcweir // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 888cdf0e10cSrcweir sal_Bool java_sql_DatabaseMetaData::impl_supportsCatalogsInDataManipulation_throw( ) 889cdf0e10cSrcweir { 890cdf0e10cSrcweir static jmethodID mID(NULL); 891cdf0e10cSrcweir return impl_callBooleanMethod( "supportsCatalogsInDataManipulation", mID ); 892cdf0e10cSrcweir } 893cdf0e10cSrcweir // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 906cdf0e10cSrcweir sal_Int32 java_sql_DatabaseMetaData::impl_getMaxStatements_throw( ) 907cdf0e10cSrcweir { 908cdf0e10cSrcweir static jmethodID mID(NULL); 909cdf0e10cSrcweir return impl_callIntMethod( "getMaxStatements", mID ); 910cdf0e10cSrcweir } 911cdf0e10cSrcweir // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 1082cdf0e10cSrcweir sal_Bool java_sql_DatabaseMetaData::impl_supportsMixedCaseQuotedIdentifiers_throw( ) 1083cdf0e10cSrcweir { 1084cdf0e10cSrcweir static jmethodID mID(NULL); 1085cdf0e10cSrcweir return impl_callBooleanMethod( "supportsMixedCaseQuotedIdentifiers", mID ); 1086cdf0e10cSrcweir } 1087cdf0e10cSrcweir // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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 // ------------------------------------------------------------------------- 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