Mercurial > dive4elements > gnv-client
annotate geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/DefaultQueryExceutor.java @ 1123:f76541120bcb
Raster elements returned from ArcSDE are put into an UncacheableSDEResultSet container that is NOT cached.
geo-backend/trunk@1154 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 04 Jun 2010 08:19:38 +0000 |
parents | d387a97807a3 |
children | ebeb56428409 |
rev | line source |
---|---|
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.gnv.geobackend.base.query; |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
2 |
886
8b442223741c
Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
885
diff
changeset
|
3 import de.intevation.gnv.geobackend.base.Result; |
8b442223741c
Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
885
diff
changeset
|
4 |
8b442223741c
Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
885
diff
changeset
|
5 import de.intevation.gnv.geobackend.base.connectionpool.ConnectionPool; |
8b442223741c
Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
885
diff
changeset
|
6 import de.intevation.gnv.geobackend.base.connectionpool.ConnectionPoolFactory; |
8b442223741c
Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
885
diff
changeset
|
7 |
8b442223741c
Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
885
diff
changeset
|
8 import de.intevation.gnv.geobackend.base.connectionpool.exception.ConnectionException; |
8b442223741c
Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
885
diff
changeset
|
9 |
8b442223741c
Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
885
diff
changeset
|
10 import de.intevation.gnv.geobackend.base.query.container.QueryContainerFactory; |
8b442223741c
Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
885
diff
changeset
|
11 |
8b442223741c
Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
885
diff
changeset
|
12 import de.intevation.gnv.geobackend.base.query.container.exception.QueryContainerException; |
8b442223741c
Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
885
diff
changeset
|
13 |
8b442223741c
Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
885
diff
changeset
|
14 import de.intevation.gnv.geobackend.base.query.exception.QueryException; |
8b442223741c
Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
885
diff
changeset
|
15 |
1123
f76541120bcb
Raster elements returned from ArcSDE are put into an UncacheableSDEResultSet container that is NOT cached.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1120
diff
changeset
|
16 import de.intevation.gnv.geobackend.sde.datasources.Uncacheable; |
f76541120bcb
Raster elements returned from ArcSDE are put into an UncacheableSDEResultSet container that is NOT cached.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1120
diff
changeset
|
17 |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
18 import java.sql.Connection; |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
19 import java.sql.ResultSet; |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
20 import java.sql.SQLException; |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
21 import java.sql.Statement; |
886
8b442223741c
Ordered imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
885
diff
changeset
|
22 |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
23 import java.util.Collection; |
1120
d387a97807a3
Added an INFO log statement displaying the execution time of a database query.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
887
diff
changeset
|
24 import java.util.Date; |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
25 |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
26 import org.apache.log4j.Logger; |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
27 |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
28 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
29 * This is an Standard Implementation of the Interface QueryExecutor. |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
30 * It fetchs the Query from the Querycontainer an put the Filtervalues into the Query. |
887
b757def3ff55
Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>'
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
886
diff
changeset
|
31 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
32 * |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
33 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
34 public class DefaultQueryExceutor extends QueryExecutorBase{ |
885
1c3efbd2fc5a
Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
541
diff
changeset
|
35 |
1c3efbd2fc5a
Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
541
diff
changeset
|
36 |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
37 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
38 * the logger, used to log exceptions and additonaly information |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
39 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
40 private static Logger log = Logger.getLogger(DefaultQueryExceutor.class); |
885
1c3efbd2fc5a
Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
541
diff
changeset
|
41 |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
42 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
43 * The ConnectionID identifing the Connection to use executing the Query. |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
44 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
45 private String connectionID = "N/N"; |
885
1c3efbd2fc5a
Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
541
diff
changeset
|
46 |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
47 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
48 * Constructor |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
49 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
50 public DefaultQueryExceutor() { |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
51 super(); |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
52 } |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
53 |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
54 /** |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
55 * @see de.intevation.gnv.geobackend.base.query.QueryExecutor#executeQuery(java.lang.String, java.lang.String[]) |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
56 */ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
57 public Collection<Result> executeQuery(String queryID, String[] filter) throws QueryException { |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
58 Collection<Result> returnValue = null; |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
59 try { |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
60 String queryString = QueryContainerFactory.getInstance().getQueryContainer().getQuery(queryID); |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
61 if (queryString != null){ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
62 if (filter != null && filter.length > 0){ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
63 //Insert the Filtervalues into the QueryString |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
64 queryString = super.setFilterValues(queryString, filter); |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
65 } |
885
1c3efbd2fc5a
Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
541
diff
changeset
|
66 |
541
3cbf11c67fdc
Experimental caching of SQL results via Ehache
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
139
diff
changeset
|
67 if (log.isDebugEnabled()) { |
3cbf11c67fdc
Experimental caching of SQL results via Ehache
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
139
diff
changeset
|
68 log.debug("############ QUERY ##################"); |
3cbf11c67fdc
Experimental caching of SQL results via Ehache
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
139
diff
changeset
|
69 log.debug(queryString); |
3cbf11c67fdc
Experimental caching of SQL results via Ehache
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
139
diff
changeset
|
70 log.debug("#######################################"); |
3cbf11c67fdc
Experimental caching of SQL results via Ehache
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
139
diff
changeset
|
71 } |
3cbf11c67fdc
Experimental caching of SQL results via Ehache
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
139
diff
changeset
|
72 |
3cbf11c67fdc
Experimental caching of SQL results via Ehache
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
139
diff
changeset
|
73 returnValue = cachedResults(queryString); |
3cbf11c67fdc
Experimental caching of SQL results via Ehache
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
139
diff
changeset
|
74 |
3cbf11c67fdc
Experimental caching of SQL results via Ehache
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
139
diff
changeset
|
75 if (returnValue != null) { |
3cbf11c67fdc
Experimental caching of SQL results via Ehache
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
139
diff
changeset
|
76 return returnValue; |
3cbf11c67fdc
Experimental caching of SQL results via Ehache
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
139
diff
changeset
|
77 } |
3cbf11c67fdc
Experimental caching of SQL results via Ehache
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
139
diff
changeset
|
78 |
1123
f76541120bcb
Raster elements returned from ArcSDE are put into an UncacheableSDEResultSet container that is NOT cached.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1120
diff
changeset
|
79 boolean cacheable = true; |
f76541120bcb
Raster elements returned from ArcSDE are put into an UncacheableSDEResultSet container that is NOT cached.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1120
diff
changeset
|
80 Connection connection = null; |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
81 ConnectionPool connectionPool = ConnectionPoolFactory.getInstance().getConnectionPool(); |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
82 try { |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
83 // Submit the Query |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
84 connection = connectionPool.getConnection(this.connectionID); |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
85 if (connection != null){ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
86 Statement stmt = connection.createStatement(); |
1120
d387a97807a3
Added an INFO log statement displaying the execution time of a database query.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
887
diff
changeset
|
87 Date start = new Date(); |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
88 ResultSet rs = stmt.executeQuery(queryString); |
1120
d387a97807a3
Added an INFO log statement displaying the execution time of a database query.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
887
diff
changeset
|
89 Date end = new Date(); |
d387a97807a3
Added an INFO log statement displaying the execution time of a database query.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
887
diff
changeset
|
90 log.info("-> Database query took " + |
d387a97807a3
Added an INFO log statement displaying the execution time of a database query.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
887
diff
changeset
|
91 (end.getTime() - start.getTime()) + " ms."); |
1123
f76541120bcb
Raster elements returned from ArcSDE are put into an UncacheableSDEResultSet container that is NOT cached.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1120
diff
changeset
|
92 |
f76541120bcb
Raster elements returned from ArcSDE are put into an UncacheableSDEResultSet container that is NOT cached.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1120
diff
changeset
|
93 cacheable = rs instanceof Uncacheable ? false : true; |
f76541120bcb
Raster elements returned from ArcSDE are put into an UncacheableSDEResultSet container that is NOT cached.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1120
diff
changeset
|
94 |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
95 returnValue = super.createResultCollection(rs); |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
96 }else{ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
97 log.error("Could not establish Databaseconnection."); |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
98 throw new QueryException("Could not establish Databaseconnection."); |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
99 } |
541
3cbf11c67fdc
Experimental caching of SQL results via Ehache
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
139
diff
changeset
|
100 |
1123
f76541120bcb
Raster elements returned from ArcSDE are put into an UncacheableSDEResultSet container that is NOT cached.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1120
diff
changeset
|
101 if (cacheable) { |
f76541120bcb
Raster elements returned from ArcSDE are put into an UncacheableSDEResultSet container that is NOT cached.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1120
diff
changeset
|
102 log.debug("Elements are cacheable."); |
f76541120bcb
Raster elements returned from ArcSDE are put into an UncacheableSDEResultSet container that is NOT cached.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1120
diff
changeset
|
103 cacheResults(queryString, returnValue); |
f76541120bcb
Raster elements returned from ArcSDE are put into an UncacheableSDEResultSet container that is NOT cached.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1120
diff
changeset
|
104 } |
f76541120bcb
Raster elements returned from ArcSDE are put into an UncacheableSDEResultSet container that is NOT cached.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1120
diff
changeset
|
105 else { |
f76541120bcb
Raster elements returned from ArcSDE are put into an UncacheableSDEResultSet container that is NOT cached.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1120
diff
changeset
|
106 log.debug("Elements are NOT cacheable."); |
f76541120bcb
Raster elements returned from ArcSDE are put into an UncacheableSDEResultSet container that is NOT cached.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1120
diff
changeset
|
107 } |
885
1c3efbd2fc5a
Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
541
diff
changeset
|
108 |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
109 } catch (ConnectionException e) { |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
110 log.error(e,e); |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
111 throw new QueryException("Could not establish Databaseconnection.",e); |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
112 } catch (SQLException e) { |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
113 log.error(e,e); |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
114 throw new QueryException(e); |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
115 }finally{ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
116 if (connection != null){ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
117 try { |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
118 connectionPool.closeConnection(connection); |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
119 } catch (ConnectionException e) { |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
120 log.error("Connection could not be returned to ConnectionPool."); |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
121 log.error(e,e); |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
122 } |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
123 } |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
124 } |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
125 }else{ |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
126 log.error("No QueryString defined for "+queryID); |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
127 throw new QueryException("Cannot get the Querystring"); |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
128 } |
885
1c3efbd2fc5a
Removes trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
541
diff
changeset
|
129 |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
130 } catch (QueryContainerException e) { |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
131 log.error(e,e); |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
132 throw new QueryException("Cannot get the Querystring",e); |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
133 } |
541
3cbf11c67fdc
Experimental caching of SQL results via Ehache
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
139
diff
changeset
|
134 |
132
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
135 return returnValue; |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
136 } |
5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
137 } |