Files
prestonbane/src/engine/db/handlers/dbBoonHandler.java
T

52 lines
1.8 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 19:14:01 -04:00
import engine.gameManager.DbManager;
2022-04-30 09:41:17 -04:00
import engine.objects.Boon;
import org.pmw.tinylog.Logger;
2023-05-20 19:14:01 -04:00
import java.sql.Connection;
import java.sql.PreparedStatement;
2022-04-30 09:41:17 -04:00
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
public class dbBoonHandler extends dbHandlerBase {
2023-07-15 09:23:48 -04:00
public dbBoonHandler() {
}
2023-05-20 19:14:01 -04:00
2023-07-15 09:23:48 -04:00
public ArrayList<Boon> GET_BOON_AMOUNTS_FOR_ITEMBASE(int itemBaseUUID) {
2023-05-20 19:14:01 -04:00
2023-07-15 09:23:48 -04:00
ArrayList<Boon> boons = new ArrayList<>();
Boon thisBoon;
2023-05-20 19:14:01 -04:00
2023-07-15 09:23:48 -04:00
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_item_boons` WHERE `itemBaseID` = ?")) {
2023-05-20 19:14:01 -04:00
2023-07-15 09:23:48 -04:00
preparedStatement.setInt(1, itemBaseUUID);
2023-05-20 19:14:01 -04:00
2023-07-15 09:23:48 -04:00
ResultSet rs = preparedStatement.executeQuery();
2023-05-20 19:14:01 -04:00
2023-07-15 09:23:48 -04:00
while (rs.next()) {
thisBoon = new Boon(rs);
boons.add(thisBoon);
}
2023-05-20 19:14:01 -04:00
2023-07-15 09:23:48 -04:00
} catch (SQLException e) {
Logger.error(e);
}
2023-05-20 19:14:01 -04:00
2023-07-15 09:23:48 -04:00
return boons;
}
2022-04-30 09:41:17 -04:00
}