Mercurial > dive4elements > river
comparison 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 |
comparison
equal
deleted
inserted
replaced
4075:dbd0b3b1b8b8 | 4076:039413d7e394 |
---|---|
1 package de.intevation.aft; | 1 package de.intevation.aft; |
2 | 2 |
3 import java.sql.ResultSet; | |
3 import java.sql.SQLException; | 4 import java.sql.SQLException; |
4 | 5 |
5 import org.apache.log4j.Logger; | 6 import org.apache.log4j.Logger; |
6 | 7 |
7 import de.intevation.db.ConnectedStatements; | 8 import de.intevation.db.ConnectedStatements; |
30 ConnectedStatements flysStatements | 31 ConnectedStatements flysStatements |
31 ) | 32 ) |
32 throws SQLException | 33 throws SQLException |
33 { | 34 { |
34 log.info("sync river: " + this); | 35 log.info("sync river: " + this); |
36 ResultSet messstellenRs = aftStatements | |
37 .getStatement("select.messstelle") | |
38 .clearParameters() | |
39 .setInt("GEWAESSER_NR", id2).executeQuery(); | |
40 | |
41 while (messstellenRs.next()) { | |
42 String name = messstellenRs.getString("NAME"); | |
43 String num = messstellenRs.getString("MESSSTELLE_NR"); | |
44 System.err.println(name + ": " + num); | |
45 } | |
46 | |
47 messstellenRs.close(); | |
48 | |
49 ResultSet gaugesRs = flysStatements | |
50 .getStatement("select.gauges") | |
51 .clearParameters() | |
52 .setInt("river_id", id1).executeQuery(); | |
53 | |
54 while (gaugesRs.next()) { | |
55 int gaugeId = gaugesRs.getInt("id"); | |
56 String name = gaugesRs.getString("name"); | |
57 System.err.println(name + ": " + gaugeId); | |
58 } | |
59 | |
60 gaugesRs.close(); | |
35 } | 61 } |
36 | 62 |
37 public String toString() { | 63 public String toString() { |
38 return "[River: name=" + name + ", " + super.toString() + "]"; | 64 return "[River: name=" + name + ", " + super.toString() + "]"; |
39 } | 65 } |