Class Reference
IRIS for UNIX 2019.2
InterSystems: The power behind what matters   
Documentation  Search
  [%SYS] >  [%Library] >  [SQLConnection]
Private  Storage   

persistent class %Library.SQLConnection extends %Persistent, %XML.Adaptor

SQL Table Name: sys_SQLConnection


Parameters Properties Methods Queries Indices ForeignKeys Triggers
24 4 2 1


DSN Name OnConnectStatement ReverseOJ
URL Usr bUnicodeStream bindTSasString
classpath driver isJDBC needlongdatalen
noconcat nodefq nofnconv nvl
properties pwd useCAST useCASTCHAR
useCOALESCE xadriver

%AddToSaveSet %AddToSyncSet %BMEBuilt %CheckConstraints
%CheckConstraintsForExtent %ClassIsLatestVersion %ClassName %ComposeOid
%ConstructClone %Delete %DeleteExtent %DeleteId
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Exists
%ExistsId %Extends %GUID %GUIDSet
%GetLock %GetParameter %GetSwizzleObject %Id
%InsertBatch %IsA %IsModified %IsNull
%KillExtent %KillExtentData %LoadFromMemory %LockExtent
%LockId %New %NormalizeObject %ObjectIsNull
%ObjectModified %Oid %OnBeforeAddToSync %OnDetermineClass
%Open %OpenId %OriginalNamespace %PackageName
%PhysicalAddress %PurgeIndices %Reload %RemoveFromSaveSet
%ResolveConcurrencyConflict %RollBack %Save %SaveDirect
%SaveIndices %SerializeObject %SetModified %SortBegin
%SortEnd %SyncObjectIn %SyncTransport %UnlockExtent
%UnlockId %ValidateIndices %ValidateObject ConnExists
XMLDTD XMLExport XMLExportToStream XMLExportToString
XMLNew XMLSchema XMLSchemaNamespace XMLSchemaType


• property DSN as %String(CAPTION="DSN",MAXLEN=256);
• property Name as %String(CAPTION="Connection Name") [ SqlFieldName = Connection_Name,Required ];
• property OnConnectStatement as %String(CAPTION="Statement to execute upon connection",MAXLEN=4096);
Statement to execute on remote system immediately after connection. This is only for a Gateway conenction through %Library.GTWConnection.Connect() method. An example usage of this would be to set a session parameter on an Oracle connection: ALTER SESSION SET NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF6'
• property ReverseOJ as %Boolean(CAPTION="Legacy Sybase outer join syntax");
• property URL as %String(CAPTION="URL",MAXLEN=4096);
• property Usr as %String(CAPTION="User");
• property bUnicodeStream as %Boolean(CAPTION="Supports Unicode Streams") [ InitialExpression = 1 ];
• property bindTSasString as %Boolean(CAPTION="Bind TIMESTAMP parameters as VARCHAR") [ InitialExpression = 0 ];
Bind TIMESTAMP type parmaters as VARCHAR. When binding parameter values via the GateWay, some remote systems consider TIMESTAMP as a special structure that does not match the the %TimeStamp datatype format of YYYY-MM-DD HH24:MI;SS[.ssssss]. Setting this property to 1 will bind TIMESTAMP parameters as VARCHARs instead of TIMESTAMP. You might need this setting when binding TIMESTAMP parameters to Oracle, depending on the Oracle driver used.
• property classpath as %Library.String(CAPTION="Class Path",MAXLEN=4096);
• property driver as %String(CAPTION="driver",MAXLEN=256);
• property isJDBC as %Boolean(CAPTION="Is JDBC connection");
• property needlongdatalen as %Boolean(CAPTION="Needs long data length");
• property noconcat as %Boolean(CAPTION="Do not generate {fn concat()}");
• property nodefq as %Boolean(CAPTION="Do not use delimited identifiers by default");
• property nofnconv as %Boolean(CAPTION="Do not generate {fn conv ...} by default");
• property nvl as %Boolean(CAPTION="Use NVL() instead of IFNULL()");
• property properties as %Library.String(CAPTION="Properties",MAXLEN=256);
• property pwd as %CSP.Util.Passwd(CAPTION="Password");
• property useCAST as %Boolean(CAPTION="Use CAST as VARCHAR");
• property useCASTCHAR as %Boolean(CAPTION="Use CAST as CHAR");
• property useCOALESCE as %Boolean(CAPTION="Use COALESCE") [ InitialExpression = 1 ];
• property xadriver as %String(CAPTION="driver",MAXLEN=256);


• classmethod ConnExists(nm As %String) as %Boolean
• method setEncode(val As %Boolean)


• query ByConnection()
Selects Connection_Name, DSN, User, ID
SQL Query :
SELECT Connection_Name, DSN, usr, %ID
FROM %Library.sys_SQLConnection
WHERE Connection_Name is not null
ORDER BY Connection_Name
Lookup by Connection name without input parameter
• query ByName(name As %String = "")
Selects Connection_Name, DSN, User, ID, isJDBC
SQL Query :
SELECT Connection_Name, DSN, usr, %ID, isJDBC
FROM %Library.sys_SQLConnection
WHERE Connection_Name %STARTSWITH %ALPHAUP(:name)
ORDER BY Connection_Name
Lookup by Connection name


•index (NameIndex on Name) [Unique];
Index for property Name

Copyright (c) 2019 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.