Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/ResultData.java @ 1716:3ca999f507b7
flys/issue314: Variables in datacage are now case insensitive.
flys-artifacts/trunk@2994 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 17 Oct 2011 15:53:03 +0000 |
parents | 5cb84ceee2a0 |
children | 481ac6468016 |
comparison
equal
deleted
inserted
replaced
1715:a70e0cbc5e02 | 1716:3ca999f507b7 |
---|---|
7 import java.sql.SQLException; | 7 import java.sql.SQLException; |
8 | 8 |
9 import java.util.List; | 9 import java.util.List; |
10 import java.util.ArrayList; | 10 import java.util.ArrayList; |
11 | 11 |
12 import org.apache.log4j.Logger; | |
13 | |
12 public class ResultData | 14 public class ResultData |
13 implements Serializable | 15 implements Serializable |
14 { | 16 { |
17 private static Logger log = Logger.getLogger(ResultData.class); | |
18 | |
15 protected String [] columns; | 19 protected String [] columns; |
16 | 20 |
17 protected List<Object []> rows; | 21 protected List<Object []> rows; |
18 | 22 |
19 public ResultData() { | 23 public ResultData() { |
23 public ResultData(ResultSetMetaData meta) | 27 public ResultData(ResultSetMetaData meta) |
24 throws SQLException | 28 throws SQLException |
25 { | 29 { |
26 this(); | 30 this(); |
27 | 31 |
32 boolean debug = log.isDebugEnabled(); | |
33 | |
28 int N = meta.getColumnCount(); | 34 int N = meta.getColumnCount(); |
29 | 35 |
30 columns = new String[N]; | 36 columns = new String[N]; |
31 | 37 |
38 if (debug) { | |
39 log.debug("ResultSet column names:"); | |
40 } | |
41 | |
32 for (int i = 1; i <= N; ++i) { | 42 for (int i = 1; i <= N; ++i) { |
33 columns[i-1] = meta.getColumnLabel(i); | 43 columns[i-1] = meta.getColumnLabel(i).toUpperCase(); |
44 if (debug) { | |
45 log.debug(" " + i + ": " + columns[i-1]); | |
46 } | |
34 } | 47 } |
35 } | 48 } |
36 | 49 |
37 public String [] getColumnLabels() { | 50 public String [] getColumnLabels() { |
38 return columns; | 51 return columns; |