comparison flys-aft/src/main/java/de/intevation/db/SymbolicStatement.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 aad1886ea226
comparison
equal deleted inserted replaced
4075:dbd0b3b1b8b8 4076:039413d7e394
43 catch (SQLException sqle) { 43 catch (SQLException sqle) {
44 log.error("cannot close statement", sqle); 44 log.error("cannot close statement", sqle);
45 } 45 }
46 } 46 }
47 47
48 public void setInt(String key, int value) 48 public Instance setInt(String key, int value)
49 throws SQLException 49 throws SQLException
50 { 50 {
51 List<Integer> pos = positions.get(key.toLowerCase()); 51 List<Integer> pos = positions.get(key.toLowerCase());
52 if (pos != null) { 52 if (pos != null) {
53 for (Integer p: pos) { 53 for (Integer p: pos) {
54 stmnt.setInt(p, value); 54 stmnt.setInt(p, value);
55 } 55 }
56 } 56 }
57
58 return this;
57 } 59 }
58 60
59 public void setString(String key, String value) 61 public Instance setString(String key, String value)
60 throws SQLException 62 throws SQLException
61 { 63 {
62 List<Integer> pos = positions.get(key.toLowerCase()); 64 List<Integer> pos = positions.get(key.toLowerCase());
63 if (pos != null) { 65 if (pos != null) {
64 for (Integer p: pos) { 66 for (Integer p: pos) {
65 stmnt.setString(p, value); 67 stmnt.setString(p, value);
66 } 68 }
67 } 69 }
70 return this;
68 } 71 }
69 72
70 public void setObject(String key, Object value) 73 public Instance setObject(String key, Object value)
71 throws SQLException 74 throws SQLException
72 { 75 {
73 List<Integer> pos = positions.get(key.toLowerCase()); 76 List<Integer> pos = positions.get(key.toLowerCase());
74 if (pos != null) { 77 if (pos != null) {
75 for (Integer p: pos) { 78 for (Integer p: pos) {
76 stmnt.setObject(p, value); 79 stmnt.setObject(p, value);
77 } 80 }
78 } 81 }
82 return this;
79 } 83 }
80 84
81 public void setTimestamp(String key, Timestamp value) 85 public Instance setTimestamp(String key, Timestamp value)
82 throws SQLException 86 throws SQLException
83 { 87 {
84 List<Integer> pos = positions.get(key.toLowerCase()); 88 List<Integer> pos = positions.get(key.toLowerCase());
85 if (pos != null) { 89 if (pos != null) {
86 for (Integer p: pos) { 90 for (Integer p: pos) {
87 stmnt.setTimestamp(p, value); 91 stmnt.setTimestamp(p, value);
88 } 92 }
89 } 93 }
94 return this;
90 } 95 }
91 96
92 public void setDouble(String key, int value) 97 public Instance setDouble(String key, int value)
93 throws SQLException 98 throws SQLException
94 { 99 {
95 List<Integer> pos = positions.get(key.toLowerCase()); 100 List<Integer> pos = positions.get(key.toLowerCase());
96 if (pos != null) { 101 if (pos != null) {
97 for (Integer p: pos) { 102 for (Integer p: pos) {
98 stmnt.setDouble(p, value); 103 stmnt.setDouble(p, value);
99 } 104 }
100 } 105 }
106 return this;
101 } 107 }
102 108
103 public void setNull(String key, int sqlType) 109 public Instance setNull(String key, int sqlType)
104 throws SQLException 110 throws SQLException
105 { 111 {
106 List<Integer> pos = positions.get(key.toLowerCase()); 112 List<Integer> pos = positions.get(key.toLowerCase());
107 if (pos != null) { 113 if (pos != null) {
108 for (Integer p: pos) { 114 for (Integer p: pos) {
109 stmnt.setNull(p, sqlType); 115 stmnt.setNull(p, sqlType);
110 } 116 }
111 } 117 }
118 return this;
112 } 119 }
113 120
114 public void set(Map<String, Object> map) throws SQLException { 121 public Instance set(Map<String, Object> map) throws SQLException {
115 for (Map.Entry<String, Object> entry: map.entrySet()) { 122 for (Map.Entry<String, Object> entry: map.entrySet()) {
116 setObject(entry.getKey(), entry.getValue()); 123 setObject(entry.getKey(), entry.getValue());
117 } 124 }
125 return this;
118 } 126 }
119 127
120 public void clearParameters() throws SQLException { 128 public Instance clearParameters() throws SQLException {
121 stmnt.clearParameters(); 129 stmnt.clearParameters();
130 return this;
122 } 131 }
123 132
124 public boolean execute() throws SQLException { 133 public boolean execute() throws SQLException {
125 return stmnt.execute(); 134 return stmnt.execute();
126 } 135 }

http://dive4elements.wald.intevation.org