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 protected
AbstractConnectionResult(MonetDBEmbeddedConnection connection)
-
Method Summary
Modifier and Type Method Description protected void
checkMetadataArrayLength(Object input)
Checks the length of an input array for metadata retrievalvoid
close()
Close the result set.protected abstract void
closeResultImplementation()
Close the result set internally.abstract void
getColumnDigits(int[] input)
Gets the column digits as an integer array.abstract void
getColumnNames(String[] input)
Gets the columns names as a string array.abstract void
getColumnScales(int[] input)
Gets the column scales as an integer array.abstract void
getColumnTypes(String[] input)
Gets the columns types as a string array.MonetDBEmbeddedConnection
getConnection()
Gets the corresponding connection to this statement result.abstract void
getMappings(MonetDBToJavaMapping[] input)
Gets the Java mappings as a MonetDBToJavaMapping array.abstract int
getNumberOfColumns()
Returns the number of columns in the result set.abstract int
getNumberOfRows()
Returns the number of rows in the result set.protected long
getRandomIdentifier()
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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
closeResultImplementation
protected abstract void closeResultImplementation()Close the result set internally.
-