Skip to content

Commit

Permalink
Sort methods with the same name in MySQL.java
Browse files Browse the repository at this point in the history
  • Loading branch information
nickhnsn committed Mar 7, 2023
1 parent a487447 commit f988805
Showing 1 changed file with 30 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,36 @@ public void query(String statement, Consumer<ResultSet> consumer) {
});
}

/**
* Query durchführen mithilfe eines Query-Strings
* @param query die Query
* @return das ResultSet
*/
public ResultSet query(String query) {
checkConnection();
try {
return query(this.connection.prepareStatement(query));
} catch (Exception e) {
e.printStackTrace();
}
return null;
}

/**
* Query durchführen mithilfe eines PreparedStatements
* @param statement das PreparedStatement
* @return das ResultSet
*/
public ResultSet query(PreparedStatement statement) {
checkConnection();
try {
return statement.executeQuery();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}

/**
* Query in der Datenbank synchron ausführen
* @param statement das Statement in Form eines Strings
Expand Down Expand Up @@ -177,36 +207,6 @@ public void queryUpdate(PreparedStatement preparedStatement) {
}
}

/**
* Query durchführen mithilfe eines Query-Strings
* @param query die Query
* @return das ResultSet
*/
public ResultSet query(String query) {
checkConnection();
try {
return query(this.connection.prepareStatement(query));
} catch (Exception e) {
e.printStackTrace();
}
return null;
}

/**
* Query durchführen mithilfe eines PreparedStatements
* @param statement das PreparedStatement
* @return das ResultSet
*/
public ResultSet query(PreparedStatement statement) {
checkConnection();
try {
return statement.executeQuery();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}

/**
* Prüfen, ob die Datenbankverbindung noch besteht
*/
Expand Down

0 comments on commit f988805

Please sign in to comment.