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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-jdbc by date

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