protected abstract class Sql.AbstractQueryCommand extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
sql |
protected Statement |
statement |
Modifier and Type | Method and Description |
---|---|
void |
closeResources()
After performing the execute operation and making use of its return, it's necessary
to free the resources allocated for the statement.
|
void |
closeResources(ResultSet rs)
After performing the execute operation and making use of its return, it's necessary
to free the resources allocated for the statement.
|
protected abstract ResultSet |
runQuery(Connection connection)
Perform the query.
|
public final void closeResources()
public final void closeResources(ResultSet rs)
rs
- allows the caller to conveniently close its resource as wellprotected abstract ResultSet runQuery(Connection connection) throws SQLException
execute()
) method can clean up.
This is the method that encloses the variant part of the code.connection
- the connection to useSQLException
- if a database error occurs