Package nl.cwi.monetdb.embedded.env
Class AbstractConnectionResult
java.lang.Object
nl.cwi.monetdb.embedded.env.AbstractConnectionResult
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
MonetDBEmbeddedPreparedStatement,MonetDBTable,QueryResultSet
public abstract class AbstractConnectionResult extends Object implements Closeable
The base class for a pending statement to a connection.
- Author:
- Pedro Ferreira
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractConnectionResult(MonetDBEmbeddedConnection connection) -
Method Summary
Modifier and Type Method Description protected voidcheckMetadataArrayLength(Object input)Checks the length of an input array for metadata retrievalvoidclose()Close the result set.protected abstract voidcloseResultImplementation()Close the result set internally.abstract voidgetColumnDigits(int[] input)Gets the column digits as an integer array.abstract voidgetColumnNames(String[] input)Gets the columns names as a string array.abstract voidgetColumnScales(int[] input)Gets the column scales as an integer array.abstract voidgetColumnTypes(String[] input)Gets the columns types as a string array.MonetDBEmbeddedConnectiongetConnection()Gets the corresponding connection to this statement result.abstract voidgetMappings(MonetDBToJavaMapping[] input)Gets the Java mappings as a MonetDBToJavaMapping array.abstract intgetNumberOfColumns()Returns the number of columns in the result set.abstract intgetNumberOfRows()Returns the number of rows in the result set.protected longgetRandomIdentifier()Gets a long number randomly generated, used to identify the result set.
-
Constructor Details
-
Method Details
-
getConnection
Gets the corresponding connection to this statement result.- Returns:
- A MonetDBEmbeddedConnection instance
-
getNumberOfColumns
Returns the number of columns in the result set.- Returns:
- Number of columns
- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getNumberOfRows
public abstract int getNumberOfRows()Returns the number of rows in the result set.- Returns:
- Number of rows
-
getRandomIdentifier
protected long getRandomIdentifier()Gets a long number randomly generated, used to identify the result set.- Returns:
- A random long identifier
-
checkMetadataArrayLength
Checks the length of an input array for metadata retrieval- Parameters:
input- - An array to check its bounds- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getColumnNames
Gets the columns names as a string array.- Parameters:
input- The columns names array to fill.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getColumnTypes
Gets the columns types as a string array.- Parameters:
input- The columns types array to fill.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getMappings
Gets the Java mappings as a MonetDBToJavaMapping array.- Parameters:
input- The columns mappings array to fill.- Throws:
MonetDBEmbeddedException- If an error in the database occurred..
-
getColumnDigits
Gets the column digits as an integer array.- Parameters:
input- The columns digits array to fill.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
getColumnScales
Gets the column scales as an integer array.- Parameters:
input- The columns scales array to fill.- Throws:
MonetDBEmbeddedException- If an error in the database occurred.
-
close
public void close()Close the result set.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
closeResultImplementation
protected abstract void closeResultImplementation()Close the result set internally.
-