Class QueryResultSet
java.lang.Object
nl.cwi.monetdb.embedded.env.AbstractConnectionResult
nl.cwi.monetdb.embedded.resultset.QueryResultSet
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterable
- Direct Known Subclasses:
PreparedQueryResultSet
public class QueryResultSet extends AbstractConnectionResult implements Iterable
Embedded MonetDB query result. The query result columns are eagerly copied from the native code to Java.
- Author:
- Pedro Ferreira
-
Method Summary
Modifier and Type Method Description booleancheckBooleanIsNull(int column, int row)Tests if a boolean in the result set is a null value.voidclose()Close the result set.protected voidcloseResultImplementation()Close the result set internally.QueryResultRowSetfetchAllRowValues()Fetches all rows from the result set.QueryResultRowSetfetchFirstNRowValues(int n)Fetches the first N rows from the result set.QueryResultRowSetfetchResultSetRows(int startIndex, int endIndex)Fetch rows from the result set.byte[]getBlobByColumnIndexAndRow(int column, int row)Retrieves a single byte[] value (BLOB) in the result set.byte[]getBlobByColumnNameAndRow(String columnName, int row)Retrieves a single byte[] (BLOB) value in the result set by name.voidgetBlobColumnByIndex(int column, byte[][] input)Retrieves a byte[] (BLOB) column by index.voidgetBlobColumnByIndex(int column, byte[][] input, int offset, int length)Retrieves a byte[] (BLOB) column by index.voidgetBlobColumnByName(String columnName, byte[][] input)Retrieves a byte[] (BLOB) column by name.voidgetBlobColumnByName(String columnName, byte[][] input, int offset, int length)Retrieves a byte[] (BLOB) column by name.booleangetBooleanByColumnIndexAndRow(int column, int row)Retrieves a single boolean value in the result set.booleangetBooleanByColumnNameAndRow(String columnName, int row)Retrieves a single boolean value in the result set by name.voidgetBooleanColumnByIndex(int column, boolean[] input)Retrieves a boolean column by index.voidgetBooleanColumnByIndex(int column, boolean[] input, int offset, int length)Retrieves a boolean column by index.voidgetBooleanColumnByName(String columnName, boolean[] input)Retrieves a boolean column by name.voidgetBooleanColumnByName(String columnName, boolean[] input, int offset, int length)Retrieves a boolean column by name.bytegetByteByColumnIndexAndRow(int column, int row)Retrieves a single byte value in the result set.bytegetByteByColumnNameAndRow(String columnName, int row)Retrieves a single byte value in the result set by name.voidgetByteColumnByIndex(int column, byte[] input)Retrieves a byte column by index.voidgetByteColumnByIndex(int column, byte[] input, int offset, int length)Retrieves a byte column by index.voidgetByteColumnByName(String columnName, byte[] input)Retrieves a byte column by name.voidgetByteColumnByName(String columnName, byte[] input, int offset, int length)Retrieves a byte column by name.voidgetColumnDigits(int[] input)Gets the column digits as an integer array.intgetColumnIndexByName(String columnName)Gets a column index from the result set by namevoidgetColumnNames(String[] input)Gets the columns names as a string array.voidgetColumnNullMappingsByIndex(int column, boolean[] input)Gets the null mapping of a column by index.voidgetColumnScales(int[] input)Gets the column scales as an integer array.voidgetColumnTypes(String[] input)Gets the columns types as a string array.DategetDateByColumnIndexAndRow(int column, int row)Retrieves a single Date value in the result set.DategetDateByColumnNameAndRow(String columnName, int row)Retrieves a single Date value in the result set by name.voidgetDateColumnByIndex(int column, Date[] input)Retrieves a Date column by index.voidgetDateColumnByIndex(int column, Date[] input, int offset, int length)Retrieves a Date column by index.voidgetDateColumnByName(String columnName, Date[] input)Retrieves a Date column by name.voidgetDateColumnByName(String columnName, Date[] input, int offset, int length)Retrieves a Date column by name.BigDecimalgetDecimalByColumnIndexAndRow(int column, int row)Retrieves a single BigDecimal value in the result set.BigDecimalgetDecimalByColumnNameAndRow(String columnName, int row)Retrieves a single decimal value in the result set by name.voidgetDecimalColumnByIndex(int column, BigDecimal[] input)Retrieves a BigDecimal column by index.voidgetDecimalColumnByIndex(int column, BigDecimal[] input, int offset, int length)Retrieves a BigDecimal column by index.voidgetDecimalColumnByName(String columnName, BigDecimal[] input)Retrieves an BigDecimal column by name.voidgetDecimalColumnByName(String columnName, BigDecimal[] input, int offset, int length)Retrieves a BigDecimal column by name.doublegetDoubleByColumnIndexAndRow(int column, int row)Retrieves a single double value in the result set.doublegetDoubleByColumnNameAndRow(String columnName, int row)Retrieves a single double value in the result set by name.voidgetDoubleColumnByIndex(int column, double[] input)Retrieves a double column by index.voidgetDoubleColumnByIndex(int column, double[] input, int offset, int length)Retrieves a double column by index.voidgetDoubleColumnByName(String columnName, double[] input)Retrieves a double column by name.voidgetDoubleColumnByName(String columnName, double[] input, int offset, int length)Retrieves a double column by name.floatgetFloatByColumnIndexAndRow(int column, int row)Retrieves a single float value in the result set.floatgetFloatByColumnNameAndRow(String columnName, int row)Retrieves a single float value in the result set by name.voidgetFloatColumnByIndex(int column, float[] input)Retrieves a float column by index.voidgetFloatColumnByIndex(int column, float[] input, int offset, int length)Retrieves a float column by index.voidgetFloatColumnByName(String columnName, float[] input)Retrieves a float column by name.voidgetFloatColumnByName(String columnName, float[] input, int offset, int length)Retrieves a float column by name.voidgetIntColumnByIndex(int column, int[] input)Retrieves an integer column by index.voidgetIntColumnByIndex(int column, int[] input, int offset, int length)Retrieves an integer column by index.voidgetIntColumnByName(String columnName, int[] input)Retrieves an integer column by name.voidgetIntColumnByName(String columnName, int[] input, int offset, int length)Retrieves an integer column by name.intgetIntegerByColumnIndexAndRow(int column, int row)Retrieves a single integer value in the result set.intgetIntegerByColumnNameAndRow(String columnName, int row)Retrieves a single integer value in the result set by name.longgetLongByColumnIndexAndRow(int column, int row)Retrieves a single long value in the result set.longgetLongByColumnNameAndRow(String columnName, int row)Retrieves a single long value in the result set by name.voidgetLongColumnByIndex(int column, long[] input)Retrieves a long column by index.voidgetLongColumnByIndex(int column, long[] input, int offset, int length)Retrieves a long column by index.voidgetLongColumnByName(String columnName, long[] input)Retrieves a long column by name.voidgetLongColumnByName(String columnName, long[] input, int offset, int length)Retrieves a long column by name.voidgetMappings(MonetDBToJavaMapping[] input)Gets the Java mappings as a MonetDBToJavaMapping array.voidgetNullMappingByName(String columnName, boolean[] input)Gets the null mapping of a column by nameintgetNumberOfColumns()Returns the number of columns in the result set.intgetNumberOfRows()Returns the number of rows in the result set.StringgetOidByColumnIndexAndRow(int column, int row)Retrieves a single oid value in the result set.StringgetOidByColumnNameAndRow(String columnName, int row)Retrieves a single oid value in the result set by name.voidgetOidColumnByIndex(int column, String[] input)Retrieves an oid column by index.voidgetOidColumnByIndex(int column, String[] input, int offset, int length)Retrieves an oid column by index.voidgetOidColumnByName(String columnName, String[] input)Retrieves an oid column by name.voidgetOidColumnByName(String columnName, String[] input, int offset, int length)Retrieves an oid column by name.shortgetShortByColumnIndexAndRow(int column, int row)Retrieves a single short value in the result set.shortgetShortByColumnNameAndRow(String columnName, int row)Retrieves a single short value in the result set by name.voidgetShortColumnByIndex(int column, short[] input)Retrieves a short column by index.voidgetShortColumnByIndex(int column, short[] input, int offset, int length)Retrieves a short column by index.voidgetShortColumnByName(String columnName, short[] input)Retrieves a short column by name.voidgetShortColumnByName(String columnName, short[] input, int offset, int length)Retrieves a short column by name.StringgetStringByColumnIndexAndRow(int column, int row)Retrieves a single String value in the result set.StringgetStringByColumnNameAndRow(String columnName, int row)Retrieves a single String value in the result set by name.voidgetStringColumnByIndex(int column, String[] input)Retrieves a String column by index.voidgetStringColumnByIndex(int column, String[] input, int offset, int length)Retrieves a String column by index.voidgetStringColumnByName(String columnName, String[] input)Retrieves a String column by name.voidgetStringColumnByName(String columnName, String[] input, int offset, int length)Retrieves a String column by name.TimegetTimeByColumnIndexAndRow(int column, int row)Retrieves a single Time value in the result set.TimegetTimeByColumnNameAndRow(String columnName, int row)Retrieves a single Time value in the result set by name.voidgetTimeColumnByIndex(int column, Time[] input)Retrieves a Time column by index.voidgetTimeColumnByIndex(int column, Time[] input, int offset, int length)Retrieves a Time column by index.voidgetTimeColumnByName(String columnName, Time[] input)Retrieves a Time column by name.voidgetTimeColumnByName(String columnName, Time[] input, int offset, int length)Retrieves a Time column by name.TimestampgetTimestampByColumnIndexAndRow(int column, int row)Retrieves a single Timestamp value in the result set.TimestampgetTimestampByColumnNameAndRow(String columnName, int row)Retrieves a single Timestamp value in the result set by name.voidgetTimestampColumnByIndex(int column, Timestamp[] input)Retrieves a Timestamp column by index.voidgetTimestampColumnByIndex(int column, Timestamp[] input, int offset, int length)Retrieves a Timestamp column by index.voidgetTimestampColumnByName(String columnName, Timestamp[] input)Retrieves a Timestamp column by name.voidgetTimestampColumnByName(String columnName, Timestamp[] input, int offset, int length)Retrieves a Timestamp column by name.booleanisQueryResultSetClosed()Tells if the connection of this statement result has been closed or not.ListIterator<MonetDBRow>iterator()voidmapColumnToObjectByIndex(int column, Object[] input)Maps a column to a Java Object representation of the array by index.voidmapColumnToObjectByName(String columnName, Object[] input)Maps a column to a Java Object representation of the array by name.Methods inherited from class nl.cwi.monetdb.embedded.env.AbstractConnectionResult
checkMetadataArrayLength, getConnection, getRandomIdentifier
-
Method Details
-
isQueryResultSetClosed
public boolean isQueryResultSetClosed()Tells if the connection of this statement result has been closed or not.- Returns:
- A boolean indicating if the statement result has been cleaned or not
-
getNumberOfRows
public int getNumberOfRows()Description copied from class:AbstractConnectionResultReturns the number of rows in the result set.- Specified by:
getNumberOfRowsin classAbstractConnectionResult- Returns:
- Number of rows
-
getNumberOfColumns
public int getNumberOfColumns()Description copied from class:AbstractConnectionResultReturns the number of columns in the result set.- Specified by:
getNumberOfColumnsin classAbstractConnectionResult- Returns:
- Number of columns
-
getColumnNames
Description copied from class:AbstractConnectionResultGets the columns names as a string array.- Specified by:
getColumnNamesin classAbstractConnectionResult- Parameters:
input- The columns names array to fill.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getColumnTypes
Description copied from class:AbstractConnectionResultGets the columns types as a string array.- Specified by:
getColumnTypesin classAbstractConnectionResult- Parameters:
input- The columns types array to fill.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getMappings
Description copied from class:AbstractConnectionResultGets the Java mappings as a MonetDBToJavaMapping array.- Specified by:
getMappingsin classAbstractConnectionResult- Parameters:
input- The columns mappings array to fill.- Throws:
MonetDBEmbeddedException- If an error in the database occurred..
-
getColumnDigits
Description copied from class:AbstractConnectionResultGets the column digits as an integer array.- Specified by:
getColumnDigitsin classAbstractConnectionResult- Parameters:
input- The columns digits array to fill.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getColumnScales
Description copied from class:AbstractConnectionResultGets the column scales as an integer array.- Specified by:
getColumnScalesin classAbstractConnectionResult- Parameters:
input- The columns scales array to fill.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getColumnIndexByName
Gets a column index from the result set by name- Parameters:
columnName- AbstractQueryResultSetColumn name- Returns:
- The index number
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getBooleanByColumnIndexAndRow
Retrieves a single boolean value in the result set.- Parameters:
column- The column index starting from 1row- The row index starting from 1- Returns:
- The boolean value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getByteByColumnIndexAndRow
Retrieves a single byte value in the result set.- Parameters:
column- The column index starting from 1row- The row index starting from 1- Returns:
- The byte value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getShortByColumnIndexAndRow
Retrieves a single short value in the result set.- Parameters:
column- The column index starting from 1row- The row index starting from 1- Returns:
- The short value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getIntegerByColumnIndexAndRow
Retrieves a single integer value in the result set.- Parameters:
column- The column index starting from 1row- The row index starting from 1- Returns:
- The integer value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getLongByColumnIndexAndRow
Retrieves a single long value in the result set.- Parameters:
column- The column index starting from 1row- The row index starting from 1- Returns:
- The long value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getFloatByColumnIndexAndRow
Retrieves a single float value in the result set.- Parameters:
column- The column index starting from 1row- The row index starting from 1- Returns:
- The float value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getDoubleByColumnIndexAndRow
Retrieves a single double value in the result set.- Parameters:
column- The column index starting from 1row- The row index starting from 1- Returns:
- The double value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getStringByColumnIndexAndRow
Retrieves a single String value in the result set.- Parameters:
column- The column index starting from 1row- The row index starting from 1- Returns:
- The String value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getDateByColumnIndexAndRow
Retrieves a single Date value in the result set.- Parameters:
column- The column index starting from 1row- The row index starting from 1- Returns:
- The Date value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getTimestampByColumnIndexAndRow
public Timestamp getTimestampByColumnIndexAndRow(int column, int row) throws MonetDBEmbeddedExceptionRetrieves a single Timestamp value in the result set.- Parameters:
column- The column index starting from 1row- The row index starting from 1- Returns:
- The Timestamp value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getTimeByColumnIndexAndRow
Retrieves a single Time value in the result set.- Parameters:
column- The column index starting from 1row- The row index starting from 1- Returns:
- The Time value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getBlobByColumnIndexAndRow
Retrieves a single byte[] value (BLOB) in the result set.- Parameters:
column- The column index starting from 1row- The row index starting from 1- Returns:
- The byte[] value (BLOB)
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getDecimalByColumnIndexAndRow
public BigDecimal getDecimalByColumnIndexAndRow(int column, int row) throws MonetDBEmbeddedExceptionRetrieves a single BigDecimal value in the result set.- Parameters:
column- The column index starting from 1row- The row index starting from 1- Returns:
- The BigDecimal value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getOidByColumnIndexAndRow
Retrieves a single oid value in the result set.- Parameters:
column- The column index starting from 1row- The row index starting from 1- Returns:
- The oid value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getBooleanByColumnNameAndRow
public boolean getBooleanByColumnNameAndRow(String columnName, int row) throws MonetDBEmbeddedExceptionRetrieves a single boolean value in the result set by name.- Parameters:
columnName- The column namerow- The row index starting from 1- Returns:
- The boolean value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getByteByColumnNameAndRow
Retrieves a single byte value in the result set by name.- Parameters:
columnName- The column namerow- The row index starting from 1- Returns:
- The byte value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getShortByColumnNameAndRow
public short getShortByColumnNameAndRow(String columnName, int row) throws MonetDBEmbeddedExceptionRetrieves a single short value in the result set by name.- Parameters:
columnName- The column namerow- The row index starting from 1- Returns:
- The short value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getIntegerByColumnNameAndRow
public int getIntegerByColumnNameAndRow(String columnName, int row) throws MonetDBEmbeddedExceptionRetrieves a single integer value in the result set by name.- Parameters:
columnName- The column namerow- The row index starting from 1- Returns:
- The integer value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getLongByColumnNameAndRow
Retrieves a single long value in the result set by name.- Parameters:
columnName- The column namerow- The row index starting from 1- Returns:
- The long value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getFloatByColumnNameAndRow
public float getFloatByColumnNameAndRow(String columnName, int row) throws MonetDBEmbeddedExceptionRetrieves a single float value in the result set by name.- Parameters:
columnName- The column namerow- The row index starting from 1- Returns:
- The float value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getDoubleByColumnNameAndRow
public double getDoubleByColumnNameAndRow(String columnName, int row) throws MonetDBEmbeddedExceptionRetrieves a single double value in the result set by name.- Parameters:
columnName- The column namerow- The row index starting from 1- Returns:
- The double value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getStringByColumnNameAndRow
public String getStringByColumnNameAndRow(String columnName, int row) throws MonetDBEmbeddedExceptionRetrieves a single String value in the result set by name.- Parameters:
columnName- The column namerow- The row index starting from 1- Returns:
- The String value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getDateByColumnNameAndRow
Retrieves a single Date value in the result set by name.- Parameters:
columnName- The column namerow- The row index starting from 1- Returns:
- The Date value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getTimestampByColumnNameAndRow
public Timestamp getTimestampByColumnNameAndRow(String columnName, int row) throws MonetDBEmbeddedExceptionRetrieves a single Timestamp value in the result set by name.- Parameters:
columnName- The column namerow- The row index starting from 1- Returns:
- The Timestamp value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getTimeByColumnNameAndRow
Retrieves a single Time value in the result set by name.- Parameters:
columnName- The column namerow- The row index starting from 1- Returns:
- The Time value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getBlobByColumnNameAndRow
public byte[] getBlobByColumnNameAndRow(String columnName, int row) throws MonetDBEmbeddedExceptionRetrieves a single byte[] (BLOB) value in the result set by name.- Parameters:
columnName- The column namerow- The row index starting from 1- Returns:
- The byte[] (BLOB) value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getDecimalByColumnNameAndRow
public BigDecimal getDecimalByColumnNameAndRow(String columnName, int row) throws MonetDBEmbeddedExceptionRetrieves a single decimal value in the result set by name.- Parameters:
columnName- The column namerow- The row index starting from 1- Returns:
- The decimal value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getOidByColumnNameAndRow
Retrieves a single oid value in the result set by name.- Parameters:
columnName- The column namerow- The row index starting from 1- Returns:
- The String oid value
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getBooleanColumnByIndex
public void getBooleanColumnByIndex(int column, boolean[] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves a boolean column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input boolean array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getByteColumnByIndex
public void getByteColumnByIndex(int column, byte[] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves a byte column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input byte array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getShortColumnByIndex
public void getShortColumnByIndex(int column, short[] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves a short column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input short array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getIntColumnByIndex
public void getIntColumnByIndex(int column, int[] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves an integer column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input integer array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getLongColumnByIndex
public void getLongColumnByIndex(int column, long[] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves a long column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input long array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getFloatColumnByIndex
public void getFloatColumnByIndex(int column, float[] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves a float column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input float array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getDoubleColumnByIndex
public void getDoubleColumnByIndex(int column, double[] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves a double column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input double array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getStringColumnByIndex
public void getStringColumnByIndex(int column, String[] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves a String column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input String array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getDateColumnByIndex
public void getDateColumnByIndex(int column, Date[] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves a Date column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input Date array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getTimestampColumnByIndex
public void getTimestampColumnByIndex(int column, Timestamp[] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves a Timestamp column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input Timestamp array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getTimeColumnByIndex
public void getTimeColumnByIndex(int column, Time[] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves a Time column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input Time array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getBlobColumnByIndex
public void getBlobColumnByIndex(int column, byte[][] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves a byte[] (BLOB) column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input byte[] (BLOB) array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getDecimalColumnByIndex
public void getDecimalColumnByIndex(int column, BigDecimal[] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves a BigDecimal column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input BigDecimal array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getOidColumnByIndex
public void getOidColumnByIndex(int column, String[] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves an oid column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input oid array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getBooleanColumnByName
public void getBooleanColumnByName(String columnName, boolean[] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves a boolean column by name.- Parameters:
columnName- - The name of the column.input- - The input boolean array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getByteColumnByName
public void getByteColumnByName(String columnName, byte[] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves a byte column by name.- Parameters:
columnName- - The name of the column.input- - The input byte array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getShortColumnByName
public void getShortColumnByName(String columnName, short[] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves a short column by name.- Parameters:
columnName- - The name of the column.input- - The input short array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getIntColumnByName
public void getIntColumnByName(String columnName, int[] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves an integer column by name.- Parameters:
columnName- - The name of the column.input- - The input integer array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getLongColumnByName
public void getLongColumnByName(String columnName, long[] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves a long column by name.- Parameters:
columnName- - The name of the column.input- - The input long array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getFloatColumnByName
public void getFloatColumnByName(String columnName, float[] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves a float column by name.- Parameters:
columnName- - The name of the column.input- - The input float array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getDoubleColumnByName
public void getDoubleColumnByName(String columnName, double[] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves a double column by name.- Parameters:
columnName- - The name of the column.input- - The input double array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getStringColumnByName
public void getStringColumnByName(String columnName, String[] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves a String column by name.- Parameters:
columnName- - The name of the column.input- - The input String array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getDateColumnByName
public void getDateColumnByName(String columnName, Date[] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves a Date column by name.- Parameters:
columnName- - The name of the column.input- - The input Date array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getTimestampColumnByName
public void getTimestampColumnByName(String columnName, Timestamp[] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves a Timestamp column by name.- Parameters:
columnName- - The name of the column.input- - The input Timestamp array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getTimeColumnByName
public void getTimeColumnByName(String columnName, Time[] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves a Time column by name.- Parameters:
columnName- - The name of the column.input- - The input Time array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getBlobColumnByName
public void getBlobColumnByName(String columnName, byte[][] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves a byte[] (BLOB) column by name.- Parameters:
columnName- - The name of the column.input- - The input byte[] (BLOB) array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getDecimalColumnByName
public void getDecimalColumnByName(String columnName, BigDecimal[] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves a BigDecimal column by name.- Parameters:
columnName- - The name of the column.input- - The input BigDecimal array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getOidColumnByName
public void getOidColumnByName(String columnName, String[] input, int offset, int length) throws MonetDBEmbeddedExceptionRetrieves an oid column by name.- Parameters:
columnName- - The name of the column.input- - The input oid array where the result will be copied to.offset- - The starting offset of the array.length- - The number of elements to copy.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getBooleanColumnByIndex
Retrieves a boolean column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input boolean array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getByteColumnByIndex
Retrieves a byte column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input byte array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getShortColumnByIndex
Retrieves a short column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input short array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getIntColumnByIndex
Retrieves an integer column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input integer array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getLongColumnByIndex
Retrieves a long column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input long array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getFloatColumnByIndex
Retrieves a float column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input float array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getDoubleColumnByIndex
Retrieves a double column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input double array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getStringColumnByIndex
Retrieves a String column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input String array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getDateColumnByIndex
Retrieves a Date column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input Date array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getTimestampColumnByIndex
public void getTimestampColumnByIndex(int column, Timestamp[] input) throws MonetDBEmbeddedExceptionRetrieves a Timestamp column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input Timestamp array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getTimeColumnByIndex
Retrieves a Time column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input Time array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getBlobColumnByIndex
Retrieves a byte[] (BLOB) column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input byte[] (BLOB) array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getDecimalColumnByIndex
public void getDecimalColumnByIndex(int column, BigDecimal[] input) throws MonetDBEmbeddedExceptionRetrieves a BigDecimal column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input BigDecimal array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getOidColumnByIndex
Retrieves an oid column by index.- Parameters:
column- - The index of the column starting from 1.input- - The input String[] array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getBooleanColumnByName
public void getBooleanColumnByName(String columnName, boolean[] input) throws MonetDBEmbeddedExceptionRetrieves a boolean column by name.- Parameters:
columnName- - The name of the column.input- - The input boolean array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getByteColumnByName
Retrieves a byte column by name.- Parameters:
columnName- - The name of the column.input- - The input byte array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getShortColumnByName
Retrieves a short column by name.- Parameters:
columnName- - The name of the column.input- - The input short array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getIntColumnByName
Retrieves an integer column by name.- Parameters:
columnName- - The name of the column.input- - The input integer array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getLongColumnByName
Retrieves a long column by name.- Parameters:
columnName- - The name of the column.input- - The input long array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getFloatColumnByName
Retrieves a float column by name.- Parameters:
columnName- - The name of the column.input- - The input float array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getDoubleColumnByName
public void getDoubleColumnByName(String columnName, double[] input) throws MonetDBEmbeddedExceptionRetrieves a double column by name.- Parameters:
columnName- - The name of the column.input- - The input double array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getStringColumnByName
public void getStringColumnByName(String columnName, String[] input) throws MonetDBEmbeddedExceptionRetrieves a String column by name.- Parameters:
columnName- - The name of the column.input- - The input String array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getDateColumnByName
Retrieves a Date column by name.- Parameters:
columnName- - The name of the column.input- - The input Date array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getTimestampColumnByName
public void getTimestampColumnByName(String columnName, Timestamp[] input) throws MonetDBEmbeddedExceptionRetrieves a Timestamp column by name.- Parameters:
columnName- - The name of the column.input- - The input Timestamp array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getTimeColumnByName
Retrieves a Time column by name.- Parameters:
columnName- - The name of the column.input- - The input Time array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getBlobColumnByName
Retrieves a byte[] (BLOB) column by name.- Parameters:
columnName- - The name of the column.input- - The input byte[] (BLOB) array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getDecimalColumnByName
public void getDecimalColumnByName(String columnName, BigDecimal[] input) throws MonetDBEmbeddedExceptionRetrieves an BigDecimal column by name.- Parameters:
columnName- - The name of the column.input- - The input BigDecimal array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getOidColumnByName
Retrieves an oid column by name.- Parameters:
columnName- - The name of the column.input- - The input String array where the result will be copied to.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
checkBooleanIsNull
Tests if a boolean in the result set is a null value.- Parameters:
column- The column index starting from 1row- The row index in the column starting from 1- Returns:
- A boolean indicating if the value is null
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getColumnNullMappingsByIndex
public void getColumnNullMappingsByIndex(int column, boolean[] input) throws MonetDBEmbeddedExceptionGets the null mapping of a column by index.- Parameters:
column- The column index starting from 1input- An array of booleans, indicating if the values of the column are null or not.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getNullMappingByName
public void getNullMappingByName(String columnName, boolean[] input) throws MonetDBEmbeddedExceptionGets the null mapping of a column by name- Parameters:
columnName- The column nameinput- An array of booleans, indicating if the values of the column are null or not.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
mapColumnToObjectByIndex
Maps a column to a Java Object representation of the array by index. This is method is used by the fetchResultSetRows to iterate row-wise. Warning! This method creates an Object array for the column and a object for each value which is inefficient for te number of memory allocations it has to make.- Parameters:
column- The column index starting from 1input- An Object array representation of the column.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
mapColumnToObjectByName
public void mapColumnToObjectByName(String columnName, Object[] input) throws MonetDBEmbeddedExceptionMaps a column to a Java Object representation of the array by name.- Parameters:
columnName- The column nameinput- An Object array representation of the column.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
fetchResultSetRows
public QueryResultRowSet fetchResultSetRows(int startIndex, int endIndex) throws MonetDBEmbeddedExceptionFetch rows from the result set.- Parameters:
startIndex- The first row index to retrieve starting from 1endIndex- The last row index to retrieve- Returns:
- The rows as
QueryResultRowSet - Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
fetchFirstNRowValues
Fetches the first N rows from the result set.- Parameters:
n- The last row index to retrieve- Returns:
- The rows as
QueryResultRowSet - Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
fetchAllRowValues
Fetches all rows from the result set.- Returns:
- The rows as
QueryResultRowSet - Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
iterator
-
closeResultImplementation
protected void closeResultImplementation()Description copied from class:AbstractConnectionResultClose the result set internally.- Specified by:
closeResultImplementationin classAbstractConnectionResult
-
close
public void close()Description copied from class:AbstractConnectionResultClose the result set.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classAbstractConnectionResult
-