org.apache.lens.driver.jdbc
Class JDBCResultSet

java.lang.Object
  extended by org.apache.lens.server.api.driver.LensResultSet
      extended by org.apache.lens.server.api.driver.InMemoryResultSet
          extended by org.apache.lens.driver.jdbc.JDBCResultSet

public class JDBCResultSet
extends InMemoryResultSet

The Class JDBCResultSet.


Nested Class Summary
static class JDBCResultSet.FieldSchemaData
          FieldSchemaData is created so that we don't save FieldSchema as some classes used by it don't have default constructors which are required by jackson
static class JDBCResultSet.JDBCResultSetMetadata
          Result set metadata of a JDBC query
 
Field Summary
static org.apache.log4j.Logger LOG
          The Constant LOG.
 
Constructor Summary
JDBCResultSet(org.apache.lens.driver.jdbc.JDBCDriver.QueryResult queryResult, ResultSet resultSet, boolean closeAfterFetch)
          Instantiates a new JDBC result set.
 
Method Summary
 void close()
          Close.
static String getHiveTypeForSQLType(int index, ResultSetMetaData rsmeta)
          Gets the hive type for sql type.
 LensResultSetMetadata getMetadata()
          Get the result set metadata
 boolean hasNext()
          Whether there is another result row available.
 ResultRow next()
          Read the next result row.
 void setFetchSize(int size)
          Set number of rows to be fetched at time
 int size()
          Get the size of the result set.
 
Methods inherited from class org.apache.lens.server.api.driver.InMemoryResultSet
toQueryResult
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.log4j.Logger LOG
The Constant LOG.

Constructor Detail

JDBCResultSet

public JDBCResultSet(org.apache.lens.driver.jdbc.JDBCDriver.QueryResult queryResult,
                     ResultSet resultSet,
                     boolean closeAfterFetch)
Instantiates a new JDBC result set.

Parameters:
queryResult - the query result
resultSet - the result set
closeAfterFetch - the close after fetch
Method Detail

size

public int size()
         throws LensException
Description copied from class: LensResultSet
Get the size of the result set.

Specified by:
size in class LensResultSet
Returns:
The size if available, -1 if not available.
Throws:
LensException - the lens exception

getMetadata

public LensResultSetMetadata getMetadata()
                                  throws LensException
Description copied from class: LensResultSet
Get the result set metadata

Specified by:
getMetadata in class LensResultSet
Returns:
Returns LensResultSetMetadata
Throws:
LensException

getHiveTypeForSQLType

public static String getHiveTypeForSQLType(int index,
                                           ResultSetMetaData rsmeta)
                                    throws SQLException
Gets the hive type for sql type.

Parameters:
index - the index
rsmeta - the rsmeta
Returns:
the hive type for sql type
Throws:
SQLException - the SQL exception

setFetchSize

public void setFetchSize(int size)
                  throws LensException
Description copied from class: InMemoryResultSet
Set number of rows to be fetched at time

Specified by:
setFetchSize in class InMemoryResultSet
Throws:
LensException

next

public ResultRow next()
               throws LensException
Description copied from class: InMemoryResultSet
Read the next result row.

Specified by:
next in class InMemoryResultSet
Returns:
The row as list of object
Throws:
LensException - the lens exception

hasNext

public boolean hasNext()
                throws LensException
Description copied from class: InMemoryResultSet
Whether there is another result row available.

Specified by:
hasNext in class InMemoryResultSet
Returns:
true if next row if available, false otherwise
Throws:
LensException - the lens exception

close

public void close()
Close.



Copyright © 2014–2015 Apache Software Foundation. All rights reserved.