# HG changeset patch # User Sascha L. Teichmann # Date 1271582558 0 # Node ID d674cef2ca0de3793e73737f9dae8cc1ca514c61 # Parent 8a652a451bc609052a6ab402b8ccc83e4253ab2e Using unix line endings only. geo-backend/trunk@939 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 8a652a451bc6 -r d674cef2ca0d geo-backend/ChangeLog --- a/geo-backend/ChangeLog Sat Apr 17 09:28:02 2010 +0000 +++ b/geo-backend/ChangeLog Sun Apr 18 09:22:38 2010 +0000 @@ -1,3 +1,16 @@ +2010-04-16 Sascha L. Teichmann + + * src/main/java/de/intevation/gnv/geobackend/base/connectionpool/exception/ConnectionException.java, + src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEUtils.java, + src/main/java/de/intevation/gnv/geobackend/sde/datasources/ColDefinition.java, + src/main/java/de/intevation/gnv/geobackend/sde/datasources/SDEResultSet.java, + src/main/java/de/intevation/gnv/geobackend/sde/datasources/Row.java, + src/main/java/de/intevation/gnv/geobackend/sde/datasources/ResultSet.java, + src/main/java/de/intevation/gnv/geobackend/sde/datasources/exception/DatasourceException.java, + src/main/java/de/intevation/gnv/geobackend/sde/datasources/exception/TechnicalException.java, + src/main/java/de/intevation/gnv/geobackend/util/DateUtils.java: + Using unix line endings only. + 2010-04-17 Sascha L. Teichmann * src/main/java/de/intevation/gnv/geobackend/base/query/container/QueryContainerFactory.java: diff -r 8a652a451bc6 -r d674cef2ca0d geo-backend/src/main/java/de/intevation/gnv/geobackend/base/connectionpool/exception/ConnectionException.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/connectionpool/exception/ConnectionException.java Sat Apr 17 09:28:02 2010 +0000 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/connectionpool/exception/ConnectionException.java Sun Apr 18 09:22:38 2010 +0000 @@ -1,103 +1,103 @@ -package de.intevation.gnv.geobackend.base.connectionpool.exception; - -import com.esri.sde.sdk.client.SeError; -import com.esri.sde.sdk.client.SeException; - -import de.intevation.gnv.geobackend.sde.datasources.exception.TechnicalException; - -import org.apache.log4j.Logger; - -/** - * The class lConnectionException fulfills the following purposes: - * - * @author blume - * @author Tim Englich - */ -public class ConnectionException extends TechnicalException { - - /** - * The UID of this Class. - */ - private static final long serialVersionUID = 102459262123219617L; - - /** - * Default Logging instance - */ - private static Logger sLogger = Logger.getLogger(ConnectionException.class); - - /** - * Constructs a new exception with null as its detail message. - * The cause is not initialized, and may subsequently be initialized by a - * call to {@link #initCause}. - */ - public ConnectionException() { - } - - /** - * Constructs a new exception with the specified detail message. The - * cause is not initialized, and may subsequently be initialized by - * a call to {@link #initCause}. - * - * @param message the detail message. The detail message is saved for - * later retrieval by the {@link #getMessage()} method. - */ - public ConnectionException(String message) { - super(message); - } - - /** - * Constructor - * @param pCause the Throwable which cause this exception - */ - public ConnectionException(Throwable pCause) { - super(pCause); - } - - /** - * Constructs a new exception with the specified detail message and - * cause.

Note that the detail message associated with - * cause is not automatically incorporated in - * this exception's detail message. - * - * @param message the detail message (which is saved for later retrieval - * by the {@link #getMessage()} method). - * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause()} method). (A null value is - * permitted, and indicates that the cause is nonexistent or - * unknown.) - * @since 1.4 - */ - public ConnectionException(String message, Throwable cause) { - super(message, cause); - } - - /** - * Displays the details of an SeException (if available). - * - */ - public void printError() { - if (getCause() != null && getCause() instanceof SeException) { - SeException exception = (SeException) getCause(); - SeError error = exception.getSeError(); - - sLogger.debug("\n ArcSDE Error Number : " + error.getSdeError()); - sLogger.debug(" Error Description : " + error.getErrDesc()); - - int extError = error.getExtError(); - if (extError != 0) - sLogger.debug(" Extended Error Number : " + extError); - - String desc = error.getSdeErrMsg(); - if (desc != null && desc.length() != 0) - sLogger.debug(" Extended Error Description : " + desc); - - desc = error.getExtErrMsg(); - if (desc != null && desc.length() != 0) - sLogger.debug(" Extended Error Description : " + desc); - - sLogger.debug(exception); - - } - - } -} +package de.intevation.gnv.geobackend.base.connectionpool.exception; + +import com.esri.sde.sdk.client.SeError; +import com.esri.sde.sdk.client.SeException; + +import de.intevation.gnv.geobackend.sde.datasources.exception.TechnicalException; + +import org.apache.log4j.Logger; + +/** + * The class lConnectionException fulfills the following purposes: + * + * @author blume + * @author Tim Englich + */ +public class ConnectionException extends TechnicalException { + + /** + * The UID of this Class. + */ + private static final long serialVersionUID = 102459262123219617L; + + /** + * Default Logging instance + */ + private static Logger sLogger = Logger.getLogger(ConnectionException.class); + + /** + * Constructs a new exception with null as its detail message. + * The cause is not initialized, and may subsequently be initialized by a + * call to {@link #initCause}. + */ + public ConnectionException() { + } + + /** + * Constructs a new exception with the specified detail message. The + * cause is not initialized, and may subsequently be initialized by + * a call to {@link #initCause}. + * + * @param message the detail message. The detail message is saved for + * later retrieval by the {@link #getMessage()} method. + */ + public ConnectionException(String message) { + super(message); + } + + /** + * Constructor + * @param pCause the Throwable which cause this exception + */ + public ConnectionException(Throwable pCause) { + super(pCause); + } + + /** + * Constructs a new exception with the specified detail message and + * cause.

Note that the detail message associated with + * cause is not automatically incorporated in + * this exception's detail message. + * + * @param message the detail message (which is saved for later retrieval + * by the {@link #getMessage()} method). + * @param cause the cause (which is saved for later retrieval by the + * {@link #getCause()} method). (A null value is + * permitted, and indicates that the cause is nonexistent or + * unknown.) + * @since 1.4 + */ + public ConnectionException(String message, Throwable cause) { + super(message, cause); + } + + /** + * Displays the details of an SeException (if available). + * + */ + public void printError() { + if (getCause() != null && getCause() instanceof SeException) { + SeException exception = (SeException) getCause(); + SeError error = exception.getSeError(); + + sLogger.debug("\n ArcSDE Error Number : " + error.getSdeError()); + sLogger.debug(" Error Description : " + error.getErrDesc()); + + int extError = error.getExtError(); + if (extError != 0) + sLogger.debug(" Extended Error Number : " + extError); + + String desc = error.getSdeErrMsg(); + if (desc != null && desc.length() != 0) + sLogger.debug(" Extended Error Description : " + desc); + + desc = error.getExtErrMsg(); + if (desc != null && desc.length() != 0) + sLogger.debug(" Extended Error Description : " + desc); + + sLogger.debug(exception); + + } + + } +} diff -r 8a652a451bc6 -r d674cef2ca0d geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEUtils.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEUtils.java Sat Apr 17 09:28:02 2010 +0000 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEUtils.java Sun Apr 18 09:22:38 2010 +0000 @@ -1,84 +1,84 @@ -package de.intevation.gnv.geobackend.sde.datasources; - -import com.esri.sde.sdk.client.SDEPoint; -import com.esri.sde.sdk.client.SeError; -import com.esri.sde.sdk.client.SeException; - -import com.vividsolutions.jts.geom.Coordinate; -import com.vividsolutions.jts.geom.Geometry; -import com.vividsolutions.jts.geom.LineString; -import com.vividsolutions.jts.geom.Point; -import com.vividsolutions.jts.geom.Polygon; - -import org.apache.log4j.Logger; - -/** - * The class ArcSDEUtils fulfills the following purposes: - * - * @author blume - * @author Tim Englich - */ -public class ArcSDEUtils { - - /** - * Default Logging instance - */ - private static Logger sLogger = Logger.getLogger(ArcSDEUtils.class); - - /** - * Prints an SEEsception into the Logger of this Class - * @param exception - */ - public static void printError(SeException exception) { - - SeError error = exception.getSeError(); - - sLogger.debug("\n ArcSDE Error Number : " + error.getSdeError()); - sLogger.debug(" Error Description : " + error.getErrDesc()); - - int extError = error.getExtError(); - if (extError != 0) - sLogger.debug(" Extended Error Number : " + extError); - - String desc = error.getSdeErrMsg(); - if (desc != null && desc.length() != 0) - sLogger.debug(" Extended Error Description : " + desc); - - desc = error.getExtErrMsg(); - if (desc != null && desc.length() != 0) - sLogger.debug(" Extended Error Description : " + desc); - - sLogger.debug(exception); - - } - - /** - * Generate an SDEPoint-Array from a given Geometry. - * This Method did not put the Holes to the Array. - * @param g The Geometry which should be converted. - * @return an SDEPoint-Array from a given Ggeometry. - */ - public SDEPoint[] createPoints(Geometry g) { - sLogger.debug("createPoints()"); - Coordinate[] coords = null; - if (g instanceof Polygon) { - coords = ((Polygon) g).getCoordinates(); - }else if (g instanceof Point){ - coords = ((Point)g).getCoordinates(); - }else if (g instanceof LineString){ - coords = ((LineString)g).getCoordinates(); - }else{ - coords = g.getCoordinates(); - } - - if (coords != null){ - SDEPoint[] lSDEPoints = new SDEPoint[coords.length]; - for (int i = 0; i < coords.length; i++) { - lSDEPoints[i] = new SDEPoint(coords[i].x, coords[i].y); - } - return lSDEPoints; - }else{ - return null; - } - } -} +package de.intevation.gnv.geobackend.sde.datasources; + +import com.esri.sde.sdk.client.SDEPoint; +import com.esri.sde.sdk.client.SeError; +import com.esri.sde.sdk.client.SeException; + +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.Geometry; +import com.vividsolutions.jts.geom.LineString; +import com.vividsolutions.jts.geom.Point; +import com.vividsolutions.jts.geom.Polygon; + +import org.apache.log4j.Logger; + +/** + * The class ArcSDEUtils fulfills the following purposes: + * + * @author blume + * @author Tim Englich + */ +public class ArcSDEUtils { + + /** + * Default Logging instance + */ + private static Logger sLogger = Logger.getLogger(ArcSDEUtils.class); + + /** + * Prints an SEEsception into the Logger of this Class + * @param exception + */ + public static void printError(SeException exception) { + + SeError error = exception.getSeError(); + + sLogger.debug("\n ArcSDE Error Number : " + error.getSdeError()); + sLogger.debug(" Error Description : " + error.getErrDesc()); + + int extError = error.getExtError(); + if (extError != 0) + sLogger.debug(" Extended Error Number : " + extError); + + String desc = error.getSdeErrMsg(); + if (desc != null && desc.length() != 0) + sLogger.debug(" Extended Error Description : " + desc); + + desc = error.getExtErrMsg(); + if (desc != null && desc.length() != 0) + sLogger.debug(" Extended Error Description : " + desc); + + sLogger.debug(exception); + + } + + /** + * Generate an SDEPoint-Array from a given Geometry. + * This Method did not put the Holes to the Array. + * @param g The Geometry which should be converted. + * @return an SDEPoint-Array from a given Ggeometry. + */ + public SDEPoint[] createPoints(Geometry g) { + sLogger.debug("createPoints()"); + Coordinate[] coords = null; + if (g instanceof Polygon) { + coords = ((Polygon) g).getCoordinates(); + }else if (g instanceof Point){ + coords = ((Point)g).getCoordinates(); + }else if (g instanceof LineString){ + coords = ((LineString)g).getCoordinates(); + }else{ + coords = g.getCoordinates(); + } + + if (coords != null){ + SDEPoint[] lSDEPoints = new SDEPoint[coords.length]; + for (int i = 0; i < coords.length; i++) { + lSDEPoints[i] = new SDEPoint(coords[i].x, coords[i].y); + } + return lSDEPoints; + }else{ + return null; + } + } +} diff -r 8a652a451bc6 -r d674cef2ca0d geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ColDefinition.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ColDefinition.java Sat Apr 17 09:28:02 2010 +0000 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ColDefinition.java Sun Apr 18 09:22:38 2010 +0000 @@ -1,77 +1,77 @@ -package de.intevation.gnv.geobackend.sde.datasources; - -import org.apache.log4j.Logger; - -/** - * The class ColDefinition fulfills the following purposes: - * @author blume - * @author Tim Englich - */ -public class ColDefinition { - - /** - * Default Logging instance - */ - private static Logger sLogger = Logger.getLogger(ColDefinition.class); - - /** - * @deprecated - */ - public static final int SMALLINT = 1; - /** - * @deprecated - */ - public static final int INTEGER = 2; - /** - * @deprecated - */ - public static final int FLOAT = 3; - /** - * @deprecated - */ - public static final int DOUBLE = 4; - public static final int INT16 = 1; - public static final int INT32 = 2; - public static final int FLOAT32 = 3; - public static final int FLOAT64 = 4; - public static final int STRING = 5; - public static final int BLOB = 6; - public static final int DATE = 7; - public static final int SHAPE = 8; - public static final int RASTER = 9; - public static final int XML = 10; - public static final int INT64 = 11; - public static final int UUID = 12; - public static final int CLOB = 13; - public static final int NSTRING = 14; - public static final int NCLOB = 15; - - private String mName; - private int mType; - - /** - * Constructor - * @param pName the Name of an Column. - * @param pType the Type of an Column. - */ - public ColDefinition(String pName, int pType) { - mName = pName; - mType = pType; - } - - /** - * Returns the Name of an Column. - * @return the Name of an Column. - */ - public String getName() { - return mName; - } - - /** - * Returns the Type of an Column. - * @return the Type of an Column. - */ - public int getType() { - return mType; - } -} +package de.intevation.gnv.geobackend.sde.datasources; + +import org.apache.log4j.Logger; + +/** + * The class ColDefinition fulfills the following purposes: + * @author blume + * @author Tim Englich + */ +public class ColDefinition { + + /** + * Default Logging instance + */ + private static Logger sLogger = Logger.getLogger(ColDefinition.class); + + /** + * @deprecated + */ + public static final int SMALLINT = 1; + /** + * @deprecated + */ + public static final int INTEGER = 2; + /** + * @deprecated + */ + public static final int FLOAT = 3; + /** + * @deprecated + */ + public static final int DOUBLE = 4; + public static final int INT16 = 1; + public static final int INT32 = 2; + public static final int FLOAT32 = 3; + public static final int FLOAT64 = 4; + public static final int STRING = 5; + public static final int BLOB = 6; + public static final int DATE = 7; + public static final int SHAPE = 8; + public static final int RASTER = 9; + public static final int XML = 10; + public static final int INT64 = 11; + public static final int UUID = 12; + public static final int CLOB = 13; + public static final int NSTRING = 14; + public static final int NCLOB = 15; + + private String mName; + private int mType; + + /** + * Constructor + * @param pName the Name of an Column. + * @param pType the Type of an Column. + */ + public ColDefinition(String pName, int pType) { + mName = pName; + mType = pType; + } + + /** + * Returns the Name of an Column. + * @return the Name of an Column. + */ + public String getName() { + return mName; + } + + /** + * Returns the Type of an Column. + * @return the Type of an Column. + */ + public int getType() { + return mType; + } +} diff -r 8a652a451bc6 -r d674cef2ca0d geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ResultSet.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ResultSet.java Sat Apr 17 09:28:02 2010 +0000 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ResultSet.java Sun Apr 18 09:22:38 2010 +0000 @@ -1,47 +1,47 @@ -package de.intevation.gnv.geobackend.sde.datasources; - -import org.apache.log4j.Logger; - -/** - * The class ResultSet fulfills the following purposes: - *

    - *
  1. Providing an abstract object for dealing with result sets.
  2. - *
