Skip site navigation (1) Skip section navigation (2)

Proposed patch for showing originating query on error

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Proposed patch for showing originating query on error
Date: 2005-07-28 14:00:46
Message-ID: 50AD47FA-2BB3-40DC-AE2B-29D7B0C0FDF7@fastcrypt.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
This just adds an exception to the existing backend exception showing  
the originating query.

Given that the backend doesn't show us this information, a few people  
have asked for it.

Dave

*** 426,437 ****
--- 432,451 ----

           StatementResultHandler handler = new StatementResultHandler 
();
           result = null;
+         try
+         {
               connection.getQueryExecutor().execute(queryToExecute,
                                                 queryParameters,
                                                 handler,
                                                 maxrows,
                                                 fetchSize,
                                                 flags);
+         }
+         catch( SQLException ex )
+         {
+             handler.handleError(new PSQLException(GT.tr("Original  
Query -->") + queryToExecute.toString(queryParameters),  
PSQLState.UNKNOWN_ST
ATE));
+             throw ex;
+         }
           result = firstUnclosedResult = handler.getResults();
       }



Responses

pgsql-jdbc by date

Next:From: Oliver JowettDate: 2005-07-28 14:22:15
Subject: Re: Proposed patch for showing originating query on error
Previous:From: emergency.shower@gmail.comDate: 2005-07-28 12:56:21
Subject: Re: unusual ResultSet.next() behaviour

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group