LCOV - code coverage report
Current view: top level - connectivity/source/drivers/jdbc - DatabaseMetaData.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 172 576 29.9 %
Date: 2015-06-13 12:38:46 Functions: 28 160 17.5 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.11