Cleaned up the getResultSet method of the MySQLConnection class

This commit is contained in:
mathias 2021-08-19 21:55:32 +02:00
parent 356624ce07
commit d5bd0e4248
No known key found for this signature in database
GPG Key ID: 8950DF62139C852A

View File

@ -68,12 +68,12 @@ public class MySQLConnection {
*/
public ResultSet getResultSet(String query, Object... params) {
try {
int start = 1;
PreparedStatement ps = con.prepareStatement(query);
for (Object current : params) {
ps.setObject(start, current);
start++;
for (int i = 0; i < params.length; i++) {
ps.setObject(i+1, params[i]);
}
return ps.executeQuery();
} catch (Exception err) {
LOG.error(err.getMessage());