示例#1
0
        public override IDbCommand GetCommand(IGxConnection con, string stmt, GxParameterCollection parameters, bool isCursor, bool forFirst, bool isRpc)
        {
            if (isRpc)
            {
                stmt = convertToMySqlCall(stmt, parameters);
            }
            MySQLCommand mysqlcmd = (MySQLCommand)base.GetCommand(con, stmt, parameters.Distinct());

            if (isCursor && !isRpc)
            {
                mysqlcmd.Prepare();
            }
            return(mysqlcmd);
        }
示例#2
0
        public override IDataReader GetDataReader(
            IGxConnectionManager connManager,
            IGxConnection con,
            GxParameterCollection parameters,
            string stmt, ushort fetchSize,
            bool forFirst, int handle,
            bool cached, SlidingTime expiration,
            bool hasNested,
            bool dynStmt)
        {
            IDataReader idatareader;

            if (!hasNested)            //Client Cursor
            {
                GXLogging.Debug(log, "ExecuteReader: client cursor=" + hasNested + ", handle '" + handle + "'" + ", hashcode " + this.GetHashCode());
                idatareader = new GxMySQLConnectorDataReader(connManager, this, con, parameters.Distinct(), stmt, fetchSize, forFirst, handle, cached, expiration, dynStmt);
            }
            else             //Server Cursor
            {
                GXLogging.Debug(log, "ExecuteReader: server cursor=" + hasNested + ", handle '" + handle + "'" + ", hashcode " + this.GetHashCode());
                idatareader = new GxMySqlMemoryDataReader(connManager, this, con, parameters.Distinct(), stmt, fetchSize, forFirst, handle, cached, expiration, dynStmt);
            }
            return(idatareader);
        }