Package com.alachisoft.ncache.client
Interface CacheReader
-
- All Superinterfaces:
java.lang.AutoCloseable
public interface CacheReader extends java.lang.AutoCloseableReads 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.BigDecimalgetBigDecimal(int index)Gets value of a specified index as decimal.booleangetBoolean(int index)Gets value of specified index as bool.java.util.DategetDate(int index)Returns date at specified column index.doublegetDouble(int index)Gets value of specified index as double.intgetFieldCount()Gets number of columns.intgetInt(int index)Gets value of specified index as integer.booleangetIsClosed()True, if reader is closed, else false.longgetLong(int index)Gets value of specified index as long.java.lang.StringgetName(int index)Returns name of a specified column index.intgetOrdinal(java.lang.String columnName)Returns index of a specified column name.shortgetShort(int index)Gets value of specified index as short.java.lang.StringgetString(int index)Gets value of specified index as string.<T> TgetValue(int index, java.lang.Class<?> cls)Gets value at specified column index.<T> TgetValue(java.lang.String columnName, java.lang.Class<?> cls)Gets value of specified column name.intgetValues(java.lang.Object[] objects, java.lang.Class<?> cls)Populates array of objects with values in current row.booleanread()Advances CacheReader to the 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 CacheExceptionAdvances CacheReader to the next record.- Returns:
- True if there are more rows; else false.
- Throws:
CacheException
-
getBoolean
boolean getBoolean(int index) throws OperationFailedExceptionGets value of specified index as bool.- Parameters:
index- Index of a column.- Returns:
- Bool value on a specified index.
- Throws:
OperationFailedException
-
getString
java.lang.String getString(int index) throws OperationFailedExceptionGets value of specified index as string.- Parameters:
index- Index of a column.- Returns:
- String value on a specified column.
- Throws:
OperationFailedException
-
getBigDecimal
java.math.BigDecimal getBigDecimal(int index) throws OperationFailedExceptionGets value of a specified index as decimal.- Parameters:
index- Index of a column.- Returns:
- Decimal value on a specified index.
- Throws:
OperationFailedException
-
getDouble
double getDouble(int index) throws OperationFailedExceptionGets value of specified index as double.- Parameters:
index- Index of a column.- Returns:
- Double value on a specified index.
- Throws:
OperationFailedException
-
getShort
short getShort(int index) throws OperationFailedExceptionGets value of specified index as short.- Parameters:
index- Index of a column.- Returns:
- Short value on a specified index.
- Throws:
OperationFailedException
-
getInt
int getInt(int index) throws OperationFailedExceptionGets value of specified index as integer.- Parameters:
index- Index of a column.- Returns:
- Integer value on a specified index.
- Throws:
OperationFailedException
-
getLong
long getLong(int index) throws OperationFailedExceptionGets value of specified index as long.- Parameters:
index- Index of a column.- Returns:
- Long value on a specified index.
- Throws:
OperationFailedException
-
getValue
<T> T getValue(int index, java.lang.Class<?> cls) throws java.io.IOException, java.lang.ClassNotFoundException, OperationFailedExceptionGets value at specified column index.- Type Parameters:
T- Object value on a specified index.- Parameters:
index- Index of a column.cls- Specifies the class of value obtained from the cache.- Returns:
- Object value on a specified index.
- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundExceptionOperationFailedException
-
getValue
<T> T getValue(java.lang.String columnName, java.lang.Class<?> cls) throws java.io.IOException, java.lang.ClassNotFoundException, OperationFailedExceptionGets value of specified column name.- Parameters:
columnName- Name of a column.cls- Specifies the class of value obtained from the cache.- Returns:
- Object value of a specified column.
- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundExceptionOperationFailedException
-
getValues
int getValues(java.lang.Object[] objects, java.lang.Class<?> cls) throws java.io.IOException, java.lang.ClassNotFoundException, OperationFailedExceptionPopulates 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:
- Number of objects copied in a specified array.
- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundExceptionOperationFailedException
-
getName
java.lang.String getName(int index)
Returns name of a specified column index.- Parameters:
index- Index of a column.- Returns:
- Name of a column.
-
getOrdinal
int getOrdinal(java.lang.String columnName)
Returns index of a specified column name.- Parameters:
columnName- Name of a column.- Returns:
- Index of a column.
-
getDate
java.util.Date getDate(int index) throws OperationFailedExceptionReturns date at specified column index.- Parameters:
index- Index of column.- Returns:
- Date at the specified index.
- Throws:
OperationFailedException
-
-