Mercurial > dive4elements > gnv-client
comparison geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/DefaultQueryExceutor.java @ 885:1c3efbd2fc5a
Removes trailing whitespace.
geo-backend/trunk@850 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 29 Mar 2010 07:49:16 +0000 |
parents | 3cbf11c67fdc |
children | 8b442223741c |
comparison
equal
deleted
inserted
replaced
884:12f88239fb33 | 885:1c3efbd2fc5a |
---|---|
24 * It fetchs the Query from the Querycontainer an put the Filtervalues into the Query. | 24 * It fetchs the Query from the Querycontainer an put the Filtervalues into the Query. |
25 * @author Tim Englich <tim.englich@intevation.de> | 25 * @author Tim Englich <tim.englich@intevation.de> |
26 * | 26 * |
27 */ | 27 */ |
28 public class DefaultQueryExceutor extends QueryExecutorBase{ | 28 public class DefaultQueryExceutor extends QueryExecutorBase{ |
29 | 29 |
30 | 30 |
31 /** | 31 /** |
32 * the logger, used to log exceptions and additonaly information | 32 * the logger, used to log exceptions and additonaly information |
33 */ | 33 */ |
34 private static Logger log = Logger.getLogger(DefaultQueryExceutor.class); | 34 private static Logger log = Logger.getLogger(DefaultQueryExceutor.class); |
35 | 35 |
36 /** | 36 /** |
37 * The ConnectionID identifing the Connection to use executing the Query. | 37 * The ConnectionID identifing the Connection to use executing the Query. |
38 */ | 38 */ |
39 private String connectionID = "N/N"; | 39 private String connectionID = "N/N"; |
40 | 40 |
41 /** | 41 /** |
42 * Constructor | 42 * Constructor |
43 */ | 43 */ |
44 public DefaultQueryExceutor() { | 44 public DefaultQueryExceutor() { |
45 super(); | 45 super(); |
55 if (queryString != null){ | 55 if (queryString != null){ |
56 if (filter != null && filter.length > 0){ | 56 if (filter != null && filter.length > 0){ |
57 //Insert the Filtervalues into the QueryString | 57 //Insert the Filtervalues into the QueryString |
58 queryString = super.setFilterValues(queryString, filter); | 58 queryString = super.setFilterValues(queryString, filter); |
59 } | 59 } |
60 | 60 |
61 if (log.isDebugEnabled()) { | 61 if (log.isDebugEnabled()) { |
62 log.debug("############ QUERY ##################"); | 62 log.debug("############ QUERY ##################"); |
63 log.debug(queryString); | 63 log.debug(queryString); |
64 log.debug("#######################################"); | 64 log.debug("#######################################"); |
65 } | 65 } |
77 connection = connectionPool.getConnection(this.connectionID); | 77 connection = connectionPool.getConnection(this.connectionID); |
78 if (connection != null){ | 78 if (connection != null){ |
79 Statement stmt = connection.createStatement(); | 79 Statement stmt = connection.createStatement(); |
80 ResultSet rs = stmt.executeQuery(queryString); | 80 ResultSet rs = stmt.executeQuery(queryString); |
81 returnValue = super.createResultCollection(rs); | 81 returnValue = super.createResultCollection(rs); |
82 | 82 |
83 }else{ | 83 }else{ |
84 log.error("Could not establish Databaseconnection."); | 84 log.error("Could not establish Databaseconnection."); |
85 throw new QueryException("Could not establish Databaseconnection."); | 85 throw new QueryException("Could not establish Databaseconnection."); |
86 } | 86 } |
87 | 87 |
88 cacheResults(queryString, returnValue); | 88 cacheResults(queryString, returnValue); |
89 | 89 |
90 } catch (ConnectionException e) { | 90 } catch (ConnectionException e) { |
91 log.error(e,e); | 91 log.error(e,e); |
92 throw new QueryException("Could not establish Databaseconnection.",e); | 92 throw new QueryException("Could not establish Databaseconnection.",e); |
93 } catch (SQLException e) { | 93 } catch (SQLException e) { |
94 log.error(e,e); | 94 log.error(e,e); |
105 } | 105 } |
106 }else{ | 106 }else{ |
107 log.error("No QueryString defined for "+queryID); | 107 log.error("No QueryString defined for "+queryID); |
108 throw new QueryException("Cannot get the Querystring"); | 108 throw new QueryException("Cannot get the Querystring"); |
109 } | 109 } |
110 | 110 |
111 } catch (QueryContainerException e) { | 111 } catch (QueryContainerException e) { |
112 log.error(e,e); | 112 log.error(e,e); |
113 throw new QueryException("Cannot get the Querystring",e); | 113 throw new QueryException("Cannot get the Querystring",e); |
114 } | 114 } |
115 | 115 |