OTX Reference  
OpenTestSystem.Otx.Extensions.SQL.Actions.CloseConnection Class Reference

Closes the current connection More...

Inheritance diagram for OpenTestSystem.Otx.Extensions.SQL.Actions.CloseConnection:
Inheritance graph

Public Attributes

ConnectionVariable connection
 This element represents the specified connection variable that shall be closed. More...
 
- Public Attributes inherited from OpenTestSystem.Otx.Core.Actions.ActionRealisation
OtxLink validFor
 Validity of ActionRealisation. More...
 

Detailed Description

Closes the current connection

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.

Exceptions
Exceptions.ConnectionException
Syntax
SQL.CloseConnection(ConnectionVariable connection);
ConnectionVariable connection
This element represents the specified connection variable that shall be closed.
Definition: SQL.cs:685
Examples
// Local Declarations
SQL.Connection Connection1;
Exception Exception1;
// Flow
try
{
// connect with DotNet platform
Connection1 = SQL.CreateConnection("DRIVER={SQL Server};Server=.;InitialCatalog=classicmodels;username=sa;password=saas");
}
catch (Exception)
{
// connect with Java platform
Connection1 = SQL.CreateConnection("jdbc:sqlserver://localhost;databaseName=classicmodels;username=sa;password=saas");
}
catch (Exception Exception1)
{
throw Exception1;
}
SQL.CloseConnection(Connection1);

Member Data Documentation

◆ connection

ConnectionVariable OpenTestSystem.Otx.Extensions.SQL.Actions.CloseConnection.connection

This element represents the specified connection variable that shall be closed.