示例#1
0
        internal void PrepareInternal(string sql, PrepareOption flag)
        {
            con.ReconnectIfNeed();

            CubridStream stream = con.Stream;

            stream.RequestPrepare(sql, flag);

            handle = stream.ResponseCode;
            resultCacheLifetime = stream.ReadInt();
            statementType       = (CubridStatementype)stream.ReadByte();
            bindCount           = stream.ReadInt();
            isUpdateable        = (stream.ReadByte() == 1);
            columnCount         = stream.ReadInt();

            Debug.WriteLine("handle = " + handle);
            Debug.WriteLine("resultCacheLifetime = " + resultCacheLifetime);
            Debug.WriteLine("statementType = " + statementType);
            Debug.WriteLine("bindCount = " + bindCount);
            Debug.WriteLine("isUpdateable = " + isUpdateable);
            Debug.WriteLine("columnCount = " + columnCount);

            columnInfos = stream.ReadColumnInfo(columnCount);

            if (bindCount > 0)
            {
                parameters = new CubridParameter[bindCount];
            }

            if (statementType == CubridStatementype.CallStoredProcedure)
            {
                columnCount = bindCount + 1;
            }
        }
示例#2
0
        internal void GetOutResultSet(int handle)
        {
            CubridStream stream = con.Stream;

            this.handle = stream.RequestOutResultSet(handle); //TODO: check to need to free old handle

            statementType = (CubridStatementype)stream.ReadByte();
            resultCount   = stream.ReadInt();
            isUpdateable  = (stream.ReadByte() == 1);
            columnCount   = stream.ReadInt();

            Debug.WriteLine("handle = " + handle);
            Debug.WriteLine("statementType = " + statementType);
            Debug.WriteLine("isUpdateable = " + isUpdateable);
            Debug.WriteLine("columnCount = " + columnCount);

            columnInfos = stream.ReadColumnInfo(columnCount);
        }
示例#3
0
        internal bool NextResult()
        {
            CubridStream stream = con.Stream;

            int totalTupleCount = stream.RequestNextResult(handle);

            CubridStatementype commandTypeIs = (CubridStatementype)stream.ReadByte();
            bool isUpdatable  = (stream.ReadByte() == 1) ? true : false;
            int  columnNumber = stream.ReadInt();

            columnInfos = stream.ReadColumnInfo(columnNumber);


            if (commandTypeIs == CubridStatementype.Select)
            {
                cursor = new CubridDataReader(this, handle, totalTupleCount, columnInfos);
            }

            return(true);
        }