changeset 5480:7a68967ca72a

AFT/DIPS: Small fixes and workarounds for Oracle DB problems.
author Sascha L. Teichmann <teichmann@intevation.de>
date Wed, 27 Mar 2013 20:19:09 +0100
parents 11fba4dabe05
children 5187911f5d45
files flys-aft/src/main/java/de/intevation/aft/River.java flys-aft/src/main/java/de/intevation/db/SymbolicStatement.java flys-aft/src/main/resources/sql/aft-common.properties flys-aft/src/main/resources/sql/aft-oracle-jdbc-oracledriver.properties
diffstat 4 files changed, 14 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/flys-aft/src/main/java/de/intevation/aft/River.java	Wed Mar 27 18:48:28 2013 +0100
+++ b/flys-aft/src/main/java/de/intevation/aft/River.java	Wed Mar 27 20:19:09 2013 +0100
@@ -196,7 +196,7 @@
         int flysId;
 
         try {
-            if (rs.next()) {
+            if (!rs.next()) {
                 log.error(
                     "FLYS: No master discharge table found for gauge '" +
                     gauge.getAftName() + "'");
--- a/flys-aft/src/main/java/de/intevation/db/SymbolicStatement.java	Wed Mar 27 18:48:28 2013 +0100
+++ b/flys-aft/src/main/java/de/intevation/db/SymbolicStatement.java	Wed Mar 27 20:19:09 2013 +0100
@@ -143,14 +143,23 @@
         }
 
         public boolean execute() throws SQLException {
+            if (log.isDebugEnabled()) {
+                log.debug("execute: " + compiled);
+            }
             return stmnt.execute();
         }
 
         public ResultSet executeQuery() throws SQLException {
+            if (log.isDebugEnabled()) {
+                log.debug("query: " + compiled);
+            }
             return stmnt.executeQuery();
         }
 
         public int executeUpdate() throws SQLException {
+            if (log.isDebugEnabled()) {
+                log.debug("update: " + compiled);
+            }
             return stmnt.executeUpdate();
         }
 
--- a/flys-aft/src/main/resources/sql/aft-common.properties	Wed Mar 27 18:48:28 2013 +0100
+++ b/flys-aft/src/main/resources/sql/aft-common.properties	Wed Mar 27 20:19:09 2013 +0100
@@ -17,9 +17,9 @@
     SELECT TAFELWERT_NR AS id, WASSERSTAND AS w, ABFLUSS AS q FROM TAFELWERT \
     WHERE ABFLUSSTAFEL_NR = :number
 select.bfg.id.current = \
-    SELECT BFG_ID AS BFG_ID FROM ABFLUSSTAFEL \
+    SELECT ABT.BFG_ID AS BFG_ID FROM ABFLUSSTAFEL ABT \
     WHERE GUELTIG_VON IN ( \
         SELECT min(GUELTIG_VON) FROM ABFLUSSTAFEL \
         WHERE GUELTIG_VON IS NOT NULL AND GUELTIG_BIS IS NULL \
         AND MESSSTELLE_NR LIKE :number) \
-    AND MESSSTELLE_NR :number
+    AND MESSSTELLE_NR LIKE :number
--- a/flys-aft/src/main/resources/sql/aft-oracle-jdbc-oracledriver.properties	Wed Mar 27 18:48:28 2013 +0100
+++ b/flys-aft/src/main/resources/sql/aft-oracle-jdbc-oracledriver.properties	Wed Mar 27 20:19:09 2013 +0100
@@ -4,6 +4,6 @@
            GUELTIG_VON, \
            GUELTIG_BIS, \
            PEGELNULLPUNKT, \
-           BFG_ID \
-    FROM ABFLUSSTAFEL \
+           AT.BFG_ID \
+    FROM ABFLUSSTAFEL AT \
     WHERE MESSSTELLE_NR LIKE :number

http://dive4elements.wald.intevation.org