T
- The type of the queried objectprotected abstract class JdbcUserDirectory.AbstractJdbcQueryExecutor<T> extends Object
Modifier | Constructor and Description |
---|---|
protected |
AbstractJdbcQueryExecutor() |
Modifier and Type | Method and Description |
---|---|
protected ResultSet |
executeQuery(PreparedStatement stmt)
Execute the prepared statement and retrieves the result set.
|
protected abstract String |
getSqlQuery(Connection connection)
Must return the SQL query to execute
|
protected PreparedStatement |
prepareStatement(Connection connection,
String sql)
Prepare the statement to execute
|
protected T |
processResultSet(ResultSet rs)
Process the result set
|
T |
run()
Main function, run the query process.
|
T |
runWithException()
Main function, run the query process.
|
protected AbstractJdbcQueryExecutor()
public T run()
processResultSet(ResultSet)
public T runWithException() throws Exception
Exception
- All non SQLException will be thrownprotected abstract String getSqlQuery(Connection connection)
connection
- The pool connectionprotected PreparedStatement prepareStatement(Connection connection, String sql) throws SQLException
connection
- The pool connectionsql
- The SQL querySQLException
- If an SQL Exception occursprotected ResultSet executeQuery(PreparedStatement stmt) throws SQLException
stmt
- The prepared statementSQLException
- If an SQL Exception occursprotected T processResultSet(ResultSet rs) throws SQLException, Exception
rs
- The result setSQLException
- If an SQL exception occursException
- Other exception will be thrown when using runWithException()