Extensions.SQL.CreateConnection

From emotive
Jump to navigation Jump to search

Classification

Name CreateConnection
Short Description Open a connection using the specified connection string for access
Class Term
Extension OTX SQL extension
Group SQL related Terms
Exceptions ConnectionException
Checker Rules -
Standard Compliant Yes

OTL Syntax

ConnectionTerm SQL.CreateConnection(StringTerm connectionString);

Description

The CreateConnection term will open a connection using the specified connection string for access and returns the Connection for the application.

Return Value

The Term returns the value, see table below.

Icons Note.png In OTX, Terms are categorized according to its return data type!
Data Type Description
Connection

Properties

Name Data Type Class Default Cardinality Description
connectionString String Term - [1..1] Specifies the location of the data source that is required for the connection. Connection string used to create the connection that pass for creation of command variable. The connection string includes the source database name and other parameters needed to establish the initial connection.

OTL Examples

	/// Local Declarations

	SQL.Connection Connection1;

	/// Flow

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

See also

CloseConnection
ExecuteQuery
ExecuteUpdate
ConnectionTerm
ConnectionValue
CreateConnection
GetResultValueAsBoolean
GetResultValueAsByteField
GetResultValueAsFloat
GetResultValueAsInteger
GetResultValueAsString
NextResult
ResultSetTerm
ResultSetValue