diff flys-aft/src/main/java/de/intevation/aft/River.java @ 4076:039413d7e394

Load gauges from both dbs. flys-aft/trunk@3436 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 16 Dec 2011 11:26:12 +0000
parents dbd0b3b1b8b8
children 97de7a552b79
line wrap: on
line diff
--- a/flys-aft/src/main/java/de/intevation/aft/River.java	Wed Dec 14 17:53:15 2011 +0000
+++ b/flys-aft/src/main/java/de/intevation/aft/River.java	Fri Dec 16 11:26:12 2011 +0000
@@ -1,5 +1,6 @@
 package de.intevation.aft;
 
+import java.sql.ResultSet;
 import java.sql.SQLException;
 
 import org.apache.log4j.Logger;
@@ -32,6 +33,31 @@
     throws SQLException
     {
         log.info("sync river: " + this);
+        ResultSet messstellenRs = aftStatements
+            .getStatement("select.messstelle")
+            .clearParameters()
+            .setInt("GEWAESSER_NR", id2).executeQuery();
+
+        while (messstellenRs.next()) {
+            String name = messstellenRs.getString("NAME");
+            String num  = messstellenRs.getString("MESSSTELLE_NR");
+            System.err.println(name + ": " + num);
+        }
+
+        messstellenRs.close();
+
+        ResultSet gaugesRs = flysStatements
+            .getStatement("select.gauges")
+            .clearParameters()
+            .setInt("river_id", id1).executeQuery();
+
+        while (gaugesRs.next()) {
+            int gaugeId = gaugesRs.getInt("id");
+            String name = gaugesRs.getString("name");
+            System.err.println(name + ": " + gaugeId);
+        }
+
+        gaugesRs.close();
     }
 
     public String toString() {

http://dive4elements.wald.intevation.org