LCOV - code coverage report
Current view: top level - connectivity/source/drivers/jdbc - ResultSetMetaData.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 24 57 42.1 %
Date: 2014-11-03 Functions: 9 25 36.0 %
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 "java/sql/ResultSetMetaData.hxx"
      21             : #include "java/sql/Connection.hxx"
      22             : #include "java/tools.hxx"
      23             : 
      24             : using namespace connectivity;
      25             : using namespace ::com::sun::star::uno;
      26             : using namespace ::com::sun::star::beans;
      27             : using namespace ::com::sun::star::sdbc;
      28             : using namespace ::com::sun::star::container;
      29             : using namespace ::com::sun::star::lang;
      30             : 
      31             : 
      32             : //************ Class: java.sql.ResultSetMetaData
      33             : 
      34             : 
      35             : jclass java_sql_ResultSetMetaData::theClass = 0;
      36           8 : java_sql_ResultSetMetaData::java_sql_ResultSetMetaData( JNIEnv * pEnv, jobject myObj, const java::sql::ConnectionLog& _rResultSetLogger, java_sql_Connection& _rCon  )
      37             :     :java_lang_Object( pEnv, myObj )
      38             :     ,m_aLogger( _rResultSetLogger )
      39             :     ,m_pConnection( &_rCon )
      40           8 :     ,m_nColumnCount(-1)
      41             : {
      42           8 :     SDBThreadAttach::addRef();
      43           8 : }
      44          24 : java_sql_ResultSetMetaData::~java_sql_ResultSetMetaData()
      45             : {
      46           8 :     SDBThreadAttach::releaseRef();
      47          16 : }
      48             : 
      49          10 : jclass java_sql_ResultSetMetaData::getMyClass() const
      50             : {
      51             :     // The class needs to be fetched just once, that is why it is static
      52          10 :     if( !theClass )
      53           2 :         theClass = findMyClass("java/sql/ResultSetMetaData");
      54          10 :     return theClass;
      55             : }
      56             : 
      57             : 
      58           0 : sal_Int32 SAL_CALL java_sql_ResultSetMetaData::getColumnDisplaySize( sal_Int32 column ) throw(SQLException, RuntimeException, std::exception)
      59             : {
      60             :     static jmethodID mID(NULL);
      61           0 :     return callIntMethodWithIntArg_ThrowSQL("getColumnDisplaySize",mID,column);
      62             : }
      63             : 
      64             : 
      65          12 : sal_Int32 SAL_CALL java_sql_ResultSetMetaData::getColumnType( sal_Int32 column ) throw(SQLException, RuntimeException, std::exception)
      66             : {
      67             :     static jmethodID mID(NULL);
      68          12 :     return callIntMethodWithIntArg_ThrowSQL("getColumnType",mID,column);
      69             : }
      70             : 
      71             : 
      72           8 : sal_Int32 SAL_CALL java_sql_ResultSetMetaData::getColumnCount(  ) throw(SQLException, RuntimeException, std::exception)
      73             : {
      74           8 :     if ( m_nColumnCount == -1 )
      75             :     {
      76             :         static jmethodID mID(NULL);
      77           8 :         m_nColumnCount = callIntMethod_ThrowSQL("getColumnCount", mID);
      78             :     } // if ( m_nColumnCount == -1 )
      79           8 :     return m_nColumnCount;
      80             : 
      81             : }
      82             : 
      83             : 
      84           0 : sal_Bool SAL_CALL java_sql_ResultSetMetaData::isCaseSensitive( sal_Int32 column ) throw(SQLException, RuntimeException, std::exception)
      85             : {
      86             :     static jmethodID mID(NULL);
      87           0 :     return callBooleanMethodWithIntArg( "isCaseSensitive", mID,column );
      88             : }
      89             : 
      90           0 : OUString SAL_CALL java_sql_ResultSetMetaData::getSchemaName( sal_Int32 column ) throw(SQLException, RuntimeException, std::exception)
      91             : {
      92             :     static jmethodID mID(NULL);
      93           0 :     return callStringMethodWithIntArg("getSchemaName",mID,column);
      94             : }
      95             : 
      96             : 
      97          12 : OUString SAL_CALL java_sql_ResultSetMetaData::getColumnName( sal_Int32 column ) throw(SQLException, RuntimeException, std::exception)
      98             : {
      99             :     static jmethodID mID(NULL);
     100          12 :     return callStringMethodWithIntArg("getColumnName",mID,column);
     101             : }
     102             : 
     103           0 : OUString SAL_CALL java_sql_ResultSetMetaData::getTableName( sal_Int32 column ) throw(SQLException, RuntimeException, std::exception)
     104             : {
     105             :     static jmethodID mID(NULL);
     106           0 :     return callStringMethodWithIntArg("getTableName",mID,column);
     107             : }
     108             : 
     109           0 : OUString SAL_CALL java_sql_ResultSetMetaData::getCatalogName( sal_Int32 column ) throw(SQLException, RuntimeException, std::exception)
     110             : {
     111             :     static jmethodID mID(NULL);
     112           0 :     return callStringMethodWithIntArg("getCatalogName",mID,column);
     113             : }
     114             : 
     115           0 : OUString SAL_CALL java_sql_ResultSetMetaData::getColumnTypeName( sal_Int32 column ) throw(SQLException, RuntimeException, std::exception)
     116             : {
     117             :     static jmethodID mID(NULL);
     118           0 :     return callStringMethodWithIntArg("getColumnTypeName",mID,column);
     119             : }
     120             : 
     121           0 : OUString SAL_CALL java_sql_ResultSetMetaData::getColumnLabel( sal_Int32 column ) throw(SQLException, RuntimeException, std::exception)
     122             : {
     123             :     static jmethodID mID(NULL);
     124           0 :     return callStringMethodWithIntArg("getColumnLabel",mID,column);
     125             : }
     126             : 
     127           0 : OUString SAL_CALL java_sql_ResultSetMetaData::getColumnServiceName( sal_Int32 column ) throw(SQLException, RuntimeException, std::exception)
     128             : {
     129             :     static jmethodID mID(NULL);
     130           0 :     return callStringMethodWithIntArg("getColumnClassName",mID,column);
     131             : }
     132             : 
     133             : 
     134           6 : sal_Bool SAL_CALL java_sql_ResultSetMetaData::isCurrency( sal_Int32 column ) throw(SQLException, RuntimeException, std::exception)
     135             : {
     136           6 :     if ( m_pConnection->isIgnoreCurrencyEnabled() )
     137           0 :         return sal_False;
     138             :     static jmethodID mID(NULL);
     139           6 :     return callBooleanMethodWithIntArg( "isCurrency", mID,column );
     140             : }
     141             : 
     142             : 
     143           6 : sal_Bool SAL_CALL java_sql_ResultSetMetaData::isAutoIncrement( sal_Int32 column ) throw(SQLException, RuntimeException, std::exception)
     144             : {
     145             :     static jmethodID mID(NULL);
     146           6 :     return callBooleanMethodWithIntArg( "isAutoIncrement", mID,column );
     147             : }
     148             : 
     149             : 
     150             : 
     151           0 : sal_Bool SAL_CALL java_sql_ResultSetMetaData::isSigned( sal_Int32 column ) throw(SQLException, RuntimeException, std::exception)
     152             : {
     153             :     static jmethodID mID(NULL);
     154           0 :     return callBooleanMethodWithIntArg( "isSigned", mID,column );
     155             : }
     156             : 
     157           0 : sal_Int32 SAL_CALL java_sql_ResultSetMetaData::getPrecision( sal_Int32 column ) throw(SQLException, RuntimeException, std::exception)
     158             : {
     159             :     static jmethodID mID(NULL);
     160           0 :     return callIntMethodWithIntArg_ThrowSQL("getPrecision",mID,column);
     161             : }
     162             : 
     163           0 : sal_Int32 SAL_CALL java_sql_ResultSetMetaData::getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception)
     164             : {
     165             :     static jmethodID mID(NULL);
     166           0 :     return callIntMethodWithIntArg_ThrowSQL("getScale",mID,column);
     167             : }
     168             : 
     169           0 : sal_Int32 SAL_CALL java_sql_ResultSetMetaData::isNullable( sal_Int32 column ) throw(SQLException, RuntimeException, std::exception)
     170             : {
     171             :     static jmethodID mID(NULL);
     172           0 :     return callIntMethodWithIntArg_ThrowSQL("isNullable",mID,column);
     173             : }
     174             : 
     175             : 
     176           0 : sal_Bool SAL_CALL java_sql_ResultSetMetaData::isSearchable( sal_Int32 column ) throw(SQLException, RuntimeException, std::exception)
     177             : {
     178             :     static jmethodID mID(NULL);
     179           0 :     return callBooleanMethodWithIntArg( "isSearchable", mID,column );
     180             : }
     181             : 
     182             : 
     183           0 : sal_Bool SAL_CALL java_sql_ResultSetMetaData::isReadOnly( sal_Int32 column ) throw(SQLException, RuntimeException, std::exception)
     184             : {
     185             :     static jmethodID mID(NULL);
     186           0 :     return callBooleanMethodWithIntArg( "isReadOnly", mID,column );
     187             : }
     188             : 
     189             : 
     190           0 : sal_Bool SAL_CALL java_sql_ResultSetMetaData::isDefinitelyWritable( sal_Int32 column ) throw(SQLException, RuntimeException, std::exception)
     191             : {
     192             :     static jmethodID mID(NULL);
     193           0 :     return callBooleanMethodWithIntArg( "isDefinitelyWritable", mID,column );
     194             : }
     195             : 
     196           0 : sal_Bool SAL_CALL java_sql_ResultSetMetaData::isWritable( sal_Int32 column ) throw(SQLException, RuntimeException, std::exception)
     197             : {
     198             :     static jmethodID mID(NULL);
     199           0 :     return callBooleanMethodWithIntArg( "isWritable", mID,column );
     200             : }
     201             : 
     202             : 
     203             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10