view testing/utp_1.1/utp_fcns/utpCloseConnection.m @ 45:a59cdb8aaf31 database-connection-manager

Merge
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Tue, 06 Dec 2011 19:07:22 +0100
parents 409a22968d5e
children 7d2e2e065cf1
line wrap: on
line source

% UTPCLOSECONNECTION closes the connection.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% DESCRIPTION: UTPCLOSECONNECTION closes the connection.
%
% CALL:        utpGetConnection(conn)
%
% VERSION:     $Id: utpCloseConnection.m,v 1.2 2009/09/20 15:38:53 ingo Exp $
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function utpCloseConnection(conn)
  
  if isa(conn, 'database')
    % MATLAB connection
    if isconnection(conn)
      close(conn);
    end
  elseif isa(conn, 'mpipeline.repository.RepositoryConnection')
    % java connection
    conn.closeConnection();
  else
    error('### Unknown connection [%s]. Can not close the connection', class(conn));
  end
  
end