🛠️ Code cleanup & added many new features #1

Merged
gnmyt merged 121 commits from features/code-cleanup into master 2021-09-02 13:34:00 +00:00
Showing only changes of commit fefbebeb3a - Show all commits

View File

@ -99,12 +99,26 @@ public class MySQLConnection {
* @param consumer The consumer * @param consumer The consumer
* @param params The optional parameters * @param params The optional parameters
*/ */
public void getResult(String query, SQLConsumer<ResultSet> consumer, Object... params) { public void getResultSet(String query, SQLConsumer<ResultSet> consumer, Object... params) {
try { try {
ResultSet resultSet = getResultSet(query, params); consumer.accept(getResultSet(query, params));
consumer.accept(resultSet); } catch (Exception e) {
resultSet.close(); LOG.error(e.getMessage());
} catch (Exception ignored) { }
}
/**
* Run an action with a result from your server
*
* @param query The search query
* @param consumer The consumer
* @param params The optional parameters
*/
public void getResult(String query, SQLConsumer<ResultManager> consumer, Object... params) {
try {
consumer.accept(getResult(query, params));
} catch (Exception e) {
LOG.error(e.getMessage());
} }
} }