LCOV - code coverage report
Current view: top level - connectivity/source/drivers/dbase - DConnection.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 35 39 89.7 %
Date: 2014-04-11 Functions: 7 11 63.6 %
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             : 
      21             : #include "dbase/DConnection.hxx"
      22             : #include "dbase/DDatabaseMetaData.hxx"
      23             : #include "dbase/DCatalog.hxx"
      24             : #include "dbase/DDriver.hxx"
      25             : #include <com/sun/star/lang/DisposedException.hpp>
      26             : #include "dbase/DPreparedStatement.hxx"
      27             : #include "dbase/DStatement.hxx"
      28             : #include <tools/debug.hxx>
      29             : #include <connectivity/dbexception.hxx>
      30             : 
      31             : using namespace connectivity::dbase;
      32             : using namespace connectivity::file;
      33             : 
      34             : typedef connectivity::file::OConnection  OConnection_BASE;
      35             : 
      36             : 
      37             : using namespace ::com::sun::star::uno;
      38             : using namespace ::com::sun::star::beans;
      39             : using namespace ::com::sun::star::sdbcx;
      40             : using namespace ::com::sun::star::sdbc;
      41             : using namespace ::com::sun::star::lang;
      42             : 
      43          29 : ODbaseConnection::ODbaseConnection(ODriver* _pDriver) : OConnection(_pDriver)
      44             : {
      45          29 :     m_aFilenameExtension = "dbf";
      46          29 : }
      47             : 
      48          54 : ODbaseConnection::~ODbaseConnection()
      49             : {
      50          54 : }
      51             : 
      52             : // XServiceInfo
      53             : 
      54           0 : IMPLEMENT_SERVICE_INFO(ODbaseConnection, "com.sun.star.sdbc.drivers.dbase.Connection", "com.sun.star.sdbc.Connection")
      55             : 
      56             : 
      57        2703 : Reference< XDatabaseMetaData > SAL_CALL ODbaseConnection::getMetaData(  ) throw(SQLException, RuntimeException, std::exception)
      58             : {
      59        2703 :     ::osl::MutexGuard aGuard( m_aMutex );
      60        2703 :     checkDisposed(OConnection_BASE::rBHelper.bDisposed);
      61             : 
      62             : 
      63        2703 :     Reference< XDatabaseMetaData > xMetaData = m_xMetaData;
      64        2703 :     if(!xMetaData.is())
      65             :     {
      66          29 :         xMetaData = new ODbaseDatabaseMetaData(this);
      67          29 :         m_xMetaData = xMetaData;
      68             :     }
      69             : 
      70        2703 :     return xMetaData;
      71             : }
      72             : 
      73          91 : ::com::sun::star::uno::Reference< XTablesSupplier > ODbaseConnection::createCatalog()
      74             : {
      75          91 :     ::osl::MutexGuard aGuard( m_aMutex );
      76          91 :     Reference< XTablesSupplier > xTab = m_xCatalog;
      77          91 :     if(!xTab.is())
      78             :     {
      79          29 :         ODbaseCatalog *pCat = new ODbaseCatalog(this);
      80          29 :         xTab = pCat;
      81          29 :         m_xCatalog = xTab;
      82             :     }
      83          91 :     return xTab;
      84             : }
      85             : 
      86          11 : Reference< XStatement > SAL_CALL ODbaseConnection::createStatement(  ) throw(SQLException, RuntimeException, std::exception)
      87             : {
      88          11 :     ::osl::MutexGuard aGuard( m_aMutex );
      89          11 :     checkDisposed(OConnection_BASE::rBHelper.bDisposed);
      90             : 
      91             : 
      92          11 :     Reference< XStatement > xReturn = new ODbaseStatement(this);
      93          11 :     m_aStatements.push_back(WeakReferenceHelper(xReturn));
      94          11 :     return xReturn;
      95             : }
      96             : 
      97          51 : Reference< XPreparedStatement > SAL_CALL ODbaseConnection::prepareStatement( const OUString& sql ) throw(SQLException, RuntimeException, std::exception)
      98             : {
      99          51 :     ::osl::MutexGuard aGuard( m_aMutex );
     100          51 :     checkDisposed(OConnection_BASE::rBHelper.bDisposed);
     101             : 
     102             : 
     103          51 :     ODbasePreparedStatement* pStmt = new ODbasePreparedStatement(this);
     104         102 :     Reference< XPreparedStatement > xHoldAlive = pStmt;
     105          51 :     pStmt->construct(sql);
     106          40 :     m_aStatements.push_back(WeakReferenceHelper(*pStmt));
     107          91 :     return pStmt;
     108             : }
     109             : 
     110           0 : Reference< XPreparedStatement > SAL_CALL ODbaseConnection::prepareCall( const OUString& /*sql*/ ) throw(SQLException, RuntimeException, std::exception)
     111             : {
     112           0 :     ::dbtools::throwFeatureNotImplementedException( "XConnection::prepareCall", *this );
     113           0 :     return NULL;
     114             : }
     115             : 
     116             : 
     117             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10