Interface QueryHelper
public interface QueryHelper
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> List
<T> executeQuery
(String query, QueryHelper.ResultSetHandler<T> handler, MYSQL mysql) Executes a query on the database and returns the result.default <T> List
<T> executeQuery
(String query, QueryHelper.ResultSetHandler<T> handler, MYSQL mysql, String database) Executes a query on the database and returns the result.default void
executeUpdate
(String query, MYSQL mysql) Executes an update query on the database.default void
executeUpdate
(String query, MYSQL mysql, String database) Executes an update query on the database.
-
Method Details
-
executeQuery
default <T> List<T> executeQuery(String query, QueryHelper.ResultSetHandler<T> handler, MYSQL mysql) Executes a query on the database and returns the result.- Type Parameters:
T
- the type of the query result- Parameters:
query
- the SQL query to executehandler
- the ResultSetHandler to process the query resultmysql
- the MYSQL object representing the database connection- Returns:
- the processed query result, or null if an exception occurred
-
executeQuery
default <T> List<T> executeQuery(String query, QueryHelper.ResultSetHandler<T> handler, MYSQL mysql, String database) Executes a query on the database and returns the result.- Type Parameters:
T
- the type of the query result- Parameters:
query
- the SQL query to executehandler
- the ResultSetHandler to process the query resultmysql
- the MYSQL object representing the database connection- Returns:
- the processed query result, or null if an exception occurred
-
executeUpdate
Executes an update query on the database.- Parameters:
query
- the SQL update query to executemysql
- the MYSQL object representing the database connection
-
executeUpdate
Executes an update query on the database.- Parameters:
query
- the SQL update query to executemysql
- the MYSQL object representing the database connection
-