class AbstractSqlQuery.CountWork extends ResultSetWork<Long>
Modifier and Type | Field and Description |
---|---|
private List<String> |
parameterOrder |
Constructor and Description |
---|
CountWork(SessionControl sc,
String sql,
List<String> parameterOrder) |
Modifier and Type | Method and Description |
---|---|
protected Long |
getResult(ResultSet rs)
This method needs to be overridden by subclasses to extract the
result from the
ResultSet . |
protected void |
setParameters(PreparedStatement ps)
This method should be overridden by subclasses that needs to
set parameters on the statement that is going to be executed.
|
execute, getSql
CountWork(SessionControl sc, String sql, List<String> parameterOrder)
protected void setParameters(PreparedStatement ps) throws SQLException
ResultSetWork
Connection.prepareStatement(String)
and before it is executed
with PreparedStatement.executeUpdate()
.setParameters
in class ResultSetWork<Long>
ps
- The prepared statementSQLException
protected Long getResult(ResultSet rs) throws SQLException
ResultSetWork
ResultSet
. The result set will be closed
after the call to this method.getResult
in class ResultSetWork<Long>
rs
- The result set to get the result fromSQLException