DB2 10.5 for Linux, UNIX, and Windows

DB2Connection Members

The following tables list the members exposed by the DB2Connection class.

Public Constructors

Name Description
public constructor DB2®Connection Overloaded. Initializes a new instance of the DB2Connection class.

Public Properties

Name Description
public property ARMCorrelator Sets the connection property to allow the association of statements to a workload manager on the data server.
Data server restrictions:
Informix®
This property has no effect.
public property BatchCommandTimeout Gets or sets the wait time in seconds before a command that consists of chained SQL statements is terminated.
public property CacheData Gets or sets a Boolean value that indicates whether data caching is being used.
public property CacheUSRLIBLValue Gets or sets a Boolean value that indicates whether caching of the user libraries (*USRLIBL libraries) is enabled for all connections to DB2 for i in the same connection pool.
public property Chaining Gets a Boolean value that indicates whether chaining is active.
public property ClientAccountingInformation Gets or sets the string that contains the client accounting information.
public property ClientApplicationInformation Gets or sets the string that contains the client application name.
public property ClientCorrelationToken Gets or sets the client correlation token name on DB2 for z/OS Version 11 servers in new function mode (NFM).
public property ClientUser Gets or sets the string that contains the client user ID.
public property ClientWorkstation Gets or sets the string that contains the name of the client workstation.
public property ConnectionString Gets or sets the string that is used to open a database connection.
public property ConnectionTimeout Gets or sets a value that limits the amount of time that an application waits for a connection.
public property Container (inherited from the Component class) Gets the IContainer interface object that contains the Component class object.
public property Database Gets the name of the current database or the database that is used after a connection is opened.
public property DataSource Gets the name of the current data source or the data source that is used after a connection is opened.
public property EnableExtendedIndicators Enables the use of default and unassigned indicators as parameters.
public property FitHighPrecisionType Gets or sets the type of precision to use. The acceptable values are as follows:
AsString
Converts the data type in the column to a .NET string type.
ReturnException
Results in a truncation exception if the size of the value exceeds the size of the .NET system type.
WithTruncate
Returns a .NET system type after silently truncating the column value if needed.
public property ResultSetAsReturnValue Gets or sets the value that indicates whether the provider retrieves results sets from Informix database server UDRs as a ReturnValue parameter.
public property RetryParameterBindingOnError Gets or sets the value that indicates whether the provider reruns failed statements.
public property ServerBuildVersion Gets a string that contains the build version of the server to which the client is connected.
public property ServerMajorVersion Gets a string that contains the major version of the server to which the client is connected.
public property ServerMinorVersion Gets a string that contains the minor version of the server to which the client is connected.
public property ServerRevisionVersion Gets a string that contains the revision version of the server to which the client is connected.
public property ServerType Gets a string that contains the type of server to which the client is connected.
public property ServerVersion Gets a string that contains the version of the server to which the client is connected.
public property Site (inherited from the Component class) Gets or sets the ISite interface object of the Component class object.
public property State Gets the current state of the connection.
public property SystemNaming Specifies whether the system naming mode or the SQL naming mode is used for a connection to the DB2 for i server.

Public Methods

Name Description
public method BeginChain Marks the beginning of a chain of insert, update, and delete statements to be sent to the database server.
public method BeginTransaction Overloaded. Begins a transaction at the database.
public method ChangeDatabase Changes the current database associated with an open DB2Connection.
public method Close Closes the connection to the database. This is the preferred method of closing any open connection.
public method CreateCommand Creates and returns a DB2Command object associated with the DB2Connection.
public method CreateObjRef (inherited from MarshalByRefObject) Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
public method Dispose (inherited from Component) Overloaded. Releases the resources used by the Component.
public method DropDTD Drops the DTD registered with the database.
public method DropXmlSchema Drops the schema registered with the database.
Data server restrictions:
Informix
This method is not supported.
public method EndChain

Marks the end of a chain of insert, update, and delete statements to be sent to the database server.

public method EnlistDistributedTransaction Enlists in the specified transaction as a distributed transaction.
public method EnlistTransaction (inherited from DbConnection) Overloaded. Enlists in the specified transaction.
public method Equals (inherited from Object) Overloaded. Determines whether two Object instances are equal.
public method GetDTD Gets the DTD registered with the database.
public method GetHashCode (inherited from Object) Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
public method GetLifetimeService (inherited from MarshalByRefObject) Retrieves the current lifetime service object that controls the lifetime policy for this instance.
public method GetType (inherited from Object) Gets the Type of the current instance.
public method GetSchema() Overloaded. Returns a DataTable with metadata for the data source associated with this DB2Connection instance.
public method GetXmlSchemaSet Gets the schema registered with the database.
Data server restrictions:
Informix
This method is not supported.
public method InitializeLifetimeService (inherited from MarshalByRefObject) Obtains a lifetime service object to control the lifetime policy for this instance.
public method Open Opens a connection to a database with the property settings specified by the ConnectionString .
public method RegisterDTD Registers the DTD with the database.
public method RegisterXmlSchema Overloaded. Registers the schema with the database, including the URLs for the files containing the XML document property data, and a URL for the file containing the XML schema properties document.
Data server restrictions:
Informix
This method is not supported.
public method static (Shared in Visual Basic) ReleaseObjectPool Indicates that the DB2Connection object pool can be released when the last underlying connection is released.
public method ToString (inherited from Object) Returns a String that represents the current Object.

Public Events

Name Description
public event Disposed (inherited from Component) Adds an event handler to listen to the Disposed event on the component.
public event InfoMessage Occurs when the IBM Data Server Provider for .NET sends a warning or an informational message.
public event StateChange Occurs when the state of the connection changes.

Protected Properties

Name Description
protected property DesignMode (inherited from Component) Gets a value that indicates whether the Component is currently in design mode.
protected property Events (inherited from Component) Gets the list of event handlers that are attached to this Component.

Protected Methods

Name Description
public method Dispose Overloaded. Overridden. Releases the resources used by the DB2Connection.
public method Finalize (inherited from Object) Overridden. Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.

In C# and Microsoft Visual C++, finalizers are expressed using destructor syntax.

public method GetService (inherited from Component) Returns an object that represents a service provided by the Component or by its Container.
public method MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.