From d4682d94595e5cb822f9aa7bba669b5e89712c5c Mon Sep 17 00:00:00 2001
From: gmantele <gmantele@ari.uni-heidelberg.de>
Date: Tue, 16 Jun 2015 11:53:21 +0200
Subject: [PATCH] [TAP] Small fix: the translated SQL query was logged only
 after the query execution ; so, in case of error, the SQL query is not logged
 and can not be checked by service provider.

---
 src/tap/db/JDBCConnection.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/tap/db/JDBCConnection.java b/src/tap/db/JDBCConnection.java
index c596f26..82f49e4 100644
--- a/src/tap/db/JDBCConnection.java
+++ b/src/tap/db/JDBCConnection.java
@@ -144,7 +144,7 @@ import adql.translator.TranslationException;
  * </i></p>
  * 
  * @author Gr&eacute;gory Mantelet (CDS;ARI)
- * @version 2.0 (04/2015)
+ * @version 2.0 (06/2015)
  * @since 2.0
  */
 public class JDBCConnection implements DBConnection {
@@ -432,9 +432,9 @@ public class JDBCConnection implements DBConnection {
 			}
 
 			// 3. Execute the SQL query:
-			result = stmt.executeQuery(sql);
 			if (logger != null)
 				logger.logDB(LogLevel.INFO, this, "EXECUTE", "SQL query: " + sql.replaceAll("(\t|\r?\n)+", " "), null);
+			result = stmt.executeQuery(sql);
 
 			// 4. Return the result through a TableIterator object:
 			if (logger != null)
-- 
GitLab