Difference between revisions of "Extensions.SQL.CloseConnection"

From emotive
Jump to navigation Jump to search
(→‎Classification: Edited by Ngoc Tran.)
Line 1: Line 1:
 
{{DISPLAYTITLE:OTX '''CloseConnection'''}}[[Category:SQL]]
 
{{DISPLAYTITLE:OTX '''CloseConnection'''}}[[Category:SQL]]
 
== Classification ==
 
== Classification ==
{{ClassificationActivity | CloseConnection | Closes the current connection | [[Action]] | [[Extensions.SQL | OTX SQL extension]] | [[Extensions.SQL#Actions | SQL related Actions]]| [[Extensions.SQL.ConnectionException|ConnectionException]] | -|}}
+
{{ClassificationActivity | CloseConnection | Closes the current connection | [[Action]] | [[Extensions.Sql | OTX SQL extension]] | [[Extensions.Sql#Actions | SQL related Actions]]| [[Extensions.SQL.ConnectionException|ConnectionException]] | -|}}
  
 
== OTL Syntax ==
 
== OTL Syntax ==

Revision as of 04:24, 24 September 2019

Classification

Name CloseConnection
Short Description Closes the current connection
Class Action
Extension OTX SQL extension
Group SQL related Actions
Exceptions ConnectionException
Checker Rules -
Standard Compliant Yes

OTL Syntax

ActionRealisation SQL.CloseConnection(ConnectionVariable connection);

Description

The CloseConnection action closes the current connection and releases any resources associated with the current connection. The use of CloseConnection is optional. An OTX runtime system shall automatically close any open connection at an appropriate time, e.g. at the end of the runtime execution. If a sequence uses a connection after it is been closed by a CloseConnection action, the runtime system shall throw an otx:InvalidReferenceException.

Properties

Name Data Type Class Default Cardinality Description
ConnectionVariable ConnectionVariable Variable - [1..1] This element represents the specified connection variable that shall be closed.

OTL Examples

/// Local Declarations

SQL.Connection Connection1;
Exception Exception1;

/// Flow

try
{
	Connection1 = SQL.CreateConnection("DRIVER={SQL Server};Server=.;InitialCatalog=classicmodels;username=sa;password=saas");
}
catch (Exception)
{
	Connection1 = SQL.CreateConnection("jdbc:sqlserver://localhost;databaseName=classicmodels;username=sa;password=saas");
}
catch (Exception Exception1)
{
	throw Exception1;
}

SQL.CloseConnection(Connection1);

See also

CreateConnection
ExecuteQuery
ExecuteUpdate
GetResultValueAsString
GetResultValueAsInteger
NextResult