diff geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEResultSetMetaData.java @ 132:5a583cff97ea

Implementation of the Datainfrastructure for fetching Data from different DataStores. geo-backend/trunk@12 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Fri, 04 Sep 2009 08:11:30 +0000
parents
children 0100ebf6630f
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEResultSetMetaData.java	Fri Sep 04 08:11:30 2009 +0000
@@ -0,0 +1,194 @@
+/**
+ *
+ */
+package de.intevation.gnv.geobackend.sde.datasources;
+
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.util.List;
+
+/**
+ * @author Tim Englich <tim.englich@intevation.de>
+ *
+ */
+public class ArcSDEResultSetMetaData implements ResultSetMetaData {
+
+    private List<ColDefinition> columnDefinitions = null;
+    /**
+     * Constructor
+     */
+    public ArcSDEResultSetMetaData(List<ColDefinition> columnDefinitions) {
+        this.columnDefinitions = columnDefinitions;
+    }
+
+    /**
+     * @see java.sql.ResultSetMetaData#getCatalogName(int)
+     */
+    public String getCatalogName(int column) throws SQLException {
+
+        return null;
+    }
+
+    /**
+     * @see java.sql.ResultSetMetaData#getColumnClassName(int)
+     */
+    public String getColumnClassName(int column) throws SQLException {
+        
+        int type = this.getColumnType(column);
+        Class clazz = java.lang.Object.class;
+        if (type == 2){
+            clazz = int.class;
+        }
+        // TODO weitere Klassen Implementieren
+        return  clazz.getName();
+    }
+
+    /**
+     * @see java.sql.ResultSetMetaData#getColumnCount()
+     */
+    public int getColumnCount() throws SQLException {
+        return columnDefinitions.size();
+    }
+
+    /**
+     * @see java.sql.ResultSetMetaData#getColumnDisplaySize(int)
+     */
+    public int getColumnDisplaySize(int column) throws SQLException {
+
+        return 0;
+    }
+
+    /**
+     * @see java.sql.ResultSetMetaData#getColumnLabel(int)
+     */
+    public String getColumnLabel(int column) throws SQLException {
+        return columnDefinitions.get(column-1).getName();
+    }
+
+    /**
+     * @see java.sql.ResultSetMetaData#getColumnName(int)
+     */
+    public String getColumnName(int column) throws SQLException {
+        return columnDefinitions.get(column-1).getName();
+    }
+
+    /**
+     * @see java.sql.ResultSetMetaData#getColumnType(int)
+     */
+    public int getColumnType(int column) throws SQLException {
+        return  columnDefinitions.get(column-1).getType();
+    }
+
+    /**
+     * @see java.sql.ResultSetMetaData#getColumnTypeName(int)
+     */
+    public String getColumnTypeName(int column) throws SQLException {
+
+        return null;
+    }
+
+    /**
+     * @see java.sql.ResultSetMetaData#getPrecision(int)
+     */
+    public int getPrecision(int column) throws SQLException {
+
+        return 0;
+    }
+
+    /**
+     * @see java.sql.ResultSetMetaData#getScale(int)
+     */
+    public int getScale(int column) throws SQLException {
+
+        return 0;
+    }
+
+    /**
+     * @see java.sql.ResultSetMetaData#getSchemaName(int)
+     */
+    public String getSchemaName(int column) throws SQLException {
+
+        return null;
+    }
+
+    /**
+     * @see java.sql.ResultSetMetaData#getTableName(int)
+     */
+    public String getTableName(int column) throws SQLException {
+
+        return null;
+    }
+
+    /**
+     * @see java.sql.ResultSetMetaData#isAutoIncrement(int)
+     */
+    public boolean isAutoIncrement(int column) throws SQLException {
+
+        return false;
+    }
+
+    /**
+     * @see java.sql.ResultSetMetaData#isCaseSensitive(int)
+     */
+    public boolean isCaseSensitive(int column) throws SQLException {
+
+        return false;
+    }
+
+    /**
+     * @see java.sql.ResultSetMetaData#isCurrency(int)
+     */
+    public boolean isCurrency(int column) throws SQLException {
+
+        return false;
+    }
+
+    /**
+     * @see java.sql.ResultSetMetaData#isDefinitelyWritable(int)
+     */
+    public boolean isDefinitelyWritable(int column) throws SQLException {
+
+        return false;
+    }
+
+    /**
+     * @see java.sql.ResultSetMetaData#isNullable(int)
+     */
+    public int isNullable(int column) throws SQLException {
+
+        return 0;
+    }
+
+    /**
+     * @see java.sql.ResultSetMetaData#isReadOnly(int)
+     */
+    public boolean isReadOnly(int column) throws SQLException {
+
+        return true;
+    }
+
+    /**
+     * @see java.sql.ResultSetMetaData#isSearchable(int)
+     */
+    public boolean isSearchable(int column) throws SQLException {
+
+        return true;
+    }
+
+    /**
+     * @see java.sql.ResultSetMetaData#isSigned(int)
+     */
+    public boolean isSigned(int column) throws SQLException {
+
+        return false;
+    }
+
+    /**
+     * @see java.sql.ResultSetMetaData#isWritable(int)
+     */
+    public boolean isWritable(int column) throws SQLException {
+
+        return false;
+    }
+
+}

http://dive4elements.wald.intevation.org