Exemplo n.º 1
0
        private void fillHashFromSQL(Dictionary <int, string> ht, Hashtable rev, string sql)
        {
            ManagedCommand cmd = new ManagedCommand(connection);

            cmd.SetParameters(null);
            try
            {
                cmd.Execute(sql);
                while (cmd.Fetch())
                {
                    int    k    = 0;
                    string v    = null;
                    object data = cmd.GetColumnData(0, cmd.GetColumnMetaData());
                    if (data != null)
                    {
                        k = (int)data;
                    }
                    data = cmd.GetColumnData(1, cmd.GetColumnMetaData());
                    if (data != null && data is string)
                    {
                        v = (string)data;
                    }
                    ht[k]  = v;
                    rev[v] = k;
                }
            }
            finally
            {
                cmd.CloseCursor(true);
                cmd.Dispose();
            }
        }
Exemplo n.º 2
0
        private long rdfMakeObj(object box, string rtype, string lang)
        {
            long ro_id = 0;
            VirtuosoParameterCollection p0 = new VirtuosoParameterCollection(null);

            p0.Add("box", box);
            p0.Add("type", rtype);
            p0.Add("lang", lang);

            ManagedCommand cmd0 = new ManagedCommand(connection);

            cmd0.SetParameters(p0);
            try
            {
                cmd0.Execute("DB.DBA.RDF_MAKE_OBJ_OF_TYPEDSQLVAL (?, ?, ?)");
            }
            finally
            {
                cmd0.CloseCursor(true);
                cmd0.Dispose();
            }

            VirtuosoParameterCollection p1 = new VirtuosoParameterCollection(null);

            p1.Add("box", box);

            ManagedCommand cmd1 = new ManagedCommand(connection);

            cmd1.SetParameters(p1);
            try
            {
                cmd1.Execute("select rdf_box_ro_id (?)");
                while (cmd1.Fetch())
                {
                    object data = cmd1.GetColumnData(0, cmd1.GetColumnMetaData());
                    if (data != null)
                    {
                        ro_id = (long)data;
                    }
                }
            }
            finally
            {
                cmd1.CloseCursor(true);
                cmd1.Dispose();
            }
            return(ro_id);
        }
Exemplo n.º 3
0
        private byte[] GetServerDtcWhereabouts()
        {
            ManagedCommand cmd = new ManagedCommand(this);

            cmd.SetParameters(null);
            try
            {
                cmd.Execute("select mts_get_rmcookie()");
                if (cmd.Fetch())
                {
                    object data = cmd.GetColumnData(0, cmd.GetColumnMetaData());
                    if (data != null && data is string)
                    {
                        return(Decode((string)data));
                    }
                }
            }
            finally
            {
                cmd.CloseCursor(true);
                cmd.Dispose();
            }
            return(null);
        }
      private long rdfMakeObj (object box, string rtype, string lang)
      {
	long ro_id = 0;
	VirtuosoParameterCollection p0 = new VirtuosoParameterCollection (null);
        p0.Add("box", box);
	p0.Add("type", rtype);
        p0.Add("lang", lang);

	ManagedCommand cmd0 = new ManagedCommand (connection);
	cmd0.SetParameters (p0);
	try
	{
		cmd0.Execute ("DB.DBA.RDF_MAKE_OBJ_OF_TYPEDSQLVAL (?, ?, ?)");
	}
	finally
	{
		cmd0.CloseCursor (true);
		cmd0.Dispose ();
	}

	VirtuosoParameterCollection p1 = new VirtuosoParameterCollection (null);
        p1.Add("box", box);

	ManagedCommand cmd1 = new ManagedCommand (connection);
	cmd1.SetParameters (p1);
	try
	{
		cmd1.Execute ("select rdf_box_ro_id (?)");
                while(cmd1.Fetch())
                {
		    object data = cmd1.GetColumnData (0, cmd1.GetColumnMetaData ());
		    if (data != null)
			  ro_id = (long) data;
                }
	}
	finally
	{
		cmd1.CloseCursor (true);
		cmd1.Dispose ();
	}
	return ro_id;
      }
      private void fillHashFromSQL (Dictionary<int,string> ht, Hashtable rev, string sql) 
      {
	ManagedCommand cmd = new ManagedCommand (connection);
	cmd.SetParameters (null);
	try
	{
		cmd.Execute (sql);
                while(cmd.Fetch())
                {
                    int k = 0;
                    string v = null;
		    object data = cmd.GetColumnData (0, cmd.GetColumnMetaData ());
		    if (data != null)
			  k = (int) data;
		    data = cmd.GetColumnData (1, cmd.GetColumnMetaData ());
		    if (data != null && data is string)
			  v = (string) data;
		    ht[k] =  v;
                    rev[v] = k;
                }
	}
	finally
	{
		cmd.CloseCursor (true);
		cmd.Dispose ();
	}
      }
		private byte[] GetServerDtcWhereabouts ()
		{
			ManagedCommand cmd = new ManagedCommand (this);
			cmd.SetParameters (null);
			try
			{
				cmd.Execute ("select mts_get_rmcookie()");
				if (cmd.Fetch ())
				{
					object data = cmd.GetColumnData (0, cmd.GetColumnMetaData ());
					if (data != null && data is string)
						return Decode ((string) data);
				}
			}
			finally
			{
				cmd.CloseCursor (true);
				cmd.Dispose ();
			}
			return null;
		}