diff geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java @ 382:4af6379ac20b

Changed exception handling if a the value of a column, which is not contained in Result, is requested. Will not throw an exception but return null. geo-backend/trunk@417 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 11 Dec 2009 10:45:18 +0000
parents 05912f0304ac
children da2da7bb1aa1
line wrap: on
line diff
--- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java	Fri Dec 11 10:34:36 2009 +0000
+++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java	Fri Dec 11 10:45:18 2009 +0000
@@ -108,7 +108,9 @@
      * @see de.intevation.gnv.geobackend.base.Result#getString(java.lang.String)
      */
     public String getString(String columnName) {
-        return getString(resultDescriptor.getColumnIndex(columnName));
+        int idx = resultDescriptor.getColumnIndex(columnName);
+
+        return idx > -1 ? getString(idx) : null;
     }
 
     public String getString(int column) {

http://dive4elements.wald.intevation.org