Class QueryResultSet
java.lang.Object
nl.cwi.monetdb.embedded.env.AbstractConnectionResult
nl.cwi.monetdb.embedded.resultset.QueryResultSet
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.lang.Iterable
- Direct Known Subclasses:
PreparedQueryResultSet
public class QueryResultSet extends AbstractConnectionResult implements java.lang.Iterable
Embedded MonetDB query result. The query result columns are eagerly copied from the native code to Java.
-
Method Summary
Modifier and Type Method Description boolean
checkBooleanIsNull(int column, int row)
Tests if a boolean in the result set is a null value.void
close()
Close the result set.protected void
closeResultImplementation()
Close the result set internally.QueryResultRowSet
fetchAllRowValues()
Fetches all rows from the result set.QueryResultRowSet
fetchFirstNRowValues(int n)
Fetches the first N rows from the result set.QueryResultRowSet
fetchResultSetRows(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(java.lang.String columnName, int row)
Retrieves a single byte[] (BLOB) value in the result set by name.void
getBlobColumnByIndex(int column, byte[][] input)
Retrieves a byte[] (BLOB) column by index.void
getBlobColumnByIndex(int column, byte[][] input, int offset, int length)
Retrieves a byte[] (BLOB) column by index.void
getBlobColumnByName(java.lang.String columnName, byte[][] input)
Retrieves a byte[] (BLOB) column by name.void
getBlobColumnByName(java.lang.String columnName, byte[][] input, int offset, int length)
Retrieves a byte[] (BLOB) column by name.boolean
getBooleanByColumnIndexAndRow(int column, int row)
Retrieves a single boolean value in the result set.boolean
getBooleanByColumnNameAndRow(java.lang.String columnName, int row)
Retrieves a single boolean value in the result set by name.void
getBooleanColumnByIndex(int column, boolean[] input)
Retrieves a boolean column by index.void
getBooleanColumnByIndex(int column, boolean[] input, int offset, int length)
Retrieves a boolean column by index.void
getBooleanColumnByName(java.lang.String columnName, boolean[] input)
Retrieves a boolean column by name.void
getBooleanColumnByName(java.lang.String columnName, boolean[] input, int offset, int length)
Retrieves a boolean column by name.byte
getByteByColumnIndexAndRow(int column, int row)
Retrieves a single byte value in the result set.byte
getByteByColumnNameAndRow(java.lang.String columnName, int row)
Retrieves a single byte value in the result set by name.void
getByteColumnByIndex(int column, byte[] input)
Retrieves a byte column by index.void
getByteColumnByIndex(int column, byte[] input, int offset, int length)
Retrieves a byte column by index.void
getByteColumnByName(java.lang.String columnName, byte[] input)
Retrieves a byte column by name.void
getByteColumnByName(java.lang.String columnName, byte[] input, int offset, int length)
Retrieves a byte column by name.void
getColumnDigits(int[] input)
Gets the column digits as an integer array.int
getColumnIndexByName(java.lang.String columnName)
Gets a column index from the result set by namevoid
getColumnNames(java.lang.String[] input)
Gets the columns names as a string array.void
getColumnNullMappingsByIndex(int column, boolean[] input)
Gets the null mapping of a column by index.void
getColumnScales(int[] input)
Gets the column scales as an integer array.void
getColumnTypes(java.lang.String[] input)
Gets the columns types as a string array.java.sql.Date
getDateByColumnIndexAndRow(int column, int row)
Retrieves a single Date value in the result set.java.sql.Date
getDateByColumnNameAndRow(java.lang.String columnName, int row)
Retrieves a single Date value in the result set by name.void
getDateColumnByIndex(int column, java.sql.Date[] input)
Retrieves a Date column by index.void
getDateColumnByIndex(int column, java.sql.Date[] input, int offset, int length)
Retrieves a Date column by index.void
getDateColumnByName(java.lang.String columnName, java.sql.Date[] input)
Retrieves a Date column by name.void
getDateColumnByName(java.lang.String columnName, java.sql.Date[] input, int offset, int length)
Retrieves a Date column by name.java.math.BigDecimal
getDecimalByColumnIndexAndRow(int column, int row)
Retrieves a single BigDecimal value in the result set.java.math.BigDecimal
getDecimalByColumnNameAndRow(java.lang.String columnName, int row)
Retrieves a single decimal value in the result set by name.void
getDecimalColumnByIndex(int column, java.math.BigDecimal[] input)
Retrieves a BigDecimal column by index.void
getDecimalColumnByIndex(int column, java.math.BigDecimal[] input, int offset, int length)
Retrieves a BigDecimal column by index.void
getDecimalColumnByName(java.lang.String columnName, java.math.BigDecimal[] input)
Retrieves an BigDecimal column by name.void
getDecimalColumnByName(java.lang.String columnName, java.math.BigDecimal[] input, int offset, int length)
Retrieves a BigDecimal column by name.double
getDoubleByColumnIndexAndRow(int column, int row)
Retrieves a single double value in the result set.double
getDoubleByColumnNameAndRow(java.lang.String columnName, int row)
Retrieves a single double value in the result set by name.void
getDoubleColumnByIndex(int column, double[] input)
Retrieves a double column by index.void
getDoubleColumnByIndex(int column, double[] input, int offset, int length)
Retrieves a double column by index.void
getDoubleColumnByName(java.lang.String columnName, double[] input)
Retrieves a double column by name.void
getDoubleColumnByName(java.lang.String columnName, double[] input, int offset, int length)
Retrieves a double column by name.float
getFloatByColumnIndexAndRow(int column, int row)
Retrieves a single float value in the result set.float
getFloatByColumnNameAndRow(java.lang.String columnName, int row)
Retrieves a single float value in the result set by name.void
getFloatColumnByIndex(int column, float[] input)
Retrieves a float column by index.void
getFloatColumnByIndex(int column, float[] input, int offset, int length)
Retrieves a float column by index.void
getFloatColumnByName(java.lang.String columnName, float[] input)
Retrieves a float column by name.void
getFloatColumnByName(java.lang.String columnName, float[] input, int offset, int length)
Retrieves a float column by name.void
getIntColumnByIndex(int column, int[] input)
Retrieves an integer column by index.void
getIntColumnByIndex(int column, int[] input, int offset, int length)
Retrieves an integer column by index.void
getIntColumnByName(java.lang.String columnName, int[] input)
Retrieves an integer column by name.void
getIntColumnByName(java.lang.String columnName, int[] input, int offset, int length)
Retrieves an integer column by name.int
getIntegerByColumnIndexAndRow(int column, int row)
Retrieves a single integer value in the result set.int
getIntegerByColumnNameAndRow(java.lang.String columnName, int row)
Retrieves a single integer value in the result set by name.long
getLongByColumnIndexAndRow(int column, int row)
Retrieves a single long value in the result set.long
getLongByColumnNameAndRow(java.lang.String columnName, int row)
Retrieves a single long value in the result set by name.void
getLongColumnByIndex(int column, long[] input)
Retrieves a long column by index.void
getLongColumnByIndex(int column, long[] input, int offset, int length)
Retrieves a long column by index.void
getLongColumnByName(java.lang.String columnName, long[] input)
Retrieves a long column by name.void
getLongColumnByName(java.lang.String columnName, long[] input, int offset, int length)
Retrieves a long column by name.void
getMappings(MonetDBToJavaMapping[] input)
Gets the Java mappings as a MonetDBToJavaMapping array.void
getNullMappingByName(java.lang.String columnName, boolean[] input)
Gets the null mapping of a column by nameint
getNumberOfColumns()
Returns the number of columns in the result set.int
getNumberOfRows()
Returns the number of rows in the result set.java.lang.String
getOidByColumnIndexAndRow(int column, int row)
Retrieves a single oid value in the result set.java.lang.String
getOidByColumnNameAndRow(java.lang.String columnName, int row)
Retrieves a single oid value in the result set by name.void
getOidColumnByIndex(int column, java.lang.String[] input)
Retrieves an oid column by index.void
getOidColumnByIndex(int column, java.lang.String[] input, int offset, int length)
Retrieves an oid column by index.void
getOidColumnByName(java.lang.String columnName, java.lang.String[] input)
Retrieves an oid column by name.void
getOidColumnByName(java.lang.String columnName, java.lang.String[] input, int offset, int length)
Retrieves an oid column by name.short
getShortByColumnIndexAndRow(int column, int row)
Retrieves a single short value in the result set.short
getShortByColumnNameAndRow(java.lang.String columnName, int row)
Retrieves a single short value in the result set by name.void
getShortColumnByIndex(int column, short[] input)
Retrieves a short column by index.void
getShortColumnByIndex(int column, short[] input, int offset, int length)
Retrieves a short column by index.void
getShortColumnByName(java.lang.String columnName, short[] input)
Retrieves a short column by name.void
getShortColumnByName(java.lang.String columnName, short[] input, int offset, int length)
Retrieves a short column by name.java.lang.String
getStringByColumnIndexAndRow(int column, int row)
Retrieves a single String value in the result set.java.lang.String
getStringByColumnNameAndRow(java.lang.String columnName, int row)
Retrieves a single String value in the result set by name.void
getStringColumnByIndex(int column, java.lang.String[] input)
Retrieves a String column by index.void
getStringColumnByIndex(int column, java.lang.String[] input, int offset, int length)
Retrieves a String column by index.void
getStringColumnByName(java.lang.String columnName, java.lang.String[] input)
Retrieves a String column by name.void
getStringColumnByName(java.lang.String columnName, java.lang.String[] input, int offset, int length)
Retrieves a String column by name.java.sql.Time
getTimeByColumnIndexAndRow(int column, int row)
Retrieves a single Time value in the result set.java.sql.Time
getTimeByColumnNameAndRow(java.lang.String columnName, int row)
Retrieves a single Time value in the result set by name.void
getTimeColumnByIndex(int column, java.sql.Time[] input)
Retrieves a Time column by index.void
getTimeColumnByIndex(int column, java.sql.Time[] input, int offset, int length)
Retrieves a Time column by index.void
getTimeColumnByName(java.lang.String columnName, java.sql.Time[] input)
Retrieves a Time column by name.void
getTimeColumnByName(java.lang.String columnName, java.sql.Time[] input, int offset, int length)
Retrieves a Time column by name.java.sql.Timestamp
getTimestampByColumnIndexAndRow(int column, int row)
Retrieves a single Timestamp value in the result set.java.sql.Timestamp
getTimestampByColumnNameAndRow(java.lang.String columnName, int row)
Retrieves a single Timestamp value in the result set by name.void
getTimestampColumnByIndex(int column, java.sql.Timestamp[] input)
Retrieves a Timestamp column by index.void
getTimestampColumnByIndex(int column, java.sql.Timestamp[] input, int offset, int length)
Retrieves a Timestamp column by index.void
getTimestampColumnByName(java.lang.String columnName, java.sql.Timestamp[] input)
Retrieves a Timestamp column by name.void
getTimestampColumnByName(java.lang.String columnName, java.sql.Timestamp[] input, int offset, int length)
Retrieves a Timestamp column by name.boolean
isQueryResultSetClosed()
Tells if the connection of this statement result has been closed or not.java.util.ListIterator<MonetDBRow>
iterator()
void
mapColumnToObjectByIndex(int column, java.lang.Object[] input)
Maps a column to a Java Object representation of the array by index.void
mapColumnToObjectByName(java.lang.String columnName, java.lang.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:AbstractConnectionResult
Returns the number of rows in the result set.- Specified by:
getNumberOfRows
in classAbstractConnectionResult
- Returns:
- Number of rows
-
getNumberOfColumns
public int getNumberOfColumns()Description copied from class:AbstractConnectionResult
Returns the number of columns in the result set.- Specified by:
getNumberOfColumns
in classAbstractConnectionResult
- Returns:
- Number of columns
-
getColumnNames
Description copied from class:AbstractConnectionResult
Gets the columns names as a string array.- Specified by:
getColumnNames
in classAbstractConnectionResult
- Parameters:
input
- The columns names array to fill.- Throws:
MonetDBEmbeddedException
- If an error in the database occurred.
-
getColumnTypes
Description copied from class:AbstractConnectionResult
Gets the columns types as a string array.- Specified by:
getColumnTypes
in classAbstractConnectionResult
- Parameters:
input
- The columns types array to fill.- Throws:
MonetDBEmbeddedException
- If an error in the database occurred.
-
getMappings
Description copied from class:AbstractConnectionResult
Gets the Java mappings as a MonetDBToJavaMapping array.- Specified by:
getMappings
in classAbstractConnectionResult
- Parameters:
input
- The columns mappings array to fill.- Throws:
MonetDBEmbeddedException
- If an error in the database occurred..
-
getColumnDigits
Description copied from class:AbstractConnectionResult
Gets the column digits as an integer array.- Specified by:
getColumnDigits
in classAbstractConnectionResult
- Parameters:
input
- The columns digits array to fill.- Throws:
MonetDBEmbeddedException
- If an error in the database occurred.
-
getColumnScales
Description copied from class:AbstractConnectionResult
Gets the column scales as an integer array.- Specified by:
getColumnScales
in 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
public java.lang.String getStringByColumnIndexAndRow(int column, int row) throws MonetDBEmbeddedExceptionRetrieves 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
public java.sql.Date getDateByColumnIndexAndRow(int column, int row) throws MonetDBEmbeddedExceptionRetrieves 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 java.sql.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
public java.sql.Time getTimeByColumnIndexAndRow(int column, int row) throws MonetDBEmbeddedExceptionRetrieves 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 java.math.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
public java.lang.String getOidByColumnIndexAndRow(int column, int row) throws MonetDBEmbeddedExceptionRetrieves 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(java.lang.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
public byte getByteByColumnNameAndRow(java.lang.String columnName, int row) throws MonetDBEmbeddedExceptionRetrieves 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(java.lang.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(java.lang.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
public long getLongByColumnNameAndRow(java.lang.String columnName, int row) throws MonetDBEmbeddedExceptionRetrieves 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(java.lang.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(java.lang.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 java.lang.String getStringByColumnNameAndRow(java.lang.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
public java.sql.Date getDateByColumnNameAndRow(java.lang.String columnName, int row) throws MonetDBEmbeddedExceptionRetrieves 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 java.sql.Timestamp getTimestampByColumnNameAndRow(java.lang.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
public java.sql.Time getTimeByColumnNameAndRow(java.lang.String columnName, int row) throws MonetDBEmbeddedExceptionRetrieves 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(java.lang.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 java.math.BigDecimal getDecimalByColumnNameAndRow(java.lang.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
public java.lang.String getOidByColumnNameAndRow(java.lang.String columnName, int row) throws MonetDBEmbeddedExceptionRetrieves 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, java.lang.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, java.sql.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, java.sql.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, java.sql.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, java.math.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, java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.String columnName, java.lang.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(java.lang.String columnName, java.sql.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(java.lang.String columnName, java.sql.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(java.lang.String columnName, java.sql.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(java.lang.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(java.lang.String columnName, java.math.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(java.lang.String columnName, java.lang.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
public void getStringColumnByIndex(int column, java.lang.String[] input) 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.- Throws:
MonetDBEmbeddedException
- If an error in the database occurred.
-
getDateColumnByIndex
public void getDateColumnByIndex(int column, java.sql.Date[] input) 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.- Throws:
MonetDBEmbeddedException
- If an error in the database occurred.
-
getTimestampColumnByIndex
public void getTimestampColumnByIndex(int column, java.sql.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
public void getTimeColumnByIndex(int column, java.sql.Time[] input) 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.- 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, java.math.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
public void getOidColumnByIndex(int column, java.lang.String[] input) throws MonetDBEmbeddedExceptionRetrieves 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(java.lang.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
public void getByteColumnByName(java.lang.String columnName, byte[] input) 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.- Throws:
MonetDBEmbeddedException
- If an error in the database occurred.
-
getShortColumnByName
public void getShortColumnByName(java.lang.String columnName, short[] input) 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.- Throws:
MonetDBEmbeddedException
- If an error in the database occurred.
-
getIntColumnByName
public void getIntColumnByName(java.lang.String columnName, int[] input) 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.- Throws:
MonetDBEmbeddedException
- If an error in the database occurred.
-
getLongColumnByName
public void getLongColumnByName(java.lang.String columnName, long[] input) 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.- Throws:
MonetDBEmbeddedException
- If an error in the database occurred.
-
getFloatColumnByName
public void getFloatColumnByName(java.lang.String columnName, float[] input) 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.- Throws:
MonetDBEmbeddedException
- If an error in the database occurred.
-
getDoubleColumnByName
public void getDoubleColumnByName(java.lang.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(java.lang.String columnName, java.lang.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
public void getDateColumnByName(java.lang.String columnName, java.sql.Date[] input) 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.- Throws:
MonetDBEmbeddedException
- If an error in the database occurred.
-
getTimestampColumnByName
public void getTimestampColumnByName(java.lang.String columnName, java.sql.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
public void getTimeColumnByName(java.lang.String columnName, java.sql.Time[] input) 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.- Throws:
MonetDBEmbeddedException
- If an error in the database occurred.
-
getBlobColumnByName
public void getBlobColumnByName(java.lang.String columnName, byte[][] input) 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.- Throws:
MonetDBEmbeddedException
- If an error in the database occurred.
-
getDecimalColumnByName
public void getDecimalColumnByName(java.lang.String columnName, java.math.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
public void getOidColumnByName(java.lang.String columnName, java.lang.String[] input) throws MonetDBEmbeddedExceptionRetrieves 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(java.lang.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
public void mapColumnToObjectByIndex(int column, java.lang.Object[] input) throws MonetDBEmbeddedExceptionMaps 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(java.lang.String columnName, java.lang.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
- Specified by:
iterator
in interfacejava.lang.Iterable
-
closeResultImplementation
protected void closeResultImplementation()Description copied from class:AbstractConnectionResult
Close the result set internally.- Specified by:
closeResultImplementation
in classAbstractConnectionResult
-
close
public void close()Description copied from class:AbstractConnectionResult
Close the result set.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classAbstractConnectionResult
-