org.apache.oozie.util.db
Class SqlStatement.ResultSetReader

java.lang.Object
  extended by org.apache.oozie.util.db.SqlStatement.ResultSetReader
Enclosing class:
SqlStatement

public static class SqlStatement.ResultSetReader
extends Object

ResultSetReader is used to parse the result set and gives methods for getting appropriate type of data given the column name


Method Summary
 void close()
          Close the Result Set
<T> T
get(Class<T> clazz, Schema.Column col)
          Get the Column data given its type and name
 Boolean getBoolean(Schema.Column col)
          Get the Boolean Column
 byte[] getByteArray(Schema.Column col)
          Get the data for columns with blob type
 Long getLong(Schema.Column col)
          Get the Numeric data
 String getString(Schema.Column col)
          Get a String Column
 Timestamp getTimestamp(Schema.Column col)
          Get the Timestamp Column
 boolean next()
          Move the Result Set to next record
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

next

public boolean next()
             throws SQLException
Move the Result Set to next record

Returns:
true if there is a next record
Throws:
SQLException

close

public void close()
           throws SQLException
Close the Result Set

Throws:
SQLException

get

public <T> T get(Class<T> clazz,
                 Schema.Column col)
      throws SQLException
Get the Column data given its type and name

Type Parameters:
T - Type of the column
Parameters:
clazz - Class of the Type
col - Column name
Returns:
Column data
Throws:
SQLException

getByteArray

public byte[] getByteArray(Schema.Column col)
                    throws SQLException
Get the data for columns with blob type

Parameters:
col - Column name
Returns:
Column data
Throws:
SQLException

getString

public String getString(Schema.Column col)
                 throws SQLException
Get a String Column

Parameters:
col - Column Name
Returns:
Column data
Throws:
SQLException

getTimestamp

public Timestamp getTimestamp(Schema.Column col)
                       throws SQLException
Get the Timestamp Column

Parameters:
col - Column name
Returns:
Column data
Throws:
SQLException

getBoolean

public Boolean getBoolean(Schema.Column col)
                   throws SQLException
Get the Boolean Column

Parameters:
col - Column name
Returns:
Column data
Throws:
SQLException

getLong

public Long getLong(Schema.Column col)
             throws SQLException
Get the Numeric data

Parameters:
col - Column name
Returns:
Column data
Throws:
SQLException


Copyright © 2013 Apache Software Foundation. All Rights Reserved.