Package com.kuzudb
Class QueryResult
java.lang.Object
com.kuzudb.QueryResult
- All Implemented Interfaces:
AutoCloseable
QueryResult stores the result of a query execution.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the query result and release the underlying resources.getColumnDataType
(long index) Get the column data type at the given index.getColumnName
(long index) Get the column name at the given index.Get the error message if any.getNext()
Get the next tuple.Get the next query result.long
Get the number of columns in the query result.long
Get the number of tuples in the query result.Get the query summary.boolean
hasNext()
Return if the query result has next tuple or not.boolean
Return if the query result has next query result or not.boolean
boolean
Check if the query is executed successfully.void
Reset the query result iterator.toString()
Convert the query result to string.
-
Constructor Details
-
QueryResult
public QueryResult()
-
-
Method Details
-
close
Close the query result and release the underlying resources. This method is invoked automatically on objects managed by the try-with-resources statement.- Specified by:
close
in interfaceAutoCloseable
- Throws:
ObjectRefDestroyedException
- If the query result has been destroyed.
-
isOwnedByCPP
public boolean isOwnedByCPP() -
isSuccess
Check if the query is executed successfully.- Returns:
- Query is executed successfully or not.
- Throws:
ObjectRefDestroyedException
- If the query result has been destroyed.
-
getErrorMessage
Get the error message if any.- Returns:
- Error message of the query execution if the query fails.
- Throws:
ObjectRefDestroyedException
- If the query result has been destroyed.
-
getNumColumns
Get the number of columns in the query result.- Returns:
- The number of columns in the query result.
- Throws:
ObjectRefDestroyedException
- If the query result has been destroyed.
-
getColumnName
Get the column name at the given index.- Parameters:
index
- : The index of the column.- Returns:
- The column name at the given index.
- Throws:
ObjectRefDestroyedException
- If the query result has been destroyed.
-
getColumnDataType
Get the column data type at the given index.- Parameters:
index
- : The index of the column.- Returns:
- The column data type at the given index.
- Throws:
ObjectRefDestroyedException
- If the query result has been destroyed.
-
getNumTuples
Get the number of tuples in the query result.- Returns:
- The number of tuples in the query result.
- Throws:
ObjectRefDestroyedException
- If the query result has been destroyed.
-
getQuerySummary
Get the query summary.- Returns:
- The query summary.
- Throws:
ObjectRefDestroyedException
- If the query result has been destroyed.
-
hasNext
Return if the query result has next tuple or not.- Returns:
- Whether there are more tuples to read.
- Throws:
ObjectRefDestroyedException
- If the query result has been destroyed.
-
getNext
Get the next tuple.- Returns:
- The next tuple.
- Throws:
ObjectRefDestroyedException
- If the query result has been destroyed.
-
hasNextQueryResult
Return if the query result has next query result or not.- Returns:
- Whether there are more query results to read.
- Throws:
ObjectRefDestroyedException
- If the query result has been destroyed.
-
getNextQueryResult
Get the next query result.- Returns:
- The next query result.
- Throws:
ObjectRefDestroyedException
- If the query result has been destroyed.
-
toString
Convert the query result to string. -
resetIterator
Reset the query result iterator.- Throws:
ObjectRefDestroyedException
- If the query result has been destroyed.
-