/// <summary>
        /// Executes the query.
        /// </summary>
        /// <param name="command">The command.</param>
        /// <returns>IDfCollection.</returns>
        public IDfCollection ExecuteQuery(DqlCommand command)
        {
            //File.AppendAllText("DqlConnect.log", sessionId + " executing query \r\n");
            //File.AppendAllText("DqlConnect.log", sessionId + " state " + state + Environment.NewLine);

            if (state == ConnectionState.Closed)
            {
                throw new System.InvalidOperationException("Invalid operation. The connection is closed.");
            }

            if (_session == null || !_session.isConnected())
            {
                throw new DqlSessionException("Invalid Documentum Session");
            }

            if (_clientx == null)
            {
                throw new Exception("The operation in invalid. Please check the connection and/or connection string and try again.\r\nFailed to retrieve a DQL client object");
            }
            IDfQuery query = _clientx.getQuery();

            if (query == null)
            {
                throw new Exception("IDfQuery object is null");
            }

            query.setDQL(command.CommandText);
            query.setBatchSize(10000);

            return(query.execute(_session, (int)tagDfQueryTypes.IDfQuery_DF_READ_QUERY));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="DqlDataAdapter" /> class.
 /// </summary>
 /// <param name="selectCommandText">The select command text.</param>
 /// <param name="selectConnectionString">The select connection string.</param>
 public DqlDataAdapter(string selectCommandText, string selectConnectionString)
 {
     this.command = new DqlCommand(selectCommandText)
     {
         CommandText = selectCommandText,
         CommandType = CommandType.Text
     };
 }
示例#3
0
        /// <summary>
        /// Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>A new object that is a copy of this instance.</returns>
        public object Clone()
        {
            var dqlCommand = new DqlCommand(this);

            return(dqlCommand);

            //  return this.Clone();
        }
 /// <summary>
 /// Releases the unmanaged resources used by the <see cref="T:System.Data.Common.DbDataAdapter" /> and optionally releases the managed resources.
 /// </summary>
 /// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
 protected override void Dispose(bool disposing)
 {
     base.Dispose(disposing);
     if (disposing)
     {
         command.Dispose();
         command = null;
         GC.Collect();
         GC.WaitForPendingFinalizers();
     }
 }
示例#5
0
 private DqlCommand(DqlCommand from)
     : this()
 {
     this.CommandText       = from.CommandText;
     this.CommandTimeout    = from.CommandTimeout;
     this.CommandType       = from.CommandType;
     this.connection        = from.Connection;
     this.DesignTimeVisible = from.DesignTimeVisible;
     this.Transaction       = from.Transaction;
     this.UpdatedRowSource  = from.UpdatedRowSource;
     //this._columnEncryptionSetting = from.ColumnEncryptionSetting;
     //DqlParameterCollection parameters = this.Parameters;
     //foreach (object obj in (DbParameterCollection)from.Parameters)
     //    parameters.Add(obj is ICloneable ? (obj as ICloneable).Clone() : obj);
 }
        /// <summary>
        /// Returns schema information for the data source of this <see cref="T:System.Data.Common.DbConnection" /> using the specified string for the schema name.
        /// </summary>
        /// <param name="collectionName">Specifies the name of the schema to return.</param>
        /// <returns>A <see cref="T:System.Data.DataTable" /> that contains schema information.</returns>
        /// <exception cref="System.NotImplementedException"></exception>
        /// <PermissionSet>
        ///   <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" PathDiscovery="*AllFiles*" />
        /// </PermissionSet>
        public override DataTable GetSchema(string collectionName)
        {
            var select = "select distinct t.name, t.attr_name, t.attr_type, '0' as min_length,";

            select += "t.attr_length, t.attr_repeating, a.not_null as mandatory from dm_type t,";
            select += string.Format("dmi_dd_attr_info a where t.name = a.type_name and t.attr_name = a.attr_name and t.name = '{0}' enable(row_based)", collectionName);

            DataSet ds = new DataSet(collectionName);

            using (DqlCommand cmd = new DqlCommand(select, this))
            {
                using (DqlDataAdapter adapter = new DqlProvider.DqlDataAdapter(cmd))
                {
                    adapter.Fill(ds);
                }
            }
            return(ds.Tables[0]);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="DqlDataAdapter" /> class.
 /// </summary>
 /// <param name="selectCommand">The select command.</param>
 public DqlDataAdapter(DqlCommand selectCommand)
 {
     this.command = selectCommand;
 }