Files
Server/src/engine/db/handlers/dbEffectsResourceCostHandler.java
T

48 lines
1.9 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-21 17:34:31 -04:00
import engine.gameManager.DbManager;
2022-04-30 09:41:17 -04:00
import engine.objects.EffectsResourceCosts;
2023-05-21 17:34:31 -04:00
import org.pmw.tinylog.Logger;
2022-04-30 09:41:17 -04:00
2023-05-21 17:34:31 -04:00
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
2022-04-30 09:41:17 -04:00
import java.util.ArrayList;
public class dbEffectsResourceCostHandler extends dbHandlerBase {
2023-05-23 10:27:03 -04:00
public dbEffectsResourceCostHandler() {
this.localClass = EffectsResourceCosts.class;
2022-04-30 09:41:17 -04:00
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName());
2023-05-23 10:27:03 -04:00
}
2023-05-21 17:34:31 -04:00
2023-05-23 10:27:03 -04:00
public ArrayList<EffectsResourceCosts> GET_ALL_EFFECT_RESOURCES(String idString) {
2023-05-21 17:34:31 -04:00
2023-05-23 10:27:03 -04:00
ArrayList<EffectsResourceCosts> effectsResourceCosts = new ArrayList<>();
2023-05-21 17:34:31 -04:00
2023-05-23 10:27:03 -04:00
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_power_effectcost` WHERE `IDString` = ?")) {
2023-05-21 17:34:31 -04:00
2023-05-23 10:27:03 -04:00
preparedStatement.setString(1, idString);
2023-05-21 17:34:31 -04:00
2023-05-23 10:27:03 -04:00
ResultSet rs = preparedStatement.executeQuery();
effectsResourceCosts = getObjectsFromRs(rs, 1000);
2023-05-21 17:34:31 -04:00
2023-05-23 10:27:03 -04:00
} catch (SQLException e) {
Logger.error(e);
}
return effectsResourceCosts;
}
2022-04-30 09:41:17 -04:00
}