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