Package com.blackrook.sql
Class SQLResult
java.lang.Object
com.blackrook.sql.SQLResult
The data encapsulation of the result of a query
ResultSet
.- Author:
- Matthew Tropiano
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
The iterator returned to iterate through this result. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionString[]
Gets the names of the columns.getId()
Object[]
getIds()
getRow()
Gets the first row, or only row in this result, or null if no rows.int
Gets the amount of affected/returned rows from this query.getRows()
Retrieves the rows from the query result.boolean
isUpdate()
iterator()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
columnNames
Query Columns. -
rowCount
protected int rowCountRows affected or returned in the query. -
nextId
Next id, if generated. -
update
protected boolean updateWas this an update query? -
rows
List of rows of associative data.
-
-
Method Details
-
getColumnNames
Gets the names of the columns.- Returns:
- the column names in this result.
-
getRowCount
public int getRowCount()Gets the amount of affected/returned rows from this query.- Returns:
- the amount of records in this result.
-
isUpdate
public boolean isUpdate()- Returns:
- true if this came from an update, false otherwise.
-
getRows
Retrieves the rows from the query result.- Returns:
- a list of the rows in this result.
-
getRow
Gets the first row, or only row in this result, or null if no rows.- Returns:
- the row in this result.
-
getId
- Returns:
- the generated id from the last query, if any, or null if none.
-
getIds
- Returns:
- the list of generated ids from the last query.
-
iterator
-