internal static void DebugResponse(Response response)
        {
            #if DEBUG
            int responseType = s_protocol.GetType(response);

            switch (responseType)
            {
                case ResponseType.UPDATECOUNT:
                    {
                        Debug0("response: updatecount: {0}",
                            s_protocol.GetUpdateCount(response));
                        break;
                    }
                case ResponseType.DATA:
                    {
                        Debug0("response: data:\n {0}",
                            ResultMetaDataToString(response.metaData));
                        break;
                    }
                case ResponseType.ERROR:
                    {
                        HsqlException hex = new HsqlException(response);

                        int errorCode = hex.getErrorCode();
                        string sqlState = hex.getSQLState();
                        string message = hex.getMessage();

                        Debug0("response: error: [{0}] [{1}] {2}",
                            errorCode, sqlState, message);
                        break;
                    }
                case ResponseType.MULTI:
                    {
                        Debug0("response: multi...");

                        Record record = response.rRoot;

                        int count = 0;

                        while (record != null)
                        {
                            response = record.data[0] as Response;

                            if (response != null)
                            {
                                count++;

                                Debug0("multi response {0}:", count);
                                DebugResponse(response);
                            }
                        }

                        break;
                    }
                case ResponseType.SQLEXECUTE:
                    {
                        Debug0("response: sqlexecute");
                        // TODO:
                        //
                        // Basically, we need to know the responseType of
                        // request to which this is a response, before we
                        // can interpret the rest of the response
                        // properly.  The request could have been
                        // to prepare a statement, to execute a batch,
                        // etc.
                        break;
                    }
                default:
                    {
                        Debug0("response: responseType {0}", responseType);

                        break;
                    }
            }
            #endif
        }
Ejemplo n.º 2
0
        internal static void DebugResponse(Response response)
        {
#if DEBUG
            int responseType = s_protocol.GetType(response);

            switch (responseType)
            {
            case ResponseType.UPDATECOUNT:
            {
                Debug0("response: updatecount: {0}",
                       s_protocol.GetUpdateCount(response));
                break;
            }

            case ResponseType.DATA:
            {
                Debug0("response: data:\n {0}",
                       ResultMetaDataToString(response.metaData));
                break;
            }

            case ResponseType.ERROR:
            {
                HsqlException hex = new HsqlException(response);

                int    errorCode = hex.getErrorCode();
                string sqlState  = hex.getSQLState();
                string message   = hex.getMessage();

                Debug0("response: error: [{0}] [{1}] {2}",
                       errorCode, sqlState, message);
                break;
            }

            case ResponseType.MULTI:
            {
                Debug0("response: multi...");

                Record record = response.rRoot;

                int count = 0;

                while (record != null)
                {
                    response = record.data[0] as Response;

                    if (response != null)
                    {
                        count++;

                        Debug0("multi response {0}:", count);
                        DebugResponse(response);
                    }
                }

                break;
            }

            case ResponseType.SQLEXECUTE:
            {
                Debug0("response: sqlexecute");
                // TODO:
                //
                // Basically, we need to know the responseType of
                // request to which this is a response, before we
                // can interpret the rest of the response
                // properly.  The request could have been
                // to prepare a statement, to execute a batch,
                // etc.
                break;
            }

            default:
            {
                Debug0("response: responseType {0}", responseType);

                break;
            }
            }
#endif
        }
Ejemplo n.º 3
0
 public HsqlDataSourceException(HsqlException he)
     : base(he.getMessage(), he)
 {
     m_state = he.getSQLState();
     m_code  = he.getErrorCode();
 }
 public HsqlDataSourceException(HsqlException he)
     : base(he.getMessage(), he)
 {
     m_state = he.getSQLState();
     m_code = he.getErrorCode();
 }