Files
magicbane/src/engine/db/handlers/dbEffectsBaseHandler.java
T

48 lines
1.7 KiB
Java
Raw Normal View History

2022-04-30 09:41:17 -04:00
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.db.handlers;
2023-05-20 10:00:38 -04:00
import engine.gameManager.DbManager;
import engine.powers.EffectsBase;
import org.pmw.tinylog.Logger;
2023-05-20 10:00:38 -04:00
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
2023-05-20 10:00:38 -04:00
import java.sql.SQLException;
import java.util.ArrayList;
2022-04-30 09:41:17 -04:00
public class dbEffectsBaseHandler extends dbHandlerBase {
public dbEffectsBaseHandler() {
}
public static ArrayList<EffectsBase> getAllEffectsBase() {
2023-05-20 10:00:38 -04:00
ArrayList<EffectsBase> effectList = new ArrayList<>();
try (Connection connection = DbManager.getConnection();
PreparedStatement prepareStatement = connection.prepareStatement("SELECT * FROM static_power_effectbase ORDER BY `IDString` DESC")) {
ResultSet rs = prepareStatement.executeQuery();
while (rs.next()) {
2023-05-20 10:01:40 -04:00
EffectsBase effectBase = new EffectsBase(rs);
effectList.add(effectBase);
}
2023-05-20 10:00:38 -04:00
} catch (SQLException e) {
Logger.error(e.toString());
}
2023-05-20 10:00:38 -04:00
return effectList;
2022-04-30 09:41:17 -04:00
}
2023-05-20 10:00:38 -04:00
2022-04-30 09:41:17 -04:00
}