Package com.alachisoft.ncache.client
Interface CacheReader
-
- All Superinterfaces:
java.lang.AutoCloseable
public interface CacheReader extends java.lang.AutoCloseable
Reads one or more than forward-only stream of result sets by executing OQ commands on cache source.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.math.BigDecimal
getBigDecimal(int index)
Gets value of specified index as decimal.boolean
getBoolean(int index)
Gets value of specified index as bool.java.util.Date
getDate(int index)
Returns Date at specified column indexdouble
getDouble(int index)
Gets value of specified index as double.int
getFieldCount()
Gets number of columns.int
getInt(int index)
Gets value of specified index as integer.boolean
getIsClosed()
True, if reader is closed else false.long
getLong(int index)
Gets value of specified index as long.java.lang.String
getName(int index)
Returns name of specified column index.int
getOrdinal(java.lang.String columnName)
Returns index of specified column name.short
getShort(int index)
Gets value of specified index as short.java.lang.String
getString(int index)
Gets value of specified index as string.<T> T
getValue(int index, java.lang.Class<?> cls)
Gets value at specified column index.<T> T
getValue(java.lang.String columnName, java.lang.Class<?> cls)
Gets value of specified column name.int
getValues(java.lang.Object[] objects, java.lang.Class<?> cls)
Populates array of objects with values in current row.boolean
read()
Advances ICacheReader to next record.
-
-
-
Method Detail
-
getFieldCount
int getFieldCount()
Gets number of columns.
-
getIsClosed
boolean getIsClosed()
True, if reader is closed else false.
-
read
boolean read() throws CacheException
Advances ICacheReader to next record.- Returns:
- true if there are more rows; else false.
- Throws:
CacheException
-
getBoolean
boolean getBoolean(int index) throws OperationFailedException
Gets value of specified index as bool.- Parameters:
index
- Index of column.- Returns:
- bool value on specified index.
- Throws:
OperationFailedException
-
getString
java.lang.String getString(int index) throws OperationFailedException
Gets value of specified index as string.- Parameters:
index
- Index of column.- Returns:
- string value on specified column.
- Throws:
OperationFailedException
-
getBigDecimal
java.math.BigDecimal getBigDecimal(int index) throws OperationFailedException
Gets value of specified index as decimal.- Parameters:
index
- Index of column.- Returns:
- decimal value on specified index.
- Throws:
OperationFailedException
-
getDouble
double getDouble(int index) throws OperationFailedException
Gets value of specified index as double.- Parameters:
index
- Index of column.- Returns:
- double value on specified index.
- Throws:
OperationFailedException
-
getShort
short getShort(int index) throws OperationFailedException
Gets value of specified index as short.- Parameters:
index
- Index of column.- Returns:
- short value on specified index.
- Throws:
OperationFailedException
-
getInt
int getInt(int index) throws OperationFailedException
Gets value of specified index as integer.- Parameters:
index
- Index of column.- Returns:
- integer value on specified index.
- Throws:
OperationFailedException
-
getLong
long getLong(int index) throws OperationFailedException
Gets value of specified index as long.- Parameters:
index
- Index of column.- Returns:
- long value on specified index.
- Throws:
OperationFailedException
-
getValue
<T> T getValue(int index, java.lang.Class<?> cls) throws java.io.IOException, java.lang.ClassNotFoundException, OperationFailedException
Gets value at specified column index.- Type Parameters:
T
- get generic type value at specified column index.- Parameters:
index
- Index of column.cls
- Specifies the class of value obtained from the cache.- Returns:
- Object value on specified index.
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
OperationFailedException
-
getValue
<T> T getValue(java.lang.String columnName, java.lang.Class<?> cls) throws java.io.IOException, java.lang.ClassNotFoundException, OperationFailedException
Gets value of specified column name.- Parameters:
columnName
- Name of column.cls
- Specifies the class of value obtained from the cache.- Returns:
- Object value of specified column.
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
OperationFailedException
-
getValues
int getValues(java.lang.Object[] objects, java.lang.Class<?> cls) throws java.io.IOException, java.lang.ClassNotFoundException, OperationFailedException
Populates array of objects with values in current row.- Parameters:
objects
- array of objects to be populated.cls
- Specifies the class of values obtained from the array.- Returns:
- No of objects copied in specified array.
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
OperationFailedException
-
getName
java.lang.String getName(int index)
Returns name of specified column index.- Parameters:
index
- Index of column.- Returns:
- Name of column.
-
getOrdinal
int getOrdinal(java.lang.String columnName)
Returns index of specified column name.- Parameters:
columnName
- Name of column.- Returns:
- Index of column.
-
getDate
java.util.Date getDate(int index) throws OperationFailedException
Returns Date at specified column index- Parameters:
index
- Index of Column.- Returns:
- Date at the specified index.
- Throws:
OperationFailedException
-
-