hadoop-hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhr...@apache.org
Subject svn commit: r731809 [3/3] - in /hadoop/hive/trunk: ./ jdbc/ jdbc/src/ jdbc/src/java/ jdbc/src/java/org/ jdbc/src/java/org/apache/ jdbc/src/java/org/apache/hadoop/ jdbc/src/java/org/apache/hadoop/hive/ jdbc/src/java/org/apache/hadoop/hive/jdbc/ jdbc/src...
Date Tue, 06 Jan 2009 02:06:21 GMT
Added: hadoop/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveResultSet.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveResultSet.java?rev=731809&view=auto
==============================================================================
--- hadoop/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveResultSet.java (added)
+++ hadoop/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveResultSet.java Mon Jan  5 18:06:20 2009
@@ -0,0 +1,1886 @@
+/**
+ *
+ */
+package org.apache.hadoop.hive.jdbc;
+
+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.Calendar;
+import java.util.Map;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Properties;
+import org.apache.hadoop.hive.serde2.dynamic_type.DynamicSerDe;
+import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
+import org.apache.hadoop.hive.serde.Constants;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.service.HiveInterface;
+import org.apache.hadoop.io.BytesWritable;
+
+
+public class HiveResultSet implements java.sql.ResultSet {
+  HiveInterface client;
+  ArrayList<?> row;
+  DynamicSerDe ds;
+
+  /**
+   *
+   */
+  @SuppressWarnings("unchecked")
+  public HiveResultSet(HiveInterface client) {
+    this.client = client;
+    this.row = new ArrayList();
+    initDynamicSerde();
+  }
+
+  /**
+   * Instantiate the dynamic serde used to deserialize the result row
+   */
+  public void initDynamicSerde() {
+    try {
+      ds = new DynamicSerDe();
+      Properties dsp = new Properties();
+      dsp.setProperty(Constants.SERIALIZATION_FORMAT, org.apache.hadoop.hive.serde2.thrift.TCTLSeparatedProtocol.class.getName());
+      dsp.setProperty(org.apache.hadoop.hive.metastore.api.Constants.META_TABLE_NAME, "result");
+      dsp.setProperty(Constants.SERIALIZATION_DDL, client.getSchema());
+      dsp.setProperty(Constants.SERIALIZATION_LIB, ds.getClass().toString());
+      dsp.setProperty(Constants.FIELD_DELIM, "9");
+      ds.initialize(new Configuration(), dsp);
+    } catch (Exception ex) {
+      // TODO: Decide what to do here.
+    }
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#absolute(int)
+   */
+
+  public boolean absolute(int row) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#afterLast()
+   */
+
+  public void afterLast() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#beforeFirst()
+   */
+
+  public void beforeFirst() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#cancelRowUpdates()
+   */
+
+  public void cancelRowUpdates() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#clearWarnings()
+   */
+
+  public void clearWarnings() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#close()
+   */
+
+  public void close() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#deleteRow()
+   */
+
+  public void deleteRow() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#findColumn(java.lang.String)
+   */
+
+  public int findColumn(String columnName) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#first()
+   */
+
+  public boolean first() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getArray(int)
+   */
+
+  public Array getArray(int i) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getArray(java.lang.String)
+   */
+
+  public Array getArray(String colName) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getAsciiStream(int)
+   */
+
+  public InputStream getAsciiStream(int columnIndex) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getAsciiStream(java.lang.String)
+   */
+
+  public InputStream getAsciiStream(String columnName) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getBigDecimal(int)
+   */
+
+  public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getBigDecimal(java.lang.String)
+   */
+
+  public BigDecimal getBigDecimal(String columnName) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getBigDecimal(int, int)
+   */
+
+  public BigDecimal getBigDecimal(int columnIndex, int scale)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getBigDecimal(java.lang.String, int)
+   */
+
+  public BigDecimal getBigDecimal(String columnName, int scale)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getBinaryStream(int)
+   */
+
+  public InputStream getBinaryStream(int columnIndex) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getBinaryStream(java.lang.String)
+   */
+
+  public InputStream getBinaryStream(String columnName) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getBlob(int)
+   */
+
+  public Blob getBlob(int i) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getBlob(java.lang.String)
+   */
+
+  public Blob getBlob(String colName) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getBoolean(int)
+   */
+
+  public boolean getBoolean(int columnIndex) throws SQLException {
+    Object obj = row.get(columnIndex-1);
+    if (Number.class.isInstance(obj)) {
+      return ((Number)obj).intValue() != 0;
+    }
+    throw new SQLException("Cannot convert column " + columnIndex + " to boolean");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getBoolean(java.lang.String)
+   */
+
+  public boolean getBoolean(String columnName) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getByte(int)
+   */
+
+  public byte getByte(int columnIndex) throws SQLException {
+    Object obj = row.get(columnIndex-1);
+    if (Number.class.isInstance(obj)) {
+      return ((Number)obj).byteValue();
+    }
+    throw new SQLException("Cannot convert column " + columnIndex + " to byte");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getByte(java.lang.String)
+   */
+
+  public byte getByte(String columnName) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getBytes(int)
+   */
+
+  public byte[] getBytes(int columnIndex) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getBytes(java.lang.String)
+   */
+
+  public byte[] getBytes(String columnName) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getCharacterStream(int)
+   */
+
+  public Reader getCharacterStream(int columnIndex) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getCharacterStream(java.lang.String)
+   */
+
+  public Reader getCharacterStream(String columnName) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getClob(int)
+   */
+
+  public Clob getClob(int i) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getClob(java.lang.String)
+   */
+
+  public Clob getClob(String colName) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getConcurrency()
+   */
+
+  public int getConcurrency() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getCursorName()
+   */
+
+  public String getCursorName() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getDate(int)
+   */
+
+  public Date getDate(int columnIndex) throws SQLException {
+    try {
+      return Date.valueOf((String)row.get(columnIndex-1));
+    }
+    catch (Exception e) {
+    throw new SQLException("Cannot convert column " + columnIndex + " to date: " + e.toString());
+    }
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getDate(java.lang.String)
+   */
+
+  public Date getDate(String columnName) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getDate(int, java.util.Calendar)
+   */
+
+  public Date getDate(int columnIndex, Calendar cal) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getDate(java.lang.String, java.util.Calendar)
+   */
+
+  public Date getDate(String columnName, Calendar cal) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getDouble(int)
+   */
+
+  public double getDouble(int columnIndex) throws SQLException {
+    try {
+      Object obj = row.get(columnIndex-1);
+      if (Number.class.isInstance(obj)) {
+        return ((Number)obj).doubleValue();
+      }
+      throw new Exception("Illegal conversion");
+    }
+    catch (Exception e) {
+      throw new SQLException("Cannot convert column " + columnIndex + " to double: " + e.toString());
+    }
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getDouble(java.lang.String)
+   */
+
+  public double getDouble(String columnName) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getFetchDirection()
+   */
+
+  public int getFetchDirection() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getFetchSize()
+   */
+
+  public int getFetchSize() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getFloat(int)
+   */
+
+  public float getFloat(int columnIndex) throws SQLException {
+    try {
+      Object obj = row.get(columnIndex-1);
+      if (Number.class.isInstance(obj)) {
+        return ((Number)obj).floatValue();
+      }
+      throw new Exception("Illegal conversion");
+    }
+    catch (Exception e) {
+      throw new SQLException("Cannot convert column " + columnIndex + " to float: " + e.toString());
+    }
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getFloat(java.lang.String)
+   */
+
+  public float getFloat(String columnName) throws SQLException {
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getHoldability()
+   */
+
+  public int getHoldability() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getInt(int)
+   */
+
+  public int getInt(int columnIndex) throws SQLException {
+    try {
+      Object obj = row.get(columnIndex-1);
+      if (Number.class.isInstance(obj)) {
+        return ((Number)obj).intValue();
+      }
+      throw new Exception("Illegal conversion");
+    }
+    catch (Exception e) {
+      throw new SQLException("Cannot convert column " + columnIndex + " to integer" + e.toString());
+    }
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getInt(java.lang.String)
+   */
+
+  public int getInt(String columnName) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getLong(int)
+   */
+
+  public long getLong(int columnIndex) throws SQLException {
+    try {
+      Object obj = row.get(columnIndex-1);
+      if (Number.class.isInstance(obj)) {
+        return ((Number)obj).longValue();
+      }
+      throw new Exception("Illegal conversion");
+    }
+    catch (Exception e) {
+      throw new SQLException("Cannot convert column " + columnIndex + " to long: " + e.toString());
+    }
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getLong(java.lang.String)
+   */
+
+  public long getLong(String columnName) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getMetaData()
+   */
+
+  public ResultSetMetaData getMetaData() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getNCharacterStream(int)
+   */
+
+  public Reader getNCharacterStream(int arg0) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getNCharacterStream(java.lang.String)
+   */
+
+  public Reader getNCharacterStream(String arg0) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getNClob(int)
+   */
+
+  public NClob getNClob(int arg0) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getNClob(java.lang.String)
+   */
+
+  public NClob getNClob(String columnLabel) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getNString(int)
+   */
+
+  public String getNString(int columnIndex) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getNString(java.lang.String)
+   */
+
+  public String getNString(String columnLabel) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getObject(int)
+   */
+
+  public Object getObject(int columnIndex) throws SQLException {
+    try {
+      return row.get(columnIndex-1);
+    }
+    catch (Exception e) {
+      throw new SQLException(e.toString());
+    }
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getObject(java.lang.String)
+   */
+
+  public Object getObject(String columnName) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getObject(int, java.util.Map)
+   */
+
+  public Object getObject(int i, Map<String, Class<?>> map)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getObject(java.lang.String, java.util.Map)
+   */
+
+  public Object getObject(String colName, Map<String, Class<?>> map)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getRef(int)
+   */
+
+  public Ref getRef(int i) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getRef(java.lang.String)
+   */
+
+  public Ref getRef(String colName) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getRow()
+   */
+
+  public int getRow() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getRowId(int)
+   */
+
+  public RowId getRowId(int columnIndex) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getRowId(java.lang.String)
+   */
+
+  public RowId getRowId(String columnLabel) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getSQLXML(int)
+   */
+
+  public SQLXML getSQLXML(int columnIndex) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getSQLXML(java.lang.String)
+   */
+
+  public SQLXML getSQLXML(String columnLabel) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getShort(int)
+   */
+
+  public short getShort(int columnIndex) throws SQLException {
+    try {
+      Object obj = row.get(columnIndex-1);
+      if (Number.class.isInstance(obj)) {
+        return ((Number)obj).shortValue();
+      }
+      throw new Exception("Illegal conversion");
+    }
+    catch (Exception e) {
+      throw new SQLException("Cannot convert column " + columnIndex + " to short: " + e.toString());
+    }
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getShort(java.lang.String)
+   */
+
+  public short getShort(String columnName) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getStatement()
+   */
+
+  public Statement getStatement() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /**
+   * @param columnIndex - the first column is 1, the second is 2, ...
+   * @see java.sql.ResultSet#getString(int)
+   */
+
+  public String getString(int columnIndex) throws SQLException {
+    // Column index starts from 1, not 0.
+    return row.get(columnIndex - 1).toString();
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getString(java.lang.String)
+   */
+
+  public String getString(String columnName) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getTime(int)
+   */
+
+  public Time getTime(int columnIndex) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getTime(java.lang.String)
+   */
+
+  public Time getTime(String columnName) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getTime(int, java.util.Calendar)
+   */
+
+  public Time getTime(int columnIndex, Calendar cal) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getTime(java.lang.String, java.util.Calendar)
+   */
+
+  public Time getTime(String columnName, Calendar cal) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getTimestamp(int)
+   */
+
+  public Timestamp getTimestamp(int columnIndex) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getTimestamp(java.lang.String)
+   */
+
+  public Timestamp getTimestamp(String columnName) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getTimestamp(int, java.util.Calendar)
+   */
+
+  public Timestamp getTimestamp(int columnIndex, Calendar cal)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getTimestamp(java.lang.String, java.util.Calendar)
+   */
+
+  public Timestamp getTimestamp(String columnName, Calendar cal)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getType()
+   */
+
+  public int getType() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getURL(int)
+   */
+
+  public URL getURL(int columnIndex) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getURL(java.lang.String)
+   */
+
+  public URL getURL(String columnName) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getUnicodeStream(int)
+   */
+
+  public InputStream getUnicodeStream(int columnIndex) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getUnicodeStream(java.lang.String)
+   */
+
+  public InputStream getUnicodeStream(String columnName) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#getWarnings()
+   */
+
+  public SQLWarning getWarnings() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#insertRow()
+   */
+
+  public void insertRow() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#isAfterLast()
+   */
+
+  public boolean isAfterLast() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#isBeforeFirst()
+   */
+
+  public boolean isBeforeFirst() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#isClosed()
+   */
+
+  public boolean isClosed() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#isFirst()
+   */
+
+  public boolean isFirst() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#isLast()
+   */
+
+  public boolean isLast() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#last()
+   */
+
+  public boolean last() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#moveToCurrentRow()
+   */
+
+  public void moveToCurrentRow() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#moveToInsertRow()
+   */
+
+  public void moveToInsertRow() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /**
+   * Moves the cursor down one row from its current position.
+   *
+   * @see java.sql.ResultSet#next()
+   * @throws SQLException if a database access error occurs.
+   */
+
+  public boolean next() throws SQLException {
+    String row_str;
+    try {
+      row_str = (String)client.fetchOne();
+      if (!row_str.equals("")) {
+        Object o = ds.deserialize(new BytesWritable(row_str.getBytes()));
+        row = (ArrayList<?>)o;
+      }
+    } catch (Exception ex) {
+      throw new SQLException("Error retrieving next row");
+    }
+    // NOTE: fetchOne dosn't throw new SQLException("Method not supported").
+    return row_str != "";
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#previous()
+   */
+
+  public boolean previous() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#refreshRow()
+   */
+
+  public void refreshRow() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#relative(int)
+   */
+
+  public boolean relative(int rows) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#rowDeleted()
+   */
+
+  public boolean rowDeleted() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#rowInserted()
+   */
+
+  public boolean rowInserted() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#rowUpdated()
+   */
+
+  public boolean rowUpdated() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#setFetchDirection(int)
+   */
+
+  public void setFetchDirection(int direction) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#setFetchSize(int)
+   */
+
+  public void setFetchSize(int rows) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateArray(int, java.sql.Array)
+   */
+
+  public void updateArray(int columnIndex, Array x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateArray(java.lang.String, java.sql.Array)
+   */
+
+  public void updateArray(String columnName, Array x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateAsciiStream(int, java.io.InputStream)
+   */
+
+  public void updateAsciiStream(int columnIndex, InputStream x)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateAsciiStream(java.lang.String, java.io.InputStream)
+   */
+
+  public void updateAsciiStream(String columnLabel, InputStream x)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateAsciiStream(int, java.io.InputStream, int)
+   */
+
+  public void updateAsciiStream(int columnIndex, InputStream x, int length)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateAsciiStream(java.lang.String, java.io.InputStream, int)
+   */
+
+  public void updateAsciiStream(String columnName, InputStream x, int length)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateAsciiStream(int, java.io.InputStream, long)
+   */
+
+  public void updateAsciiStream(int columnIndex, InputStream x, long length)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateAsciiStream(java.lang.String, java.io.InputStream, long)
+   */
+
+  public void updateAsciiStream(String columnLabel, InputStream x, long length)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateBigDecimal(int, java.math.BigDecimal)
+   */
+
+  public void updateBigDecimal(int columnIndex, BigDecimal x)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateBigDecimal(java.lang.String, java.math.BigDecimal)
+   */
+
+  public void updateBigDecimal(String columnName, BigDecimal x)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateBinaryStream(int, java.io.InputStream)
+   */
+
+  public void updateBinaryStream(int columnIndex, InputStream x)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateBinaryStream(java.lang.String, java.io.InputStream)
+   */
+
+  public void updateBinaryStream(String columnLabel, InputStream x)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateBinaryStream(int, java.io.InputStream, int)
+   */
+
+  public void updateBinaryStream(int columnIndex, InputStream x, int length)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateBinaryStream(java.lang.String, java.io.InputStream, int)
+   */
+
+  public void updateBinaryStream(String columnName, InputStream x, int length)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateBinaryStream(int, java.io.InputStream, long)
+   */
+
+  public void updateBinaryStream(int columnIndex, InputStream x, long length)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateBinaryStream(java.lang.String, java.io.InputStream, long)
+   */
+
+  public void updateBinaryStream(String columnLabel, InputStream x,
+      long length) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateBlob(int, java.sql.Blob)
+   */
+
+  public void updateBlob(int columnIndex, Blob x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateBlob(java.lang.String, java.sql.Blob)
+   */
+
+  public void updateBlob(String columnName, Blob x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateBlob(int, java.io.InputStream)
+   */
+
+  public void updateBlob(int columnIndex, InputStream inputStream)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateBlob(java.lang.String, java.io.InputStream)
+   */
+
+  public void updateBlob(String columnLabel, InputStream inputStream)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateBlob(int, java.io.InputStream, long)
+   */
+
+  public void updateBlob(int columnIndex, InputStream inputStream, long length)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateBlob(java.lang.String, java.io.InputStream, long)
+   */
+
+  public void updateBlob(String columnLabel, InputStream inputStream,
+      long length) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateBoolean(int, boolean)
+   */
+
+  public void updateBoolean(int columnIndex, boolean x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateBoolean(java.lang.String, boolean)
+   */
+
+  public void updateBoolean(String columnName, boolean x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateByte(int, byte)
+   */
+
+  public void updateByte(int columnIndex, byte x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateByte(java.lang.String, byte)
+   */
+
+  public void updateByte(String columnName, byte x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateBytes(int, byte[])
+   */
+
+  public void updateBytes(int columnIndex, byte[] x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateBytes(java.lang.String, byte[])
+   */
+
+  public void updateBytes(String columnName, byte[] x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateCharacterStream(int, java.io.Reader)
+   */
+
+  public void updateCharacterStream(int columnIndex, Reader x)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateCharacterStream(java.lang.String, java.io.Reader)
+   */
+
+  public void updateCharacterStream(String columnLabel, Reader reader)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateCharacterStream(int, java.io.Reader, int)
+   */
+
+  public void updateCharacterStream(int columnIndex, Reader x, int length)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateCharacterStream(java.lang.String, java.io.Reader, int)
+   */
+
+  public void updateCharacterStream(String columnName, Reader reader,
+      int length) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateCharacterStream(int, java.io.Reader, long)
+   */
+
+  public void updateCharacterStream(int columnIndex, Reader x, long length)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateCharacterStream(java.lang.String, java.io.Reader, long)
+   */
+
+  public void updateCharacterStream(String columnLabel, Reader reader,
+      long length) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateClob(int, java.sql.Clob)
+   */
+
+  public void updateClob(int columnIndex, Clob x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateClob(java.lang.String, java.sql.Clob)
+   */
+
+  public void updateClob(String columnName, Clob x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateClob(int, java.io.Reader)
+   */
+
+  public void updateClob(int columnIndex, Reader reader) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateClob(java.lang.String, java.io.Reader)
+   */
+
+  public void updateClob(String columnLabel, Reader reader)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateClob(int, java.io.Reader, long)
+   */
+
+  public void updateClob(int columnIndex, Reader reader, long length)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateClob(java.lang.String, java.io.Reader, long)
+   */
+
+  public void updateClob(String columnLabel, Reader reader, long length)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateDate(int, java.sql.Date)
+   */
+
+  public void updateDate(int columnIndex, Date x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateDate(java.lang.String, java.sql.Date)
+   */
+
+  public void updateDate(String columnName, Date x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateDouble(int, double)
+   */
+
+  public void updateDouble(int columnIndex, double x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateDouble(java.lang.String, double)
+   */
+
+  public void updateDouble(String columnName, double x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateFloat(int, float)
+   */
+
+  public void updateFloat(int columnIndex, float x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateFloat(java.lang.String, float)
+   */
+
+  public void updateFloat(String columnName, float x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateInt(int, int)
+   */
+
+  public void updateInt(int columnIndex, int x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateInt(java.lang.String, int)
+   */
+
+  public void updateInt(String columnName, int x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateLong(int, long)
+   */
+
+  public void updateLong(int columnIndex, long x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateLong(java.lang.String, long)
+   */
+
+  public void updateLong(String columnName, long x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateNCharacterStream(int, java.io.Reader)
+   */
+
+  public void updateNCharacterStream(int columnIndex, Reader x)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateNCharacterStream(java.lang.String, java.io.Reader)
+   */
+
+  public void updateNCharacterStream(String columnLabel, Reader reader)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateNCharacterStream(int, java.io.Reader, long)
+   */
+
+  public void updateNCharacterStream(int columnIndex, Reader x, long length)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateNCharacterStream(java.lang.String, java.io.Reader, long)
+   */
+
+  public void updateNCharacterStream(String columnLabel, Reader reader,
+      long length) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateNClob(int, java.sql.NClob)
+   */
+
+  public void updateNClob(int columnIndex, NClob clob) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateNClob(java.lang.String, java.sql.NClob)
+   */
+
+  public void updateNClob(String columnLabel, NClob clob) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateNClob(int, java.io.Reader)
+   */
+
+  public void updateNClob(int columnIndex, Reader reader) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateNClob(java.lang.String, java.io.Reader)
+   */
+
+  public void updateNClob(String columnLabel, Reader reader)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateNClob(int, java.io.Reader, long)
+   */
+
+  public void updateNClob(int columnIndex, Reader reader, long length)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateNClob(java.lang.String, java.io.Reader, long)
+   */
+
+  public void updateNClob(String columnLabel, Reader reader, long length)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateNString(int, java.lang.String)
+   */
+
+  public void updateNString(int columnIndex, String string)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateNString(java.lang.String, java.lang.String)
+   */
+
+  public void updateNString(String columnLabel, String string)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateNull(int)
+   */
+
+  public void updateNull(int columnIndex) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateNull(java.lang.String)
+   */
+
+  public void updateNull(String columnName) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateObject(int, java.lang.Object)
+   */
+
+  public void updateObject(int columnIndex, Object x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateObject(java.lang.String, java.lang.Object)
+   */
+
+  public void updateObject(String columnName, Object x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateObject(int, java.lang.Object, int)
+   */
+
+  public void updateObject(int columnIndex, Object x, int scale)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateObject(java.lang.String, java.lang.Object, int)
+   */
+
+  public void updateObject(String columnName, Object x, int scale)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateRef(int, java.sql.Ref)
+   */
+
+  public void updateRef(int columnIndex, Ref x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateRef(java.lang.String, java.sql.Ref)
+   */
+
+  public void updateRef(String columnName, Ref x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateRow()
+   */
+
+  public void updateRow() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateRowId(int, java.sql.RowId)
+   */
+
+  public void updateRowId(int columnIndex, RowId x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateRowId(java.lang.String, java.sql.RowId)
+   */
+
+  public void updateRowId(String columnLabel, RowId x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateSQLXML(int, java.sql.SQLXML)
+   */
+
+  public void updateSQLXML(int columnIndex, SQLXML xmlObject)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateSQLXML(java.lang.String, java.sql.SQLXML)
+   */
+
+  public void updateSQLXML(String columnLabel, SQLXML xmlObject)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateShort(int, short)
+   */
+
+  public void updateShort(int columnIndex, short x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateShort(java.lang.String, short)
+   */
+
+  public void updateShort(String columnName, short x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateString(int, java.lang.String)
+   */
+
+  public void updateString(int columnIndex, String x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateString(java.lang.String, java.lang.String)
+   */
+
+  public void updateString(String columnName, String x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateTime(int, java.sql.Time)
+   */
+
+  public void updateTime(int columnIndex, Time x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateTime(java.lang.String, java.sql.Time)
+   */
+
+  public void updateTime(String columnName, Time x) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateTimestamp(int, java.sql.Timestamp)
+   */
+
+  public void updateTimestamp(int columnIndex, Timestamp x)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#updateTimestamp(java.lang.String, java.sql.Timestamp)
+   */
+
+  public void updateTimestamp(String columnName, Timestamp x)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSet#wasNull()
+   */
+
+  public boolean wasNull() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Wrapper#isWrapperFor(java.lang.Class)
+   */
+
+  public boolean isWrapperFor(Class<?> iface) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Wrapper#unwrap(java.lang.Class)
+   */
+
+  public <T> T unwrap(Class<T> iface) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+}

Added: hadoop/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveResultSetMetaData.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveResultSetMetaData.java?rev=731809&view=auto
==============================================================================
--- hadoop/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveResultSetMetaData.java (added)
+++ hadoop/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveResultSetMetaData.java Mon Jan  5 18:06:20 2009
@@ -0,0 +1,218 @@
+/**
+ *
+ */
+package org.apache.hadoop.hive.jdbc;
+
+import java.sql.SQLException;
+
+
+public class HiveResultSetMetaData implements java.sql.ResultSetMetaData {
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSetMetaData#getCatalogName(int)
+   */
+
+  public String getCatalogName(int column) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSetMetaData#getColumnClassName(int)
+   */
+
+  public String getColumnClassName(int column) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSetMetaData#getColumnCount()
+   */
+
+  public int getColumnCount() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSetMetaData#getColumnDisplaySize(int)
+   */
+
+  public int getColumnDisplaySize(int column) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSetMetaData#getColumnLabel(int)
+   */
+
+  public String getColumnLabel(int column) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSetMetaData#getColumnName(int)
+   */
+
+  public String getColumnName(int column) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSetMetaData#getColumnType(int)
+   */
+
+  public int getColumnType(int column) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSetMetaData#getColumnTypeName(int)
+   */
+
+  public String getColumnTypeName(int column) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSetMetaData#getPrecision(int)
+   */
+
+  public int getPrecision(int column) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSetMetaData#getScale(int)
+   */
+
+  public int getScale(int column) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSetMetaData#getSchemaName(int)
+   */
+
+  public String getSchemaName(int column) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSetMetaData#getTableName(int)
+   */
+
+  public String getTableName(int column) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSetMetaData#isAutoIncrement(int)
+   */
+
+  public boolean isAutoIncrement(int column) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSetMetaData#isCaseSensitive(int)
+   */
+
+  public boolean isCaseSensitive(int column) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSetMetaData#isCurrency(int)
+   */
+
+  public boolean isCurrency(int column) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSetMetaData#isDefinitelyWritable(int)
+   */
+
+  public boolean isDefinitelyWritable(int column) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSetMetaData#isNullable(int)
+   */
+
+  public int isNullable(int column) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSetMetaData#isReadOnly(int)
+   */
+
+  public boolean isReadOnly(int column) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSetMetaData#isSearchable(int)
+   */
+
+  public boolean isSearchable(int column) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSetMetaData#isSigned(int)
+   */
+
+  public boolean isSigned(int column) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.ResultSetMetaData#isWritable(int)
+   */
+
+  public boolean isWritable(int column) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Wrapper#isWrapperFor(java.lang.Class)
+   */
+
+  public boolean isWrapperFor(Class<?> iface) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Wrapper#unwrap(java.lang.Class)
+   */
+
+  public <T> T unwrap(Class<T> iface) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+}

Added: hadoop/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveStatement.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveStatement.java?rev=731809&view=auto
==============================================================================
--- hadoop/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveStatement.java (added)
+++ hadoop/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveStatement.java Mon Jan  5 18:06:20 2009
@@ -0,0 +1,414 @@
+/**
+ *
+ */
+package org.apache.hadoop.hive.jdbc;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.SQLWarning;
+import java.util.Vector;
+import org.apache.hadoop.hive.service.HiveInterface;
+
+public class HiveStatement implements java.sql.Statement {
+  JdbcSessionState session;
+  HiveInterface client;
+  /**
+   *
+   */
+  public HiveStatement(JdbcSessionState session, HiveInterface client) {
+    this.session = session;
+    this.client = client;
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#addBatch(java.lang.String)
+   */
+
+  public void addBatch(String sql) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#cancel()
+   */
+
+  public void cancel() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#clearBatch()
+   */
+
+  public void clearBatch() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#clearWarnings()
+   */
+
+  public void clearWarnings() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#close()
+   */
+
+  public void close() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#execute(java.lang.String)
+   */
+
+  public boolean execute(String sql) throws SQLException {
+    return true;
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#execute(java.lang.String, int)
+   */
+
+  public boolean execute(String sql, int autoGeneratedKeys)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#execute(java.lang.String, int[])
+   */
+
+  public boolean execute(String sql, int[] columnIndexes) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#execute(java.lang.String, java.lang.String[])
+   */
+
+  public boolean execute(String sql, String[] columnNames)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#executeBatch()
+   */
+
+  public int[] executeBatch() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#executeQuery(java.lang.String)
+   */
+
+  public ResultSet executeQuery(String sql) throws SQLException {
+    try {
+      client.execute(sql);
+    } catch (Exception ex) {
+      throw new SQLException(ex.toString());
+    }
+    return new HiveResultSet(client);
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#executeUpdate(java.lang.String)
+   */
+
+  public int executeUpdate(String sql) throws SQLException {
+    try {
+      client.execute(sql);
+    } catch (Exception ex) {
+      throw new SQLException(ex.toString());
+    }
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#executeUpdate(java.lang.String, int)
+   */
+
+  public int executeUpdate(String sql, int autoGeneratedKeys)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#executeUpdate(java.lang.String, int[])
+   */
+
+  public int executeUpdate(String sql, int[] columnIndexes)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#executeUpdate(java.lang.String, java.lang.String[])
+   */
+
+  public int executeUpdate(String sql, String[] columnNames)
+      throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#getConnection()
+   */
+
+  public Connection getConnection() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#getFetchDirection()
+   */
+
+  public int getFetchDirection() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#getFetchSize()
+   */
+
+  public int getFetchSize() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#getGeneratedKeys()
+   */
+
+  public ResultSet getGeneratedKeys() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#getMaxFieldSize()
+   */
+
+  public int getMaxFieldSize() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#getMaxRows()
+   */
+
+  public int getMaxRows() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#getMoreResults()
+   */
+
+  public boolean getMoreResults() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#getMoreResults(int)
+   */
+
+  public boolean getMoreResults(int current) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#getQueryTimeout()
+   */
+
+  public int getQueryTimeout() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#getResultSet()
+   */
+
+  public ResultSet getResultSet() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#getResultSetConcurrency()
+   */
+
+  public int getResultSetConcurrency() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#getResultSetHoldability()
+   */
+
+  public int getResultSetHoldability() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#getResultSetType()
+   */
+
+  public int getResultSetType() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#getUpdateCount()
+   */
+
+  public int getUpdateCount() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#getWarnings()
+   */
+
+  public SQLWarning getWarnings() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#isClosed()
+   */
+
+  public boolean isClosed() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#isPoolable()
+   */
+
+  public boolean isPoolable() throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#setCursorName(java.lang.String)
+   */
+
+  public void setCursorName(String name) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#setEscapeProcessing(boolean)
+   */
+
+  public void setEscapeProcessing(boolean enable) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#setFetchDirection(int)
+   */
+
+  public void setFetchDirection(int direction) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#setFetchSize(int)
+   */
+
+  public void setFetchSize(int rows) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#setMaxFieldSize(int)
+   */
+
+  public void setMaxFieldSize(int max) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#setMaxRows(int)
+   */
+
+  public void setMaxRows(int max) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#setPoolable(boolean)
+   */
+
+  public void setPoolable(boolean poolable) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Statement#setQueryTimeout(int)
+   */
+
+  public void setQueryTimeout(int seconds) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Wrapper#isWrapperFor(java.lang.Class)
+   */
+
+  public boolean isWrapperFor(Class<?> iface) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+  /* (non-Javadoc)
+   * @see java.sql.Wrapper#unwrap(java.lang.Class)
+   */
+
+  public <T> T unwrap(Class<T> iface) throws SQLException {
+    // TODO Auto-generated method stub
+    throw new SQLException("Method not supported");
+  }
+
+}

Added: hadoop/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/JdbcSessionState.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/JdbcSessionState.java?rev=731809&view=auto
==============================================================================
--- hadoop/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/JdbcSessionState.java (added)
+++ hadoop/hive/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/JdbcSessionState.java Mon Jan  5 18:06:20 2009
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hive.jdbc;
+
+import org.apache.hadoop.hive.ql.session.SessionState;
+import org.apache.hadoop.hive.conf.HiveConf;
+import org.apache.hadoop.hive.ql.metadata.Hive;
+
+public class JdbcSessionState extends SessionState {
+
+  public JdbcSessionState() {
+    super();
+  }
+
+  public JdbcSessionState (HiveConf conf) {
+    super(conf);
+  }
+
+  public JdbcSessionState (HiveConf conf, Hive db) {
+    super(conf, db);
+  }
+}

Added: hadoop/hive/trunk/jdbc/src/test/org/apache/hadoop/hive/jdbc/TestJdbcDriver.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/jdbc/src/test/org/apache/hadoop/hive/jdbc/TestJdbcDriver.java?rev=731809&view=auto
==============================================================================
--- hadoop/hive/trunk/jdbc/src/test/org/apache/hadoop/hive/jdbc/TestJdbcDriver.java (added)
+++ hadoop/hive/trunk/jdbc/src/test/org/apache/hadoop/hive/jdbc/TestJdbcDriver.java Mon Jan  5 18:06:20 2009
@@ -0,0 +1,127 @@
+package org.apache.hadoop.hive.jdbc;
+
+import java.sql.SQLException;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.Statement;
+import java.sql.Driver;
+import java.sql.DriverManager;
+import java.util.Properties;
+import junit.framework.TestCase;
+import javax.naming.*;
+import javax.naming.directory.*;
+import javax.sql.DataSource;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.util.StringUtils;
+import org.apache.hadoop.hive.conf.HiveConf;
+
+public class TestJdbcDriver extends TestCase {
+  private static String driverName = "org.apache.hadoop.hive.jdbc.HiveDriver";
+  private static String tableName = "testHiveDriverTable";
+  private HiveConf conf;
+  private Path dataFilePath;
+  private Connection con;
+  private boolean standAloneServer = false;
+
+  public TestJdbcDriver(String name) {
+    super(name);
+    conf = new HiveConf(TestJdbcDriver.class);
+    String dataFileDir = conf.get("test.data.files").replace('\\', '/').replace("c:", "");
+    dataFilePath = new Path(dataFileDir, "kv1.txt");
+    //standAloneServer = System.getProperty("test.service.standalone.server").equals("true");
+  }
+
+  protected void setUp() throws Exception {
+    super.setUp();
+    Class.forName(driverName);
+    if (standAloneServer) {
+      // get connection
+      con = DriverManager.getConnection("jdbc:hive://localhost:10000/default", "", "");
+    }
+    else {
+      con = DriverManager.getConnection("jdbc:hive://", "", "");
+    }
+    assertNotNull("Connection is null", con);
+    Statement stmt = con.createStatement();
+    assertNotNull("Statement is null", stmt);
+
+    // drop table. ignore error.
+    try {
+      stmt.executeQuery("drop table " + tableName);
+    } catch (Exception ex) {
+    }
+
+    // create table
+    ResultSet res = stmt.executeQuery("create table " + tableName + " (key int, value string)");
+    assertFalse(res.next());
+//    res = stmt.executeQuery("describe " + tableName);
+//    while (res.next()) {
+//      System.out.println(res.getString(1));
+//    }
+
+    // load data
+    res = stmt.executeQuery("load data local inpath '" + dataFilePath.toString() + "' into table " + tableName);
+    assertFalse(res.next());
+
+  }
+
+  protected void tearDown() throws Exception {
+    super.tearDown();
+
+    // drop table
+    Statement stmt = con.createStatement();
+    assertNotNull("Statement is null", stmt);
+    ResultSet res = stmt.executeQuery("drop table " + tableName);
+    assertFalse(res.next());
+
+  }
+
+  public final void testHiveDriver() throws Exception {
+    Statement stmt = con.createStatement();
+    assertNotNull("Statement is null", stmt);
+
+    ResultSet res;
+
+    // TODO: There is no schema for show tables or describe table.
+    /*
+    stmt.executeQuery("drop table michi1");
+    stmt.executeQuery("drop table michi2");
+    stmt.executeQuery("drop table michi3");
+    stmt.executeQuery("create table michi1 (num int)");
+    stmt.executeQuery("create table michi2 (num int)");
+    stmt.executeQuery("create table michi3 (num int)");
+
+    res = stmt.executeQuery("show tables");
+    res = stmt.executeQuery("describe michi1");
+    while (res.next()) {
+      System.out.println(res.getString(0));
+    }
+    */
+
+    // run some queries
+    res = stmt.executeQuery("select * from " + tableName);
+    assertNotNull("ResultSet is null", res);
+    int i = 0;
+
+    while (res.next()) {
+      try {
+        i++;
+        res.getString(2);
+        res.getString(1);
+        res.getInt(1);
+        // TODO add assert
+//      System.out.println(res.getString(2));
+//      System.out.println(res.getString(1));
+//      System.out.println(res.getInt(1));
+      }
+      catch (SQLException e) {
+        System.out.println(e.toString());
+        e.printStackTrace();
+        throw new Exception(e.toString());
+      }
+    }
+    // supposed to get 500 rows
+    assertEquals(500, i);
+  }
+}

Modified: hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/Driver.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/Driver.java?rev=731809&r1=731808&r2=731809&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/Driver.java (original)
+++ hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/Driver.java Mon Jan  5 18:06:20 2009
@@ -84,10 +84,7 @@
       FetchTask ft = (FetchTask)sem.getFetchTask();
 
       tableDesc td = ft.getTblDesc();
-      String tableName = td.getTableName();
-      if (tableName == null) {
-        tableName = "result";
-      }
+      String tableName = "result";
       List<FieldSchema> lst = MetaStoreUtils.getFieldsFromDeserializer(tableName, td.getDeserializer());
       String schema = MetaStoreUtils.getDDLFromFieldSchema(tableName, lst);
       return schema;



Mime
View raw message