- * - * @author blume - * @author Tim Englich - */ -public abstract class ResultSet implements java.sql.ResultSet { - - /** - * Default Logging instance - */ - private static Logger sLogger = Logger.getLogger(ResultSet.class); - - /** - * Returns the number of hits. - * @return count of results. - */ - public abstract int getCount(); - - /** - * Returns the number of columns returned through the query. - * @return the number of columns. - */ - public abstract int getNumberOfColumns(); - - /** - * A ResultSet can tell about the concrete definition of each column. - * This method returns an array of ColDefinition-Objects. - * @return the definitions describing the result set. - */ - public abstract ColDefinition[] getColumnDefinitions(); - - /** - * Returns an array of Rows. The rows contain the "content" of the current ResultSet. - * - * @return the results itself. - */ - public abstract Row[] getResults(); - -} +package de.intevation.gnv.geobackend.sde.datasources; + +import org.apache.log4j.Logger; + +/** + * The class ResultSet fulfills the following purposes: + *
    + *
  1. Providing an abstract object for dealing with result sets.
  2. + *
+ * + * @author blume + * @author Tim Englich + */ +public abstract class ResultSet implements java.sql.ResultSet { + + /** + * Default Logging instance + */ + private static Logger sLogger = Logger.getLogger(ResultSet.class); + + /** + * Returns the number of hits. + * @return count of results. + */ + public abstract int getCount(); + + /** + * Returns the number of columns returned through the query. + * @return the number of columns. + */ + public abstract int getNumberOfColumns(); + + /** + * A ResultSet can tell about the concrete definition of each column. + * This method returns an array of ColDefinition-Objects. + * @return the definitions describing the result set. + */ + public abstract ColDefinition[] getColumnDefinitions(); + + /** + * Returns an array of Rows. The rows contain the "content" of the current ResultSet. + * + * @return the results itself. + */ + public abstract Row[] getResults(); + +} diff -r 8a652a451bc6 -r d674cef2ca0d geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/Row.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/Row.java Sat Apr 17 09:28:02 2010 +0000 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/Row.java Sun Apr 18 09:22:38 2010 +0000 @@ -1,286 +1,286 @@ -package de.intevation.gnv.geobackend.sde.datasources; - -import com.esri.sde.sdk.client.SDEPoint; -import com.esri.sde.sdk.client.SeException; -import com.esri.sde.sdk.client.SeShape; - -import de.intevation.gnv.geobackend.sde.datasources.exception.TechnicalException; - -import de.intevation.gnv.geobackend.util.DateUtils; - -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; - -import org.apache.log4j.Logger; - -/** - * A Row represents a set of values. - * In a technical manner (e.g. database manner) a row contains all attributes of a single "hit". - * - * @author blume - * @author Tim Englich - */ -public class Row { - /** - * Default Logging instance - */ - private static Logger sLogger = Logger.getLogger(Row.class); - - /** - * Data container. - */ - private Object[] mObjects; - - /** - * Constructor. - * @param pRowSize the number of attributes contained by this row. - */ - public Row(int pRowSize) { - mObjects = new Object[pRowSize]; - } - - /** - * Constructor. - * @param ArrayStr a line from CSV-File. - */ - public Row (String[] ArrayStr){ - this (ArrayStr.length); - int nLength = ArrayStr.length; - for (int i=0; i < nLength; i++){ - addObject(ArrayStr[i], i); - - } - - } - - /** - * Adds an attribute value to a specific position of this row. - * - * @param pObject the object to be stored. - * @param pPos the postion the value to be saved - */ - public void addObject(Object pObject, int pPos) { - mObjects[pPos] = pObject; - } - - /** - * Returns a Value out of the Row. - * - * @param pPos the position of the value to be returned. - * @return an Object! (not strongly typed) - * @throws TechnicalException - */ - public Object getValue(int pPos) throws TechnicalException { - if (pPos < mObjects.length) { - - Object o = mObjects[pPos]; - if (o instanceof SeShape){ - return this.getPosValue(pPos); - }else{ - return o; - } - } else { - throw new TechnicalException("Cannot access this field position. Size is: " + mObjects.length); - } - } - - /** - * This is a covenient method for getting strongly typed objects out of the row. - * It has to be ensured, that the type of the requested row position has been resolved out of the ColumnDefinition ({@link ResultSet#getColumnDefinitions()}). - * In fact, this method executes a simple cast to the desired type. - * - * @param pPos the position of the object to be resolved. - * @return a strongly typed Date - * @throws TechnicalException - * @see #getValue(int) - */ - public Date getDateValue(int pPos) throws TechnicalException { - Date date = null; - try { - Calendar lCalendar = (Calendar) getValue(pPos); - date = lCalendar.getTime(); - } - catch (ClassCastException e) { - try{ - //SimpleDateFormat formatter = new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss"); - date = DateUtils.getDateFromString ((String)getValue(pPos)); //(Date)formatter.parse((String)getValue(pPos)); - - - } - catch (Exception ex){ - sLogger.error(getValue(pPos) + " " + ex.getMessage(), ex); - throw new TechnicalException("Could not cast this value to the Date Type. Object is of value type: " + getValue(pPos).getClass().getName()); - } - } - - return date; - } - - /** - * This is a covenient method for getting strongly typed objects out of the row. - * It has to be ensured, that the type of the requested row position has been resolved out of the ColumnDefinition ({@link ResultSet#getColumnDefinitions()}). - * In fact, this method executes a simple cast to the desired type. - * - * @param pPos the position of the object to be resolved. - * @return a strongly typed String - * @throws TechnicalException - * @see #getValue(int) - */ - public String getStringValue(int pPos) throws TechnicalException { - try { - Object o = this.getValue(pPos); - String returnValue = null; - if (o instanceof SeShape){ - returnValue = this.getPosValue(pPos); - }else{ - returnValue = (String)o; - } - return returnValue; - } catch (ClassCastException e) { - throw new TechnicalException("Could not cast this value to the String Type. Object is of value type: " + getValue(pPos).getClass().getName()); - } - } - - /** - * This is a covenient method for getting strongly typed objects out of the row. - * It has to be ensured, that the type of the requested row position has been resolved out of the ColumnDefinition ({@link ResultSet#getColumnDefinitions()}). - * In fact, this method executes a simple cast to the desired type. - * - * @param pPos the position of the object to be resolved. - * @throws TechnicalException - * @see #getValue(int) - * * @return a strongly typed int - */ - public int getIntValue(int pPos) throws TechnicalException { - try { - return (Integer) getValue(pPos); - } catch (ClassCastException e) { - throw new TechnicalException("Could not cast this value to the Integer Type. Object is of value type: " + getValue(pPos).getClass().getName()); - } - } - - /** - * This is a covenient method for getting strongly typed objects out of the row. - * It has to be ensured, that the type of the requested row position has been resolved out of the ColumnDefinition ({@link ResultSet#getColumnDefinitions()}). - * In fact, this method executes a simple cast to the desired type. - * - * @param pPos the position of the object to be resolved. - * @throws TechnicalException - * @see #getValue(int) - * * @return a strongly typed Double - */ - public Double getDoubleValue(int pPos) throws TechnicalException { - try { - return (Double) getValue(pPos); - } catch (ClassCastException e) { - try{ - return new Double ((String)getValue(pPos)); - } - catch(Exception ex){ - sLogger.error(getValue(pPos) + " " + ex.getMessage(), ex); - throw new TechnicalException("Could not cast this value to the Double Type. Object is of value type: " + getValue(pPos).getClass().getName()); - } - } - } - - /** - * This is a covenient method for getting strongly typed objects out of the row. - * It has to be ensured, that the type of the requested row position has been resolved out of the ColumnDefinition ({@link ResultSet#getColumnDefinitions()}). - * In fact, this method executes a simple cast to the desired type. - * - * @param pPos the position of the object to be resolved. - * @return a strongly typed Float - * @throws TechnicalException - * @see #getValue(int) - */ - public Float getFloatValue(int pPos) throws TechnicalException { - try { - return (Float) getValue(pPos); - } catch (ClassCastException e) { - throw new TechnicalException("Could not cast this value to the Float Type. Object is of value type: " + getValue(pPos).getClass().getName()); - } - } - /** - * This is a covenient method for getting strongly typed objects out of the row. - * It has to be ensured, that the type of the requested row position has been resolved out of the ColumnDefinition ({@link ResultSet#getColumnDefinitions()}). - * In fact, this method executes a simple cast to the desired type. - * - * @param pPos the position of the object to be resolved. - * @return a strongly typed Float - * @throws TechnicalException - * @see #getValue(int) - */ - public String getPosValue(int pPos)throws TechnicalException{ - StringBuffer returnValue = new StringBuffer(); - synchronized (returnValue) { - try { - SeShape val = (SeShape) this.mObjects[pPos]; - if (val.isPoint()){ - // Cannot use val.asText() because the - // generated WKT is invalid. - ArrayList aList = val.getAllPoints(0,false); - SDEPoint[] mPoint = (SDEPoint[])aList.get(0); - returnValue.append("POINT(") - .append(mPoint[0].getX()) - .append(" ") - .append(mPoint[0].getY()); - if (mPoint[0].is3D()){ - returnValue.append(" ").append(mPoint[0].getZ()); - } - returnValue.append(")"); - }else if (val.isLine() || val.isSimpleLine()){ - // Cannot use val.asText() because the - // generated WKT is invalid. - ArrayList aList = val.getAllPoints(0,false); - SDEPoint[] mPoint = (SDEPoint[])aList.get(0); - boolean isMultiLineString = val.isMultiPart(); - int length = mPoint.length; - int nextOffset = length; - int[] offsets = (int[])aList.get(1); - int offsetPos = 1; - - if(isMultiLineString){ - returnValue.append("MULTILINESTRING(("); - nextOffset = offsets.length-1 >= offsetPos ? offsets[offsetPos++] : length; - }else{ - returnValue.append("LINESTRING("); - } - - for (int i = 0; i< length;i++){ - - if (i == nextOffset){ - returnValue.append("),("); - nextOffset = offsets.length-1 >= offsetPos ? offsets[offsetPos++] : length; - } - - returnValue.append(mPoint[i].getX()) - .append(" ") - .append(mPoint[i].getY()); - if (mPoint[i].is3D()){ - returnValue.append(" ").append(mPoint[i].getZ()); - } - if (i < length-1 && i < nextOffset -1){ - returnValue.append(" , "); - } - } - - if(isMultiLineString){ - returnValue.append("))"); - }else{ - returnValue.append(")"); - } - - } else{ - returnValue.append(val.asText(val.getTextSize())); - } - } catch (SeException e) { - throw new TechnicalException("Could not cast this value to the " + - "Float Type. Object is of value " + - "type: " + - getValue(pPos).getClass().getName()); - } - } - return returnValue.toString(); - } -} +package de.intevation.gnv.geobackend.sde.datasources; + +import com.esri.sde.sdk.client.SDEPoint; +import com.esri.sde.sdk.client.SeException; +import com.esri.sde.sdk.client.SeShape; + +import de.intevation.gnv.geobackend.sde.datasources.exception.TechnicalException; + +import de.intevation.gnv.geobackend.util.DateUtils; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; + +import org.apache.log4j.Logger; + +/** + * A Row represents a set of values. + * In a technical manner (e.g. database manner) a row contains all attributes of a single "hit". + * + * @author blume + * @author Tim Englich + */ +public class Row { + /** + * Default Logging instance + */ + private static Logger sLogger = Logger.getLogger(Row.class); + + /** + * Data container. + */ + private Object[] mObjects; + + /** + * Constructor. + * @param pRowSize the number of attributes contained by this row. + */ + public Row(int pRowSize) { + mObjects = new Object[pRowSize]; + } + + /** + * Constructor. + * @param ArrayStr a line from CSV-File. + */ + public Row (String[] ArrayStr){ + this (ArrayStr.length); + int nLength = ArrayStr.length; + for (int i=0; i < nLength; i++){ + addObject(ArrayStr[i], i); + + } + + } + + /** + * Adds an attribute value to a specific position of this row. + * + * @param pObject the object to be stored. + * @param pPos the postion the value to be saved + */ + public void addObject(Object pObject, int pPos) { + mObjects[pPos] = pObject; + } + + /** + * Returns a Value out of the Row. + * + * @param pPos the position of the value to be returned. + * @return an Object! (not strongly typed) + * @throws TechnicalException + */ + public Object getValue(int pPos) throws TechnicalException { + if (pPos < mObjects.length) { + + Object o = mObjects[pPos]; + if (o instanceof SeShape){ + return this.getPosValue(pPos); + }else{ + return o; + } + } else { + throw new TechnicalException("Cannot access this field position. Size is: " + mObjects.length); + } + } + + /** + * This is a covenient method for getting strongly typed objects out of the row. + * It has to be ensured, that the type of the requested row position has been resolved out of the ColumnDefinition ({@link ResultSet#getColumnDefinitions()}). + * In fact, this method executes a simple cast to the desired type. + * + * @param pPos the position of the object to be resolved. + * @return a strongly typed Date + * @throws TechnicalException + * @see #getValue(int) + */ + public Date getDateValue(int pPos) throws TechnicalException { + Date date = null; + try { + Calendar lCalendar = (Calendar) getValue(pPos); + date = lCalendar.getTime(); + } + catch (ClassCastException e) { + try{ + //SimpleDateFormat formatter = new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss"); + date = DateUtils.getDateFromString ((String)getValue(pPos)); //(Date)formatter.parse((String)getValue(pPos)); + + + } + catch (Exception ex){ + sLogger.error(getValue(pPos) + " " + ex.getMessage(), ex); + throw new TechnicalException("Could not cast this value to the Date Type. Object is of value type: " + getValue(pPos).getClass().getName()); + } + } + + return date; + } + + /** + * This is a covenient method for getting strongly typed objects out of the row. + * It has to be ensured, that the type of the requested row position has been resolved out of the ColumnDefinition ({@link ResultSet#getColumnDefinitions()}). + * In fact, this method executes a simple cast to the desired type. + * + * @param pPos the position of the object to be resolved. + * @return a strongly typed String + * @throws TechnicalException + * @see #getValue(int) + */ + public String getStringValue(int pPos) throws TechnicalException { + try { + Object o = this.getValue(pPos); + String returnValue = null; + if (o instanceof SeShape){ + returnValue = this.getPosValue(pPos); + }else{ + returnValue = (String)o; + } + return returnValue; + } catch (ClassCastException e) { + throw new TechnicalException("Could not cast this value to the String Type. Object is of value type: " + getValue(pPos).getClass().getName()); + } + } + + /** + * This is a covenient method for getting strongly typed objects out of the row. + * It has to be ensured, that the type of the requested row position has been resolved out of the ColumnDefinition ({@link ResultSet#getColumnDefinitions()}). + * In fact, this method executes a simple cast to the desired type. + * + * @param pPos the position of the object to be resolved. + * @throws TechnicalException + * @see #getValue(int) + * * @return a strongly typed int + */ + public int getIntValue(int pPos) throws TechnicalException { + try { + return (Integer) getValue(pPos); + } catch (ClassCastException e) { + throw new TechnicalException("Could not cast this value to the Integer Type. Object is of value type: " + getValue(pPos).getClass().getName()); + } + } + + /** + * This is a covenient method for getting strongly typed objects out of the row. + * It has to be ensured, that the type of the requested row position has been resolved out of the ColumnDefinition ({@link ResultSet#getColumnDefinitions()}). + * In fact, this method executes a simple cast to the desired type. + * + * @param pPos the position of the object to be resolved. + * @throws TechnicalException + * @see #getValue(int) + * * @return a strongly typed Double + */ + public Double getDoubleValue(int pPos) throws TechnicalException { + try { + return (Double) getValue(pPos); + } catch (ClassCastException e) { + try{ + return new Double ((String)getValue(pPos)); + } + catch(Exception ex){ + sLogger.error(getValue(pPos) + " " + ex.getMessage(), ex); + throw new TechnicalException("Could not cast this value to the Double Type. Object is of value type: " + getValue(pPos).getClass().getName()); + } + } + } + + /** + * This is a covenient method for getting strongly typed objects out of the row. + * It has to be ensured, that the type of the requested row position has been resolved out of the ColumnDefinition ({@link ResultSet#getColumnDefinitions()}). + * In fact, this method executes a simple cast to the desired type. + * + * @param pPos the position of the object to be resolved. + * @return a strongly typed Float + * @throws TechnicalException + * @see #getValue(int) + */ + public Float getFloatValue(int pPos) throws TechnicalException { + try { + return (Float) getValue(pPos); + } catch (ClassCastException e) { + throw new TechnicalException("Could not cast this value to the Float Type. Object is of value type: " + getValue(pPos).getClass().getName()); + } + } + /** + * This is a covenient method for getting strongly typed objects out of the row. + * It has to be ensured, that the type of the requested row position has been resolved out of the ColumnDefinition ({@link ResultSet#getColumnDefinitions()}). + * In fact, this method executes a simple cast to the desired type. + * + * @param pPos the position of the object to be resolved. + * @return a strongly typed Float + * @throws TechnicalException + * @see #getValue(int) + */ + public String getPosValue(int pPos)throws TechnicalException{ + StringBuffer returnValue = new StringBuffer(); + synchronized (returnValue) { + try { + SeShape val = (SeShape) this.mObjects[pPos]; + if (val.isPoint()){ + // Cannot use val.asText() because the + // generated WKT is invalid. + ArrayList aList = val.getAllPoints(0,false); + SDEPoint[] mPoint = (SDEPoint[])aList.get(0); + returnValue.append("POINT(") + .append(mPoint[0].getX()) + .append(" ") + .append(mPoint[0].getY()); + if (mPoint[0].is3D()){ + returnValue.append(" ").append(mPoint[0].getZ()); + } + returnValue.append(")"); + }else if (val.isLine() || val.isSimpleLine()){ + // Cannot use val.asText() because the + // generated WKT is invalid. + ArrayList aList = val.getAllPoints(0,false); + SDEPoint[] mPoint = (SDEPoint[])aList.get(0); + boolean isMultiLineString = val.isMultiPart(); + int length = mPoint.length; + int nextOffset = length; + int[] offsets = (int[])aList.get(1); + int offsetPos = 1; + + if(isMultiLineString){ + returnValue.append("MULTILINESTRING(("); + nextOffset = offsets.length-1 >= offsetPos ? offsets[offsetPos++] : length; + }else{ + returnValue.append("LINESTRING("); + } + + for (int i = 0; i< length;i++){ + + if (i == nextOffset){ + returnValue.append("),("); + nextOffset = offsets.length-1 >= offsetPos ? offsets[offsetPos++] : length; + } + + returnValue.append(mPoint[i].getX()) + .append(" ") + .append(mPoint[i].getY()); + if (mPoint[i].is3D()){ + returnValue.append(" ").append(mPoint[i].getZ()); + } + if (i < length-1 && i < nextOffset -1){ + returnValue.append(" , "); + } + } + + if(isMultiLineString){ + returnValue.append("))"); + }else{ + returnValue.append(")"); + } + + } else{ + returnValue.append(val.asText(val.getTextSize())); + } + } catch (SeException e) { + throw new TechnicalException("Could not cast this value to the " + + "Float Type. Object is of value " + + "type: " + + getValue(pPos).getClass().getName()); + } + } + return returnValue.toString(); + } +} diff -r 8a652a451bc6 -r d674cef2ca0d geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/SDEResultSet.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/SDEResultSet.java Sat Apr 17 09:28:02 2010 +0000 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/SDEResultSet.java Sun Apr 18 09:22:38 2010 +0000 @@ -1,1508 +1,1508 @@ -package de.intevation.gnv.geobackend.sde.datasources; - -import de.intevation.gnv.geobackend.sde.datasources.exception.TechnicalException; - -import java.io.InputStream; -import java.io.Reader; - -import java.math.BigDecimal; - -import java.net.URL; - -import java.sql.Array; -import java.sql.Blob; -import java.sql.Clob; -import java.sql.Date; -import java.sql.NClob; -import java.sql.Ref; -import java.sql.ResultSetMetaData; -import java.sql.RowId; -import java.sql.SQLException; -import java.sql.SQLWarning; -import java.sql.SQLXML; -import java.sql.Statement; -import java.sql.Time; -import java.sql.Timestamp; - -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import org.apache.log4j.Logger; - -/** - * SDEResultSet is an Implementation of the Interface @see java.sql.resultSet - * It is an Wrapper between the resultsets whcih are produced using the ArcSDE - * and the Java-Interface for the Representation of ResultSets. - * @author blume - * @author Tim Englich - */ -public class SDEResultSet extends ResultSet { - - /** - * Default Logging instance - */ - private static Logger log = Logger.getLogger(SDEResultSet.class); - - private List mRows = Collections.synchronizedList(new ArrayList()); - private List mCols = Collections.synchronizedList(new ArrayList()); - - private Row currentRow = null; - private int cursor = 0; - - /** - * Constructor - */ - public SDEResultSet() { - } - - /** - * @see de.intevation.gnv.geobackend.sde.datasources.ResultSet#getCount() - */ - public int getCount() { - return mRows.size(); - } - - /** - * @see de.intevation.gnv.geobackend.sde.datasources.ResultSet#getNumberOfColumns() - */ - public int getNumberOfColumns() { - return mCols.size(); - } - - /** - * @see de.intevation.gnv.geobackend.sde.datasources.ResultSet#getColumnDefinitions() - */ - public ColDefinition[] getColumnDefinitions() { - ColDefinition[] lColDefinitions = new ColDefinition[mCols.size()]; - return mCols.toArray(lColDefinitions); - } - - /** - * @see de.intevation.gnv.geobackend.sde.datasources.ResultSet#getResults() - */ - public Row[] getResults() { - Row[] lRows = new Row[mRows.size()]; - return mRows.toArray(lRows); - } - - /** - * Add an Row to the Resultset - * @param pRow The Row that should be added. - */ - public void addRow(Row pRow) { - mRows.add(pRow); - } - - /** - * Adds a Column to the Resultset. - * @param pColDefinition The Definition of the Column - */ - public void addCol(ColDefinition pColDefinition) { - mCols.add(pColDefinition); - } - - /** - * @see java.sql.ResultSet#absolute(int) - */ - public boolean absolute(int row) throws SQLException { - - return false; - } - - /** - * @see java.sql.ResultSet#afterLast() - */ - public void afterLast() throws SQLException { - } - - /** - * @see java.sql.ResultSet#beforeFirst() - */ - public void beforeFirst() throws SQLException { - } - - /** - * @see java.sql.ResultSet#cancelRowUpdates() - */ - public void cancelRowUpdates() throws SQLException { - } - - /** - * @see java.sql.ResultSet#clearWarnings() - */ - public void clearWarnings() throws SQLException { - } - - /** - * @see java.sql.ResultSet#close() - */ - public void close() throws SQLException { - } - - /** - * @see java.sql.ResultSet#deleteRow() - */ - public void deleteRow() throws SQLException { - } - - /** - * @see java.sql.ResultSet#findColumn(java.lang.String) - */ - public int findColumn(String columnName) throws SQLException { - - return 0; - } - - /** - * @see java.sql.ResultSet#first() - */ - public boolean first() throws SQLException { - - return false; - } - - /** - * @see java.sql.ResultSet#getArray(int) - */ - public Array getArray(int i) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getArray(java.lang.String) - */ - public Array getArray(String colName) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getAsciiStream(int) - */ - public InputStream getAsciiStream(int columnIndex) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getAsciiStream(java.lang.String) - */ - public InputStream getAsciiStream(String columnName) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getBigDecimal(int) - */ - public BigDecimal getBigDecimal(int columnIndex) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getBigDecimal(java.lang.String) - */ - public BigDecimal getBigDecimal(String columnName) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getBigDecimal(int, int) - */ - public BigDecimal getBigDecimal(int columnIndex, int scale) - throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getBigDecimal(java.lang.String, int) - */ - public BigDecimal getBigDecimal(String columnName, int scale) - throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getBinaryStream(int) - */ - public InputStream getBinaryStream(int columnIndex) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getBinaryStream(java.lang.String) - */ - public InputStream getBinaryStream(String columnName) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getBlob(int) - */ - public Blob getBlob(int i) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getBlob(java.lang.String) - */ - public Blob getBlob(String colName) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getBoolean(int) - */ - public boolean getBoolean(int columnIndex) throws SQLException { - - return false; - } - - /** - * @see java.sql.ResultSet#getBoolean(java.lang.String) - */ - public boolean getBoolean(String columnName) throws SQLException { - - return false; - } - - /** - * @see java.sql.ResultSet#getByte(int) - */ - public byte getByte(int columnIndex) throws SQLException { - - return 0; - } - - /** - * @see java.sql.ResultSet#getByte(java.lang.String) - */ - public byte getByte(String columnName) throws SQLException { - - return 0; - } - - /** - * @see java.sql.ResultSet#getBytes(int) - */ - public byte[] getBytes(int columnIndex) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getBytes(java.lang.String) - */ - public byte[] getBytes(String columnName) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getCharacterStream(int) - */ - public Reader getCharacterStream(int columnIndex) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getCharacterStream(java.lang.String) - */ - public Reader getCharacterStream(String columnName) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getClob(int) - */ - public Clob getClob(int i) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getClob(java.lang.String) - */ - public Clob getClob(String colName) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getConcurrency() - */ - public int getConcurrency() throws SQLException { - - return 0; - } - - /** - * @see java.sql.ResultSet#getCursorName() - */ - public String getCursorName() throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getDate(int) - */ - public Date getDate(int columnIndex) throws SQLException { - try { - return new java.sql.Date(this.currentRow.getDateValue(columnIndex-1).getTime()); - } catch (TechnicalException e) { - log.error(e,e); - throw new SQLException(e.getMessage()); - } - } - - /** - * @see java.sql.ResultSet#getDate(java.lang.String) - */ - public Date getDate(String columnName) throws SQLException { - int columnIndex = this.getColumnIndex(columnName); - return this.getDate(columnIndex); - } - - /** - * @see java.sql.ResultSet#getDate(int, java.util.Calendar) - */ - public Date getDate(int columnIndex, Calendar cal) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getDate(java.lang.String, java.util.Calendar) - */ - public Date getDate(String columnName, Calendar cal) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getDouble(int) - */ - public double getDouble(int columnIndex) throws SQLException { - try { - return this.currentRow.getDoubleValue(columnIndex-1); - } catch (TechnicalException e) { - log.error(e,e); - throw new SQLException(e.getMessage()); - } - } - - /** - * @see java.sql.ResultSet#getDouble(java.lang.String) - */ - public double getDouble(String columnName) throws SQLException { - int columnIndex = this.getColumnIndex(columnName); - return this.getDouble(columnIndex); - } - - /** - * @see java.sql.ResultSet#getFetchDirection() - */ - public int getFetchDirection() throws SQLException { - - return 0; - } - - /** - * @see java.sql.ResultSet#getFetchSize() - */ - public int getFetchSize() throws SQLException { - - return 0; - } - - /** - * @see java.sql.ResultSet#getFloat(int) - */ - public float getFloat(int columnIndex) throws SQLException { - try { - return this.currentRow.getFloatValue(columnIndex-1); - } catch (TechnicalException e) { - log.error(e,e); - throw new SQLException(e.getMessage()); - } - } - - /** - * @see java.sql.ResultSet#getFloat(java.lang.String) - */ - public float getFloat(String columnName) throws SQLException { - int columnIndex = this.getColumnIndex(columnName); - return this.getFloat(columnIndex); - } - - /** - * @see java.sql.ResultSet#getInt(int) - */ - public int getInt(int columnIndex) throws SQLException { - - try { - return this.currentRow.getIntValue(columnIndex-1); - } catch (TechnicalException e) { - log.error(e,e); - throw new SQLException(e.getMessage()); - } - } - - /** - * @see java.sql.ResultSet#getInt(java.lang.String) - */ - public int getInt(String columnName) throws SQLException { - int columnIndex = this.getColumnIndex(columnName); - return this.getInt(columnIndex); - } - - /** - * @see java.sql.ResultSet#getLong(int) - */ - public long getLong(int columnIndex) throws SQLException { - - return 0; - } - - /** - * @see java.sql.ResultSet#getLong(java.lang.String) - */ - public long getLong(String columnName) throws SQLException { - - return 0; - } - - /** - * @see java.sql.ResultSet#getMetaData() - */ - public ResultSetMetaData getMetaData() throws SQLException { - log.debug("SDEREsultSet.getMetaData"); - return new ArcSDEResultSetMetaData(this.mCols); - } - - /** - * @see java.sql.ResultSet#getObject(int) - */ - public Object getObject(int columnIndex) throws SQLException { - try { - return this.currentRow.getValue(columnIndex-1); - } catch (TechnicalException e) { - log.error(e,e); - throw new SQLException(e.getMessage()); - } - } - - /** - * @see java.sql.ResultSet#getObject(java.lang.String) - */ - public Object getObject(String columnName) throws SQLException { - int columnIndex = this.getColumnIndex(columnName); - return this.getObject(columnIndex); - } - - /** - * @see java.sql.ResultSet#getObject(int, java.util.Map) - */ - public Object getObject(int i, Map> map) - throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getObject(java.lang.String, java.util.Map) - */ - public Object getObject(String colName, Map> map) - throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getRef(int) - */ - public Ref getRef(int i) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getRef(java.lang.String) - */ - public Ref getRef(String colName) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getRow() - */ - public int getRow() throws SQLException { - - return 0; - } - - /** - * @see java.sql.ResultSet#getShort(int) - */ - public short getShort(int columnIndex) throws SQLException { - - return 0; - } - - /** - * @see java.sql.ResultSet#getShort(java.lang.String) - */ - public short getShort(String columnName) throws SQLException { - - return 0; - } - - /** - * @see java.sql.ResultSet#getStatement() - */ - public Statement getStatement() throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getString(int) - */ - public String getString(int columnIndex) throws SQLException { - - try { - return this.currentRow.getStringValue(columnIndex-1); - } catch (TechnicalException e) { - log.error(e,e); - throw new SQLException(e.getMessage()); - } - } - - /** - * @see java.sql.ResultSet#getString(java.lang.String) - */ - public String getString(String columnName) throws SQLException { - int columnIndex = this.getColumnIndex(columnName); - return this.getString(columnIndex); - } - - /** - * @see java.sql.ResultSet#getTime(int) - */ - public Time getTime(int columnIndex) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getTime(java.lang.String) - */ - public Time getTime(String columnName) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getTime(int, java.util.Calendar) - */ - public Time getTime(int columnIndex, Calendar cal) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getTime(java.lang.String, java.util.Calendar) - */ - public Time getTime(String columnName, Calendar cal) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getTimestamp(int) - */ - public Timestamp getTimestamp(int columnIndex) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getTimestamp(java.lang.String) - */ - public Timestamp getTimestamp(String columnName) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getTimestamp(int, java.util.Calendar) - */ - public Timestamp getTimestamp(int columnIndex, Calendar cal) - throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getTimestamp(java.lang.String, - * java.util.Calendar) - */ - public Timestamp getTimestamp(String columnName, Calendar cal) - throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getType() - */ - public int getType() throws SQLException { - - return 0; - } - - /** - * @see java.sql.ResultSet#getURL(int) - */ - public URL getURL(int columnIndex) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getURL(java.lang.String) - */ - public URL getURL(String columnName) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getUnicodeStream(int) - */ - public InputStream getUnicodeStream(int columnIndex) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getUnicodeStream(java.lang.String) - */ - public InputStream getUnicodeStream(String columnName) throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#getWarnings() - */ - public SQLWarning getWarnings() throws SQLException { - - return null; - } - - /** - * @see java.sql.ResultSet#insertRow() - */ - public void insertRow() throws SQLException { - } - - /** - * @see java.sql.ResultSet#isAfterLast() - */ - public boolean isAfterLast() throws SQLException { - - return false; - } - - /** - * @see java.sql.ResultSet#isBeforeFirst() - */ - public boolean isBeforeFirst() throws SQLException { - - return false; - } - - /** - * @see java.sql.ResultSet#isFirst() - */ - public boolean isFirst() throws SQLException { - - return false; - } - - /** - * @see java.sql.ResultSet#isLast() - */ - public boolean isLast() throws SQLException { - - return false; - } - - /** - * @see java.sql.ResultSet#last() - */ - public boolean last() throws SQLException { - - return false; - } - - /** - * @see java.sql.ResultSet#moveToCurrentRow() - */ - public void moveToCurrentRow() throws SQLException { - } - - /** - * @see java.sql.ResultSet#moveToInsertRow() - */ - public void moveToInsertRow() throws SQLException { - } - - /** - * @see java.sql.ResultSet#next() - */ - public boolean next() throws SQLException { - - boolean next = this.mRows.size() > this.cursor; - if (next){ - //log.debug("Zeile "+(cursor+1)+" von "+this.mRows.size()+" wird angesteuert."); - this.currentRow = this.mRows.get(this.cursor); - this.cursor++; - }else{ - this.currentRow = null; - } - return next; - } - - /** - * @see java.sql.ResultSet#previous() - */ - public boolean previous() throws SQLException { - - return false; - } - - /** - * @see java.sql.ResultSet#refreshRow() - */ - public void refreshRow() throws SQLException { - } - - /** - * @see java.sql.ResultSet#relative(int) - */ - public boolean relative(int rows) throws SQLException { - - return false; - } - - /** - * @see java.sql.ResultSet#rowDeleted() - */ - public boolean rowDeleted() throws SQLException { - - return false; - } - - /** - * @see java.sql.ResultSet#rowInserted() - */ - public boolean rowInserted() throws SQLException { - - return false; - } - - /** - * @see java.sql.ResultSet#rowUpdated() - */ - public boolean rowUpdated() throws SQLException { - - return false; - } - - /** - * @see java.sql.ResultSet#setFetchDirection(int) - */ - public void setFetchDirection(int direction) throws SQLException { - } - - /** - * @see java.sql.ResultSet#setFetchSize(int) - */ - public void setFetchSize(int rows) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateArray(int, java.sql.Array) - */ - public void updateArray(int columnIndex, Array x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateArray(java.lang.String, java.sql.Array) - */ - public void updateArray(String columnName, Array x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateAsciiStream(int, java.io.InputStream, int) - */ - public void updateAsciiStream(int columnIndex, InputStream x, int length) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateAsciiStream(java.lang.String, - * java.io.InputStream, int) - */ - public void updateAsciiStream(String columnName, InputStream x, int length) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateBigDecimal(int, java.math.BigDecimal) - */ - public void updateBigDecimal(int columnIndex, BigDecimal x) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateBigDecimal(java.lang.String, - * java.math.BigDecimal) - */ - public void updateBigDecimal(String columnName, BigDecimal x) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateBinaryStream(int, java.io.InputStream, int) - */ - public void updateBinaryStream(int columnIndex, InputStream x, int length) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateBinaryStream(java.lang.String, - * java.io.InputStream, int) - */ - public void updateBinaryStream(String columnName, InputStream x, int length) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateBlob(int, java.sql.Blob) - */ - public void updateBlob(int columnIndex, Blob x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateBlob(java.lang.String, java.sql.Blob) - */ - public void updateBlob(String columnName, Blob x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateBoolean(int, boolean) - */ - public void updateBoolean(int columnIndex, boolean x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateBoolean(java.lang.String, boolean) - */ - public void updateBoolean(String columnName, boolean x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateByte(int, byte) - */ - public void updateByte(int columnIndex, byte x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateByte(java.lang.String, byte) - */ - public void updateByte(String columnName, byte x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateBytes(int, byte[]) - */ - public void updateBytes(int columnIndex, byte[] x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateBytes(java.lang.String, byte[]) - */ - public void updateBytes(String columnName, byte[] x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateCharacterStream(int, java.io.Reader, int) - */ - public void updateCharacterStream(int columnIndex, Reader x, int length) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateCharacterStream(java.lang.String, - * java.io.Reader, int) - */ - public void updateCharacterStream(String columnName, Reader reader, - int length) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateClob(int, java.sql.Clob) - */ - public void updateClob(int columnIndex, Clob x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateClob(java.lang.String, java.sql.Clob) - */ - public void updateClob(String columnName, Clob x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateDate(int, java.sql.Date) - */ - public void updateDate(int columnIndex, Date x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateDate(java.lang.String, java.sql.Date) - */ - public void updateDate(String columnName, Date x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateDouble(int, double) - */ - public void updateDouble(int columnIndex, double x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateDouble(java.lang.String, double) - */ - public void updateDouble(String columnName, double x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateFloat(int, float) - */ - public void updateFloat(int columnIndex, float x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateFloat(java.lang.String, float) - */ - public void updateFloat(String columnName, float x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateInt(int, int) - */ - public void updateInt(int columnIndex, int x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateInt(java.lang.String, int) - */ - public void updateInt(String columnName, int x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateLong(int, long) - */ - public void updateLong(int columnIndex, long x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateLong(java.lang.String, long) - */ - public void updateLong(String columnName, long x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateNull(int) - */ - public void updateNull(int columnIndex) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateNull(java.lang.String) - */ - public void updateNull(String columnName) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateObject(int, java.lang.Object) - */ - public void updateObject(int columnIndex, Object x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateObject(java.lang.String, java.lang.Object) - */ - public void updateObject(String columnName, Object x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateObject(int, java.lang.Object, int) - */ - public void updateObject(int columnIndex, Object x, int scale) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateObject(java.lang.String, java.lang.Object, - * int) - */ - public void updateObject(String columnName, Object x, int scale) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateRef(int, java.sql.Ref) - */ - public void updateRef(int columnIndex, Ref x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateRef(java.lang.String, java.sql.Ref) - */ - public void updateRef(String columnName, Ref x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateRow() - */ - public void updateRow() throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateShort(int, short) - */ - public void updateShort(int columnIndex, short x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateShort(java.lang.String, short) - */ - public void updateShort(String columnName, short x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateString(int, java.lang.String) - */ - public void updateString(int columnIndex, String x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateString(java.lang.String, java.lang.String) - */ - public void updateString(String columnName, String x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateTime(int, java.sql.Time) - */ - public void updateTime(int columnIndex, Time x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateTime(java.lang.String, java.sql.Time) - */ - public void updateTime(String columnName, Time x) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateTimestamp(int, java.sql.Timestamp) - */ - public void updateTimestamp(int columnIndex, Timestamp x) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateTimestamp(java.lang.String, - * java.sql.Timestamp) - */ - public void updateTimestamp(String columnName, Timestamp x) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#wasNull() - */ - public boolean wasNull() throws SQLException { - - return false; - } - - /** - * TODO: DOCUMENT ME - * @param columnName - * @return - * @throws SQLException - */ - private int getColumnIndex(String columnName) throws SQLException{ - for (int i = 0 ; i < this.mCols.size();i++){ - if(this.mCols.get(i).getName().equalsIgnoreCase(columnName)){ - return i +1; // PLUS 1 da SQL-Cursor 1 basiert sind - } - } - throw new SQLException("Column "+columnName+" does not exist in ResulSet"); - } - - /** - * @see java.sql.ResultSet#getHoldability() - */ - public int getHoldability() throws SQLException { - return 0; - } - - /** - * @see java.sql.ResultSet#getNCharacterStream(int) - */ - public Reader getNCharacterStream(int arg0) throws SQLException { - return null; - } - - /** - * @see java.sql.ResultSet#getNCharacterStream(java.lang.String) - */ - public Reader getNCharacterStream(String arg0) throws SQLException { - return null; - } - - /** - * @see java.sql.ResultSet#getNClob(int) - */ - public NClob getNClob(int arg0) throws SQLException { - return null; - } - - /** - * @see java.sql.ResultSet#getNClob(java.lang.String) - */ - public NClob getNClob(String arg0) throws SQLException { - return null; - } - - /** - * @see java.sql.ResultSet#getNString(int) - */ - public String getNString(int arg0) throws SQLException { - return null; - } - - /** - * @see java.sql.ResultSet#getNString(java.lang.String) - */ - public String getNString(String arg0) throws SQLException { - return null; - } - - /** - * @see java.sql.ResultSet#getRowId(int) - */ - public RowId getRowId(int arg0) throws SQLException { - return null; - } - - /** - * @see java.sql.ResultSet#getRowId(java.lang.String) - */ - public RowId getRowId(String arg0) throws SQLException { - return null; - } - - /** - * @see java.sql.ResultSet#getSQLXML(int) - */ - public SQLXML getSQLXML(int arg0) throws SQLException { - return null; - } - - /** - * @see java.sql.ResultSet#getSQLXML(java.lang.String) - */ - public SQLXML getSQLXML(String arg0) throws SQLException { - return null; - } - - /** - * @see java.sql.ResultSet#isClosed() - */ - public boolean isClosed() throws SQLException { - return false; - } - - /** - * @see java.sql.ResultSet#updateAsciiStream(int, java.io.InputStream) - */ - public void updateAsciiStream(int arg0, InputStream arg1) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateAsciiStream(java.lang.String, java.io.InputStream) - */ - public void updateAsciiStream(String arg0, InputStream arg1) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateAsciiStream(int, java.io.InputStream, long) - */ - public void updateAsciiStream(int arg0, InputStream arg1, long arg2) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateAsciiStream(java.lang.String, java.io.InputStream, long) - */ - public void updateAsciiStream(String arg0, InputStream arg1, long arg2) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateBinaryStream(int, java.io.InputStream) - */ - public void updateBinaryStream(int arg0, InputStream arg1) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateBinaryStream(java.lang.String, java.io.InputStream) - */ - public void updateBinaryStream(String arg0, InputStream arg1) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateBinaryStream(int, java.io.InputStream, long) - */ - public void updateBinaryStream(int arg0, InputStream arg1, long arg2) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateBinaryStream(java.lang.String, java.io.InputStream, long) - */ - public void updateBinaryStream(String arg0, InputStream arg1, long arg2) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateBlob(int, java.io.InputStream) - */ - public void updateBlob(int arg0, InputStream arg1) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateBlob(java.lang.String, java.io.InputStream) - */ - public void updateBlob(String arg0, InputStream arg1) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateBlob(int, java.io.InputStream, long) - */ - public void updateBlob(int arg0, InputStream arg1, long arg2) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateBlob(java.lang.String, java.io.InputStream, long) - */ - public void updateBlob(String arg0, InputStream arg1, long arg2) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateCharacterStream(int, java.io.Reader) - */ - public void updateCharacterStream(int arg0, Reader arg1) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateCharacterStream(java.lang.String, java.io.Reader) - */ - public void updateCharacterStream(String arg0, Reader arg1) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateCharacterStream(int, java.io.Reader, long) - */ - public void updateCharacterStream(int arg0, Reader arg1, long arg2) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateCharacterStream(java.lang.String, java.io.Reader, long) - */ - public void updateCharacterStream(String arg0, Reader arg1, long arg2) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateClob(int, java.io.Reader) - */ - public void updateClob(int arg0, Reader arg1) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateClob(java.lang.String, java.io.Reader) - */ - public void updateClob(String arg0, Reader arg1) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateClob(int, java.io.Reader, long) - */ - public void updateClob(int arg0, Reader arg1, long arg2) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateClob(java.lang.String, java.io.Reader, long) - */ - public void updateClob(String arg0, Reader arg1, long arg2) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateNCharacterStream(int, java.io.Reader) - */ - public void updateNCharacterStream(int arg0, Reader arg1) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateNCharacterStream(java.lang.String, java.io.Reader) - */ - public void updateNCharacterStream(String arg0, Reader arg1) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateNCharacterStream(int, java.io.Reader, long) - */ - public void updateNCharacterStream(int arg0, Reader arg1, long arg2) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateNCharacterStream(java.lang.String, java.io.Reader, long) - */ - public void updateNCharacterStream(String arg0, Reader arg1, long arg2) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateNClob(int, java.sql.NClob) - */ - public void updateNClob(int arg0, NClob arg1) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateNClob(java.lang.String, java.sql.NClob) - */ - public void updateNClob(String arg0, NClob arg1) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateNClob(int, java.io.Reader) - */ - public void updateNClob(int arg0, Reader arg1) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateNClob(java.lang.String, java.io.Reader) - */ - public void updateNClob(String arg0, Reader arg1) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateNClob(int, java.io.Reader, long) - */ - public void updateNClob(int arg0, Reader arg1, long arg2) - throws SQLException { - } - - public void updateNClob(String arg0, Reader arg1, long arg2) - throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateNString(int, java.lang.String) - */ - public void updateNString(int arg0, String arg1) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateNString(java.lang.String, java.lang.String) - */ - public void updateNString(String arg0, String arg1) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateRowId(int, java.sql.RowId) - */ - public void updateRowId(int arg0, RowId arg1) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateRowId(java.lang.String, java.sql.RowId) - */ - public void updateRowId(String arg0, RowId arg1) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateSQLXML(int, java.sql.SQLXML) - */ - public void updateSQLXML(int arg0, SQLXML arg1) throws SQLException { - } - - /** - * @see java.sql.ResultSet#updateSQLXML(java.lang.String, java.sql.SQLXML) - */ - public void updateSQLXML(String arg0, SQLXML arg1) throws SQLException { - } - - /** - * @see java.sql.Wrapper#isWrapperFor(java.lang.Class) - */ - public boolean isWrapperFor(Class arg0) throws SQLException { - return false; - } - - /** - * @see java.sql.Wrapper#unwrap(java.lang.Class) - */ - public T unwrap(Class arg0) throws SQLException { - return null; - } - -} +package de.intevation.gnv.geobackend.sde.datasources; + +import de.intevation.gnv.geobackend.sde.datasources.exception.TechnicalException; + +import java.io.InputStream; +import java.io.Reader; + +import java.math.BigDecimal; + +import java.net.URL; + +import java.sql.Array; +import java.sql.Blob; +import java.sql.Clob; +import java.sql.Date; +import java.sql.NClob; +import java.sql.Ref; +import java.sql.ResultSetMetaData; +import java.sql.RowId; +import java.sql.SQLException; +import java.sql.SQLWarning; +import java.sql.SQLXML; +import java.sql.Statement; +import java.sql.Time; +import java.sql.Timestamp; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; + +/** + * SDEResultSet is an Implementation of the Interface @see java.sql.resultSet + * It is an Wrapper between the resultsets whcih are produced using the ArcSDE + * and the Java-Interface for the Representation of ResultSets. + * @author blume + * @author Tim Englich + */ +public class SDEResultSet extends ResultSet { + + /** + * Default Logging instance + */ + private static Logger log = Logger.getLogger(SDEResultSet.class); + + private List mRows = Collections.synchronizedList(new ArrayList()); + private List mCols = Collections.synchronizedList(new ArrayList()); + + private Row currentRow = null; + private int cursor = 0; + + /** + * Constructor + */ + public SDEResultSet() { + } + + /** + * @see de.intevation.gnv.geobackend.sde.datasources.ResultSet#getCount() + */ + public int getCount() { + return mRows.size(); + } + + /** + * @see de.intevation.gnv.geobackend.sde.datasources.ResultSet#getNumberOfColumns() + */ + public int getNumberOfColumns() { + return mCols.size(); + } + + /** + * @see de.intevation.gnv.geobackend.sde.datasources.ResultSet#getColumnDefinitions() + */ + public ColDefinition[] getColumnDefinitions() { + ColDefinition[] lColDefinitions = new ColDefinition[mCols.size()]; + return mCols.toArray(lColDefinitions); + } + + /** + * @see de.intevation.gnv.geobackend.sde.datasources.ResultSet#getResults() + */ + public Row[] getResults() { + Row[] lRows = new Row[mRows.size()]; + return mRows.toArray(lRows); + } + + /** + * Add an Row to the Resultset + * @param pRow The Row that should be added. + */ + public void addRow(Row pRow) { + mRows.add(pRow); + } + + /** + * Adds a Column to the Resultset. + * @param pColDefinition The Definition of the Column + */ + public void addCol(ColDefinition pColDefinition) { + mCols.add(pColDefinition); + } + + /** + * @see java.sql.ResultSet#absolute(int) + */ + public boolean absolute(int row) throws SQLException { + + return false; + } + + /** + * @see java.sql.ResultSet#afterLast() + */ + public void afterLast() throws SQLException { + } + + /** + * @see java.sql.ResultSet#beforeFirst() + */ + public void beforeFirst() throws SQLException { + } + + /** + * @see java.sql.ResultSet#cancelRowUpdates() + */ + public void cancelRowUpdates() throws SQLException { + } + + /** + * @see java.sql.ResultSet#clearWarnings() + */ + public void clearWarnings() throws SQLException { + } + + /** + * @see java.sql.ResultSet#close() + */ + public void close() throws SQLException { + } + + /** + * @see java.sql.ResultSet#deleteRow() + */ + public void deleteRow() throws SQLException { + } + + /** + * @see java.sql.ResultSet#findColumn(java.lang.String) + */ + public int findColumn(String columnName) throws SQLException { + + return 0; + } + + /** + * @see java.sql.ResultSet#first() + */ + public boolean first() throws SQLException { + + return false; + } + + /** + * @see java.sql.ResultSet#getArray(int) + */ + public Array getArray(int i) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getArray(java.lang.String) + */ + public Array getArray(String colName) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getAsciiStream(int) + */ + public InputStream getAsciiStream(int columnIndex) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getAsciiStream(java.lang.String) + */ + public InputStream getAsciiStream(String columnName) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getBigDecimal(int) + */ + public BigDecimal getBigDecimal(int columnIndex) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getBigDecimal(java.lang.String) + */ + public BigDecimal getBigDecimal(String columnName) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getBigDecimal(int, int) + */ + public BigDecimal getBigDecimal(int columnIndex, int scale) + throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getBigDecimal(java.lang.String, int) + */ + public BigDecimal getBigDecimal(String columnName, int scale) + throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getBinaryStream(int) + */ + public InputStream getBinaryStream(int columnIndex) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getBinaryStream(java.lang.String) + */ + public InputStream getBinaryStream(String columnName) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getBlob(int) + */ + public Blob getBlob(int i) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getBlob(java.lang.String) + */ + public Blob getBlob(String colName) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getBoolean(int) + */ + public boolean getBoolean(int columnIndex) throws SQLException { + + return false; + } + + /** + * @see java.sql.ResultSet#getBoolean(java.lang.String) + */ + public boolean getBoolean(String columnName) throws SQLException { + + return false; + } + + /** + * @see java.sql.ResultSet#getByte(int) + */ + public byte getByte(int columnIndex) throws SQLException { + + return 0; + } + + /** + * @see java.sql.ResultSet#getByte(java.lang.String) + */ + public byte getByte(String columnName) throws SQLException { + + return 0; + } + + /** + * @see java.sql.ResultSet#getBytes(int) + */ + public byte[] getBytes(int columnIndex) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getBytes(java.lang.String) + */ + public byte[] getBytes(String columnName) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getCharacterStream(int) + */ + public Reader getCharacterStream(int columnIndex) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getCharacterStream(java.lang.String) + */ + public Reader getCharacterStream(String columnName) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getClob(int) + */ + public Clob getClob(int i) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getClob(java.lang.String) + */ + public Clob getClob(String colName) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getConcurrency() + */ + public int getConcurrency() throws SQLException { + + return 0; + } + + /** + * @see java.sql.ResultSet#getCursorName() + */ + public String getCursorName() throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getDate(int) + */ + public Date getDate(int columnIndex) throws SQLException { + try { + return new java.sql.Date(this.currentRow.getDateValue(columnIndex-1).getTime()); + } catch (TechnicalException e) { + log.error(e,e); + throw new SQLException(e.getMessage()); + } + } + + /** + * @see java.sql.ResultSet#getDate(java.lang.String) + */ + public Date getDate(String columnName) throws SQLException { + int columnIndex = this.getColumnIndex(columnName); + return this.getDate(columnIndex); + } + + /** + * @see java.sql.ResultSet#getDate(int, java.util.Calendar) + */ + public Date getDate(int columnIndex, Calendar cal) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getDate(java.lang.String, java.util.Calendar) + */ + public Date getDate(String columnName, Calendar cal) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getDouble(int) + */ + public double getDouble(int columnIndex) throws SQLException { + try { + return this.currentRow.getDoubleValue(columnIndex-1); + } catch (TechnicalException e) { + log.error(e,e); + throw new SQLException(e.getMessage()); + } + } + + /** + * @see java.sql.ResultSet#getDouble(java.lang.String) + */ + public double getDouble(String columnName) throws SQLException { + int columnIndex = this.getColumnIndex(columnName); + return this.getDouble(columnIndex); + } + + /** + * @see java.sql.ResultSet#getFetchDirection() + */ + public int getFetchDirection() throws SQLException { + + return 0; + } + + /** + * @see java.sql.ResultSet#getFetchSize() + */ + public int getFetchSize() throws SQLException { + + return 0; + } + + /** + * @see java.sql.ResultSet#getFloat(int) + */ + public float getFloat(int columnIndex) throws SQLException { + try { + return this.currentRow.getFloatValue(columnIndex-1); + } catch (TechnicalException e) { + log.error(e,e); + throw new SQLException(e.getMessage()); + } + } + + /** + * @see java.sql.ResultSet#getFloat(java.lang.String) + */ + public float getFloat(String columnName) throws SQLException { + int columnIndex = this.getColumnIndex(columnName); + return this.getFloat(columnIndex); + } + + /** + * @see java.sql.ResultSet#getInt(int) + */ + public int getInt(int columnIndex) throws SQLException { + + try { + return this.currentRow.getIntValue(columnIndex-1); + } catch (TechnicalException e) { + log.error(e,e); + throw new SQLException(e.getMessage()); + } + } + + /** + * @see java.sql.ResultSet#getInt(java.lang.String) + */ + public int getInt(String columnName) throws SQLException { + int columnIndex = this.getColumnIndex(columnName); + return this.getInt(columnIndex); + } + + /** + * @see java.sql.ResultSet#getLong(int) + */ + public long getLong(int columnIndex) throws SQLException { + + return 0; + } + + /** + * @see java.sql.ResultSet#getLong(java.lang.String) + */ + public long getLong(String columnName) throws SQLException { + + return 0; + } + + /** + * @see java.sql.ResultSet#getMetaData() + */ + public ResultSetMetaData getMetaData() throws SQLException { + log.debug("SDEREsultSet.getMetaData"); + return new ArcSDEResultSetMetaData(this.mCols); + } + + /** + * @see java.sql.ResultSet#getObject(int) + */ + public Object getObject(int columnIndex) throws SQLException { + try { + return this.currentRow.getValue(columnIndex-1); + } catch (TechnicalException e) { + log.error(e,e); + throw new SQLException(e.getMessage()); + } + } + + /** + * @see java.sql.ResultSet#getObject(java.lang.String) + */ + public Object getObject(String columnName) throws SQLException { + int columnIndex = this.getColumnIndex(columnName); + return this.getObject(columnIndex); + } + + /** + * @see java.sql.ResultSet#getObject(int, java.util.Map) + */ + public Object getObject(int i, Map> map) + throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getObject(java.lang.String, java.util.Map) + */ + public Object getObject(String colName, Map> map) + throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getRef(int) + */ + public Ref getRef(int i) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getRef(java.lang.String) + */ + public Ref getRef(String colName) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getRow() + */ + public int getRow() throws SQLException { + + return 0; + } + + /** + * @see java.sql.ResultSet#getShort(int) + */ + public short getShort(int columnIndex) throws SQLException { + + return 0; + } + + /** + * @see java.sql.ResultSet#getShort(java.lang.String) + */ + public short getShort(String columnName) throws SQLException { + + return 0; + } + + /** + * @see java.sql.ResultSet#getStatement() + */ + public Statement getStatement() throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getString(int) + */ + public String getString(int columnIndex) throws SQLException { + + try { + return this.currentRow.getStringValue(columnIndex-1); + } catch (TechnicalException e) { + log.error(e,e); + throw new SQLException(e.getMessage()); + } + } + + /** + * @see java.sql.ResultSet#getString(java.lang.String) + */ + public String getString(String columnName) throws SQLException { + int columnIndex = this.getColumnIndex(columnName); + return this.getString(columnIndex); + } + + /** + * @see java.sql.ResultSet#getTime(int) + */ + public Time getTime(int columnIndex) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getTime(java.lang.String) + */ + public Time getTime(String columnName) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getTime(int, java.util.Calendar) + */ + public Time getTime(int columnIndex, Calendar cal) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getTime(java.lang.String, java.util.Calendar) + */ + public Time getTime(String columnName, Calendar cal) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getTimestamp(int) + */ + public Timestamp getTimestamp(int columnIndex) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getTimestamp(java.lang.String) + */ + public Timestamp getTimestamp(String columnName) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getTimestamp(int, java.util.Calendar) + */ + public Timestamp getTimestamp(int columnIndex, Calendar cal) + throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getTimestamp(java.lang.String, + * java.util.Calendar) + */ + public Timestamp getTimestamp(String columnName, Calendar cal) + throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getType() + */ + public int getType() throws SQLException { + + return 0; + } + + /** + * @see java.sql.ResultSet#getURL(int) + */ + public URL getURL(int columnIndex) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getURL(java.lang.String) + */ + public URL getURL(String columnName) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getUnicodeStream(int) + */ + public InputStream getUnicodeStream(int columnIndex) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getUnicodeStream(java.lang.String) + */ + public InputStream getUnicodeStream(String columnName) throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#getWarnings() + */ + public SQLWarning getWarnings() throws SQLException { + + return null; + } + + /** + * @see java.sql.ResultSet#insertRow() + */ + public void insertRow() throws SQLException { + } + + /** + * @see java.sql.ResultSet#isAfterLast() + */ + public boolean isAfterLast() throws SQLException { + + return false; + } + + /** + * @see java.sql.ResultSet#isBeforeFirst() + */ + public boolean isBeforeFirst() throws SQLException { + + return false; + } + + /** + * @see java.sql.ResultSet#isFirst() + */ + public boolean isFirst() throws SQLException { + + return false; + } + + /** + * @see java.sql.ResultSet#isLast() + */ + public boolean isLast() throws SQLException { + + return false; + } + + /** + * @see java.sql.ResultSet#last() + */ + public boolean last() throws SQLException { + + return false; + } + + /** + * @see java.sql.ResultSet#moveToCurrentRow() + */ + public void moveToCurrentRow() throws SQLException { + } + + /** + * @see java.sql.ResultSet#moveToInsertRow() + */ + public void moveToInsertRow() throws SQLException { + } + + /** + * @see java.sql.ResultSet#next() + */ + public boolean next() throws SQLException { + + boolean next = this.mRows.size() > this.cursor; + if (next){ + //log.debug("Zeile "+(cursor+1)+" von "+this.mRows.size()+" wird angesteuert."); + this.currentRow = this.mRows.get(this.cursor); + this.cursor++; + }else{ + this.currentRow = null; + } + return next; + } + + /** + * @see java.sql.ResultSet#previous() + */ + public boolean previous() throws SQLException { + + return false; + } + + /** + * @see java.sql.ResultSet#refreshRow() + */ + public void refreshRow() throws SQLException { + } + + /** + * @see java.sql.ResultSet#relative(int) + */ + public boolean relative(int rows) throws SQLException { + + return false; + } + + /** + * @see java.sql.ResultSet#rowDeleted() + */ + public boolean rowDeleted() throws SQLException { + + return false; + } + + /** + * @see java.sql.ResultSet#rowInserted() + */ + public boolean rowInserted() throws SQLException { + + return false; + } + + /** + * @see java.sql.ResultSet#rowUpdated() + */ + public boolean rowUpdated() throws SQLException { + + return false; + } + + /** + * @see java.sql.ResultSet#setFetchDirection(int) + */ + public void setFetchDirection(int direction) throws SQLException { + } + + /** + * @see java.sql.ResultSet#setFetchSize(int) + */ + public void setFetchSize(int rows) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateArray(int, java.sql.Array) + */ + public void updateArray(int columnIndex, Array x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateArray(java.lang.String, java.sql.Array) + */ + public void updateArray(String columnName, Array x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateAsciiStream(int, java.io.InputStream, int) + */ + public void updateAsciiStream(int columnIndex, InputStream x, int length) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateAsciiStream(java.lang.String, + * java.io.InputStream, int) + */ + public void updateAsciiStream(String columnName, InputStream x, int length) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateBigDecimal(int, java.math.BigDecimal) + */ + public void updateBigDecimal(int columnIndex, BigDecimal x) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateBigDecimal(java.lang.String, + * java.math.BigDecimal) + */ + public void updateBigDecimal(String columnName, BigDecimal x) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateBinaryStream(int, java.io.InputStream, int) + */ + public void updateBinaryStream(int columnIndex, InputStream x, int length) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateBinaryStream(java.lang.String, + * java.io.InputStream, int) + */ + public void updateBinaryStream(String columnName, InputStream x, int length) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateBlob(int, java.sql.Blob) + */ + public void updateBlob(int columnIndex, Blob x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateBlob(java.lang.String, java.sql.Blob) + */ + public void updateBlob(String columnName, Blob x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateBoolean(int, boolean) + */ + public void updateBoolean(int columnIndex, boolean x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateBoolean(java.lang.String, boolean) + */ + public void updateBoolean(String columnName, boolean x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateByte(int, byte) + */ + public void updateByte(int columnIndex, byte x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateByte(java.lang.String, byte) + */ + public void updateByte(String columnName, byte x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateBytes(int, byte[]) + */ + public void updateBytes(int columnIndex, byte[] x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateBytes(java.lang.String, byte[]) + */ + public void updateBytes(String columnName, byte[] x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateCharacterStream(int, java.io.Reader, int) + */ + public void updateCharacterStream(int columnIndex, Reader x, int length) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateCharacterStream(java.lang.String, + * java.io.Reader, int) + */ + public void updateCharacterStream(String columnName, Reader reader, + int length) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateClob(int, java.sql.Clob) + */ + public void updateClob(int columnIndex, Clob x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateClob(java.lang.String, java.sql.Clob) + */ + public void updateClob(String columnName, Clob x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateDate(int, java.sql.Date) + */ + public void updateDate(int columnIndex, Date x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateDate(java.lang.String, java.sql.Date) + */ + public void updateDate(String columnName, Date x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateDouble(int, double) + */ + public void updateDouble(int columnIndex, double x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateDouble(java.lang.String, double) + */ + public void updateDouble(String columnName, double x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateFloat(int, float) + */ + public void updateFloat(int columnIndex, float x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateFloat(java.lang.String, float) + */ + public void updateFloat(String columnName, float x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateInt(int, int) + */ + public void updateInt(int columnIndex, int x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateInt(java.lang.String, int) + */ + public void updateInt(String columnName, int x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateLong(int, long) + */ + public void updateLong(int columnIndex, long x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateLong(java.lang.String, long) + */ + public void updateLong(String columnName, long x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateNull(int) + */ + public void updateNull(int columnIndex) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateNull(java.lang.String) + */ + public void updateNull(String columnName) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateObject(int, java.lang.Object) + */ + public void updateObject(int columnIndex, Object x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateObject(java.lang.String, java.lang.Object) + */ + public void updateObject(String columnName, Object x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateObject(int, java.lang.Object, int) + */ + public void updateObject(int columnIndex, Object x, int scale) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateObject(java.lang.String, java.lang.Object, + * int) + */ + public void updateObject(String columnName, Object x, int scale) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateRef(int, java.sql.Ref) + */ + public void updateRef(int columnIndex, Ref x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateRef(java.lang.String, java.sql.Ref) + */ + public void updateRef(String columnName, Ref x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateRow() + */ + public void updateRow() throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateShort(int, short) + */ + public void updateShort(int columnIndex, short x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateShort(java.lang.String, short) + */ + public void updateShort(String columnName, short x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateString(int, java.lang.String) + */ + public void updateString(int columnIndex, String x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateString(java.lang.String, java.lang.String) + */ + public void updateString(String columnName, String x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateTime(int, java.sql.Time) + */ + public void updateTime(int columnIndex, Time x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateTime(java.lang.String, java.sql.Time) + */ + public void updateTime(String columnName, Time x) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateTimestamp(int, java.sql.Timestamp) + */ + public void updateTimestamp(int columnIndex, Timestamp x) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateTimestamp(java.lang.String, + * java.sql.Timestamp) + */ + public void updateTimestamp(String columnName, Timestamp x) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#wasNull() + */ + public boolean wasNull() throws SQLException { + + return false; + } + + /** + * TODO: DOCUMENT ME + * @param columnName + * @return + * @throws SQLException + */ + private int getColumnIndex(String columnName) throws SQLException{ + for (int i = 0 ; i < this.mCols.size();i++){ + if(this.mCols.get(i).getName().equalsIgnoreCase(columnName)){ + return i +1; // PLUS 1 da SQL-Cursor 1 basiert sind + } + } + throw new SQLException("Column "+columnName+" does not exist in ResulSet"); + } + + /** + * @see java.sql.ResultSet#getHoldability() + */ + public int getHoldability() throws SQLException { + return 0; + } + + /** + * @see java.sql.ResultSet#getNCharacterStream(int) + */ + public Reader getNCharacterStream(int arg0) throws SQLException { + return null; + } + + /** + * @see java.sql.ResultSet#getNCharacterStream(java.lang.String) + */ + public Reader getNCharacterStream(String arg0) throws SQLException { + return null; + } + + /** + * @see java.sql.ResultSet#getNClob(int) + */ + public NClob getNClob(int arg0) throws SQLException { + return null; + } + + /** + * @see java.sql.ResultSet#getNClob(java.lang.String) + */ + public NClob getNClob(String arg0) throws SQLException { + return null; + } + + /** + * @see java.sql.ResultSet#getNString(int) + */ + public String getNString(int arg0) throws SQLException { + return null; + } + + /** + * @see java.sql.ResultSet#getNString(java.lang.String) + */ + public String getNString(String arg0) throws SQLException { + return null; + } + + /** + * @see java.sql.ResultSet#getRowId(int) + */ + public RowId getRowId(int arg0) throws SQLException { + return null; + } + + /** + * @see java.sql.ResultSet#getRowId(java.lang.String) + */ + public RowId getRowId(String arg0) throws SQLException { + return null; + } + + /** + * @see java.sql.ResultSet#getSQLXML(int) + */ + public SQLXML getSQLXML(int arg0) throws SQLException { + return null; + } + + /** + * @see java.sql.ResultSet#getSQLXML(java.lang.String) + */ + public SQLXML getSQLXML(String arg0) throws SQLException { + return null; + } + + /** + * @see java.sql.ResultSet#isClosed() + */ + public boolean isClosed() throws SQLException { + return false; + } + + /** + * @see java.sql.ResultSet#updateAsciiStream(int, java.io.InputStream) + */ + public void updateAsciiStream(int arg0, InputStream arg1) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateAsciiStream(java.lang.String, java.io.InputStream) + */ + public void updateAsciiStream(String arg0, InputStream arg1) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateAsciiStream(int, java.io.InputStream, long) + */ + public void updateAsciiStream(int arg0, InputStream arg1, long arg2) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateAsciiStream(java.lang.String, java.io.InputStream, long) + */ + public void updateAsciiStream(String arg0, InputStream arg1, long arg2) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateBinaryStream(int, java.io.InputStream) + */ + public void updateBinaryStream(int arg0, InputStream arg1) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateBinaryStream(java.lang.String, java.io.InputStream) + */ + public void updateBinaryStream(String arg0, InputStream arg1) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateBinaryStream(int, java.io.InputStream, long) + */ + public void updateBinaryStream(int arg0, InputStream arg1, long arg2) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateBinaryStream(java.lang.String, java.io.InputStream, long) + */ + public void updateBinaryStream(String arg0, InputStream arg1, long arg2) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateBlob(int, java.io.InputStream) + */ + public void updateBlob(int arg0, InputStream arg1) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateBlob(java.lang.String, java.io.InputStream) + */ + public void updateBlob(String arg0, InputStream arg1) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateBlob(int, java.io.InputStream, long) + */ + public void updateBlob(int arg0, InputStream arg1, long arg2) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateBlob(java.lang.String, java.io.InputStream, long) + */ + public void updateBlob(String arg0, InputStream arg1, long arg2) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateCharacterStream(int, java.io.Reader) + */ + public void updateCharacterStream(int arg0, Reader arg1) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateCharacterStream(java.lang.String, java.io.Reader) + */ + public void updateCharacterStream(String arg0, Reader arg1) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateCharacterStream(int, java.io.Reader, long) + */ + public void updateCharacterStream(int arg0, Reader arg1, long arg2) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateCharacterStream(java.lang.String, java.io.Reader, long) + */ + public void updateCharacterStream(String arg0, Reader arg1, long arg2) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateClob(int, java.io.Reader) + */ + public void updateClob(int arg0, Reader arg1) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateClob(java.lang.String, java.io.Reader) + */ + public void updateClob(String arg0, Reader arg1) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateClob(int, java.io.Reader, long) + */ + public void updateClob(int arg0, Reader arg1, long arg2) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateClob(java.lang.String, java.io.Reader, long) + */ + public void updateClob(String arg0, Reader arg1, long arg2) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateNCharacterStream(int, java.io.Reader) + */ + public void updateNCharacterStream(int arg0, Reader arg1) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateNCharacterStream(java.lang.String, java.io.Reader) + */ + public void updateNCharacterStream(String arg0, Reader arg1) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateNCharacterStream(int, java.io.Reader, long) + */ + public void updateNCharacterStream(int arg0, Reader arg1, long arg2) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateNCharacterStream(java.lang.String, java.io.Reader, long) + */ + public void updateNCharacterStream(String arg0, Reader arg1, long arg2) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateNClob(int, java.sql.NClob) + */ + public void updateNClob(int arg0, NClob arg1) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateNClob(java.lang.String, java.sql.NClob) + */ + public void updateNClob(String arg0, NClob arg1) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateNClob(int, java.io.Reader) + */ + public void updateNClob(int arg0, Reader arg1) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateNClob(java.lang.String, java.io.Reader) + */ + public void updateNClob(String arg0, Reader arg1) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateNClob(int, java.io.Reader, long) + */ + public void updateNClob(int arg0, Reader arg1, long arg2) + throws SQLException { + } + + public void updateNClob(String arg0, Reader arg1, long arg2) + throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateNString(int, java.lang.String) + */ + public void updateNString(int arg0, String arg1) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateNString(java.lang.String, java.lang.String) + */ + public void updateNString(String arg0, String arg1) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateRowId(int, java.sql.RowId) + */ + public void updateRowId(int arg0, RowId arg1) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateRowId(java.lang.String, java.sql.RowId) + */ + public void updateRowId(String arg0, RowId arg1) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateSQLXML(int, java.sql.SQLXML) + */ + public void updateSQLXML(int arg0, SQLXML arg1) throws SQLException { + } + + /** + * @see java.sql.ResultSet#updateSQLXML(java.lang.String, java.sql.SQLXML) + */ + public void updateSQLXML(String arg0, SQLXML arg1) throws SQLException { + } + + /** + * @see java.sql.Wrapper#isWrapperFor(java.lang.Class) + */ + public boolean isWrapperFor(Class arg0) throws SQLException { + return false; + } + + /** + * @see java.sql.Wrapper#unwrap(java.lang.Class) + */ + public T unwrap(Class arg0) throws SQLException { + return null; + } + +} diff -r 8a652a451bc6 -r d674cef2ca0d geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/exception/DatasourceException.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/exception/DatasourceException.java Sat Apr 17 09:28:02 2010 +0000 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/exception/DatasourceException.java Sun Apr 18 09:22:38 2010 +0000 @@ -1,51 +1,51 @@ -package de.intevation.gnv.geobackend.sde.datasources.exception; - -/** - * A Class for encapsulating implementation specific datasource exceptions. - * This exception class can be used for all exceptions occuring in connection - * to "datasources actions". - * - * @author blume - * @author drewnak - * @author Tim Englich - */ -public class DatasourceException extends Exception { - - /** - * The UID of this Class. - */ - private static final long serialVersionUID = 2593142889158383466L; - - /** - * Constructor - */ - public DatasourceException() { - super(); - } - - /** - * Constructor - * @param pMessage the Exceptionmessage - */ - public DatasourceException(String pMessage) { - super(pMessage); - } - - /** - * Constructor - * @param pMessage the Exceptionmessage - * @param pCause the Throwable which cause this exception - */ - public DatasourceException(String pMessage, Throwable pCause) { - super(pMessage, pCause); - } - - /** - * Constructor - * @param pCause the Throwable which cause this exception - */ - public DatasourceException(Throwable pCause) { - super(pCause); - } - -} +package de.intevation.gnv.geobackend.sde.datasources.exception; + +/** + * A Class for encapsulating implementation specific datasource exceptions. + * This exception class can be used for all exceptions occuring in connection + * to "datasources actions". + * + * @author blume + * @author drewnak + * @author Tim Englich + */ +public class DatasourceException extends Exception { + + /** + * The UID of this Class. + */ + private static final long serialVersionUID = 2593142889158383466L; + + /** + * Constructor + */ + public DatasourceException() { + super(); + } + + /** + * Constructor + * @param pMessage the Exceptionmessage + */ + public DatasourceException(String pMessage) { + super(pMessage); + } + + /** + * Constructor + * @param pMessage the Exceptionmessage + * @param pCause the Throwable which cause this exception + */ + public DatasourceException(String pMessage, Throwable pCause) { + super(pMessage, pCause); + } + + /** + * Constructor + * @param pCause the Throwable which cause this exception + */ + public DatasourceException(Throwable pCause) { + super(pCause); + } + +} diff -r 8a652a451bc6 -r d674cef2ca0d geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/exception/TechnicalException.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/exception/TechnicalException.java Sat Apr 17 09:28:02 2010 +0000 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/exception/TechnicalException.java Sun Apr 18 09:22:38 2010 +0000 @@ -1,68 +1,68 @@ -package de.intevation.gnv.geobackend.sde.datasources.exception; - -import org.apache.log4j.Logger; - -/** - * The class TechnicalException fulfills the following purposes: - * - * @author blume - * @author Tim Englich - */ -public class TechnicalException extends Exception{ - - /** - * The UID of this Class. - */ - private static final long serialVersionUID = -5296559414323169553L; - - /** - * Default Logging instance - */ - private static Logger sLogger = Logger.getLogger(TechnicalException.class); - - /** - * Constructs a new exception with null as its detail message. - * The cause is not initialized, and may subsequently be initialized by a - * call to {@link #initCause}. - */ - public TechnicalException() { - } - - /** - * Constructs a new exception with the specified detail message. The - * cause is not initialized, and may subsequently be initialized by - * a call to {@link #initCause}. - * - * @param message the detail message. The detail message is saved for - * later retrieval by the {@link #getMessage()} method. - */ - public TechnicalException(String message) { - super(message); - } - - /** - * Constructor - * @param pCause the Throwable which cause this exception - */ - public TechnicalException(Throwable pCause) { - super(pCause); - } - - /** - * Constructs a new exception with the specified detail message and - * cause.

Note that the detail message associated with - * cause is not automatically incorporated in - * this exception's detail message. - * - * @param message the detail message (which is saved for later retrieval - * by the {@link #getMessage()} method). - * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause()} method). (A null value is - * permitted, and indicates that the cause is nonexistent or - * unknown.) - * @since 1.4 - */ - public TechnicalException(String message, Throwable cause) { - super(message, cause); - } -} +package de.intevation.gnv.geobackend.sde.datasources.exception; + +import org.apache.log4j.Logger; + +/** + * The class TechnicalException fulfills the following purposes: + * + * @author blume + * @author Tim Englich + */ +public class TechnicalException extends Exception{ + + /** + * The UID of this Class. + */ + private static final long serialVersionUID = -5296559414323169553L; + + /** + * Default Logging instance + */ + private static Logger sLogger = Logger.getLogger(TechnicalException.class); + + /** + * Constructs a new exception with null as its detail message. + * The cause is not initialized, and may subsequently be initialized by a + * call to {@link #initCause}. + */ + public TechnicalException() { + } + + /** + * Constructs a new exception with the specified detail message. The + * cause is not initialized, and may subsequently be initialized by + * a call to {@link #initCause}. + * + * @param message the detail message. The detail message is saved for + * later retrieval by the {@link #getMessage()} method. + */ + public TechnicalException(String message) { + super(message); + } + + /** + * Constructor + * @param pCause the Throwable which cause this exception + */ + public TechnicalException(Throwable pCause) { + super(pCause); + } + + /** + * Constructs a new exception with the specified detail message and + * cause.

Note that the detail message associated with + * cause is not automatically incorporated in + * this exception's detail message. + * + * @param message the detail message (which is saved for later retrieval + * by the {@link #getMessage()} method). + * @param cause the cause (which is saved for later retrieval by the + * {@link #getCause()} method). (A null value is + * permitted, and indicates that the cause is nonexistent or + * unknown.) + * @since 1.4 + */ + public TechnicalException(String message, Throwable cause) { + super(message, cause); + } +} diff -r 8a652a451bc6 -r d674cef2ca0d geo-backend/src/main/java/de/intevation/gnv/geobackend/util/DateUtils.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/util/DateUtils.java Sat Apr 17 09:28:02 2010 +0000 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/util/DateUtils.java Sun Apr 18 09:22:38 2010 +0000 @@ -1,91 +1,91 @@ -/** - * Title: DateUtisl, $Header: /share/gdi/SDI-Suite/Repository/projekte/BSH-GDI/genericViewer/src/main/java/de/conterra/bsh/gdi/gnviewer/util/DateUtils.java,v 1.2 2008/08/18 14:50:33 drewnak Exp $ - * Source: $Source: /share/gdi/SDI-Suite/Repository/projekte/BSH-GDI/genericViewer/src/main/java/de/conterra/bsh/gdi/gnviewer/util/DateUtils.java,v $ - * created by: Stefan Blume (blume) - * erstellt am: 21.12.2007 - * Copyright: con terra GmbH, 2005 - * - * modified by: $Author: drewnak $ - * modified on: $Date: 2008/08/18 14:50:33 $ - * Version: $Revision: 1.2 $ - * TAG: $Name: $ - * locked from: $Locker: $ - * CVS State: $State: Exp $ - * Project: $ProjectName$ - */ -package de.intevation.gnv.geobackend.util; - -import java.text.SimpleDateFormat; -import java.util.Date; - -import org.apache.log4j.Logger; - -/** - * The class DateUtils fulfills the following purposes: - * @author blume - * @author Tim Englich - */ -public class DateUtils { - - /** - * Default Logging instance - */ - private static Logger sLogger = Logger.getLogger(DateUtils.class); - - /** - * The Dateformat which will be used e.g for Querying the Database - */ - public static final String DATE_PATTERN = "yyyy.MM.dd HH:mm:ss"; - - private static final String DATE_PATTERN1 = "dd-MMM-yyyy HH:mm:ss"; - - /** - * The Method returns a Date using the given pattern as a String - * @param pDate The Date which should be formatted - * @param sPattern The Pattern which should be used. - * @return the Date formatted a a String - */ - public static String getPatternedDate(Date pDate, String sPattern) { - SimpleDateFormat fmt = new SimpleDateFormat(); - fmt.applyPattern(sPattern); - return fmt.format(pDate); - } - - /** - * Returns the Date as a String formated using the - * DateUtils.DATE_PATTERN format- - * @param pDate the Date which should be formatted - * @return the given Data as a String - */ - public static String getPatternedDateAmer(Date pDate) { - String sStr = getPatternedDate(pDate, DATE_PATTERN); - return sStr; - } - - /** - * This method decodes a Datevalue from the given String useing the - * DateUtils.DATE_PATTERN1 format- - * @param sStr The String which contains the encoded Datevalue - * @return the decoded Datevalue as an Date-object. - * @throws Exception throws all Expetion which occurs during the Process. - */ - public static Date getDateFromString (String sStr)throws Exception { - Date date = getDateFromString (sStr, DATE_PATTERN1); - return date; - } - - /** - * Formats a given Date encoded as a String using the given Pattern - * into a Date Object. - * @param sStr The String with the encoded DateValue - * @param sPattern The pattern which should be used to decode the Date - * @return the given Datevalue as an Date-Object. - * @throws Exception throws all Expetion which occurs during the Process. - */ - public static Date getDateFromString (String sStr, - String sPattern)throws Exception { - SimpleDateFormat fmt = new SimpleDateFormat(); - fmt.applyPattern(sPattern); - return fmt.parse(sStr); - } -} +/** + * Title: DateUtisl, $Header: /share/gdi/SDI-Suite/Repository/projekte/BSH-GDI/genericViewer/src/main/java/de/conterra/bsh/gdi/gnviewer/util/DateUtils.java,v 1.2 2008/08/18 14:50:33 drewnak Exp $ + * Source: $Source: /share/gdi/SDI-Suite/Repository/projekte/BSH-GDI/genericViewer/src/main/java/de/conterra/bsh/gdi/gnviewer/util/DateUtils.java,v $ + * created by: Stefan Blume (blume) + * erstellt am: 21.12.2007 + * Copyright: con terra GmbH, 2005 + * + * modified by: $Author: drewnak $ + * modified on: $Date: 2008/08/18 14:50:33 $ + * Version: $Revision: 1.2 $ + * TAG: $Name: $ + * locked from: $Locker: $ + * CVS State: $State: Exp $ + * Project: $ProjectName$ + */ +package de.intevation.gnv.geobackend.util; + +import java.text.SimpleDateFormat; +import java.util.Date; + +import org.apache.log4j.Logger; + +/** + * The class DateUtils fulfills the following purposes: + * @author blume + * @author Tim Englich + */ +public class DateUtils { + + /** + * Default Logging instance + */ + private static Logger sLogger = Logger.getLogger(DateUtils.class); + + /** + * The Dateformat which will be used e.g for Querying the Database + */ + public static final String DATE_PATTERN = "yyyy.MM.dd HH:mm:ss"; + + private static final String DATE_PATTERN1 = "dd-MMM-yyyy HH:mm:ss"; + + /** + * The Method returns a Date using the given pattern as a String + * @param pDate The Date which should be formatted + * @param sPattern The Pattern which should be used. + * @return the Date formatted a a String + */ + public static String getPatternedDate(Date pDate, String sPattern) { + SimpleDateFormat fmt = new SimpleDateFormat(); + fmt.applyPattern(sPattern); + return fmt.format(pDate); + } + + /** + * Returns the Date as a String formated using the + * DateUtils.DATE_PATTERN format- + * @param pDate the Date which should be formatted + * @return the given Data as a String + */ + public static String getPatternedDateAmer(Date pDate) { + String sStr = getPatternedDate(pDate, DATE_PATTERN); + return sStr; + } + + /** + * This method decodes a Datevalue from the given String useing the + * DateUtils.DATE_PATTERN1 format- + * @param sStr The String which contains the encoded Datevalue + * @return the decoded Datevalue as an Date-object. + * @throws Exception throws all Expetion which occurs during the Process. + */ + public static Date getDateFromString (String sStr)throws Exception { + Date date = getDateFromString (sStr, DATE_PATTERN1); + return date; + } + + /** + * Formats a given Date encoded as a String using the given Pattern + * into a Date Object. + * @param sStr The String with the encoded DateValue + * @param sPattern The pattern which should be used to decode the Date + * @return the given Datevalue as an Date-Object. + * @throws Exception throws all Expetion which occurs during the Process. + */ + public static Date getDateFromString (String sStr, + String sPattern)throws Exception { + SimpleDateFormat fmt = new SimpleDateFormat(); + fmt.applyPattern(sPattern); + return fmt.parse(sStr); + } +}