|
|
@ -9,9 +9,12 @@ |
|
|
|
|
|
|
|
|
|
|
|
package engine.db.handlers; |
|
|
|
package engine.db.handlers; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import engine.gameManager.DbManager; |
|
|
|
import engine.objects.Boon; |
|
|
|
import engine.objects.Boon; |
|
|
|
import org.pmw.tinylog.Logger; |
|
|
|
import org.pmw.tinylog.Logger; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.sql.Connection; |
|
|
|
|
|
|
|
import java.sql.PreparedStatement; |
|
|
|
import java.sql.ResultSet; |
|
|
|
import java.sql.ResultSet; |
|
|
|
import java.sql.SQLException; |
|
|
|
import java.sql.SQLException; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
@ -22,30 +25,27 @@ public class dbBoonHandler extends dbHandlerBase { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ArrayList<Boon> GET_BOON_AMOUNTS_FOR_ITEMBASEUUID(int itemBaseUUID){ |
|
|
|
public ArrayList<Boon> GET_BOON_AMOUNTS_FOR_ITEMBASE(int itemBaseUUID) { |
|
|
|
|
|
|
|
|
|
|
|
ArrayList<Boon>boons = new ArrayList<>(); |
|
|
|
ArrayList<Boon> boons = new ArrayList<>(); |
|
|
|
Boon thisBoon; |
|
|
|
Boon thisBoon; |
|
|
|
prepareCallable("SELECT * FROM `static_item_boons` WHERE `itemBaseID` = ?"); |
|
|
|
|
|
|
|
setInt(1, itemBaseUUID); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try (Connection connection = DbManager.getConnection(); |
|
|
|
ResultSet rs = executeQuery(); |
|
|
|
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_item_boons` WHERE `itemBaseID` = ?")) { |
|
|
|
|
|
|
|
|
|
|
|
while (rs.next()) { |
|
|
|
preparedStatement.setInt(1, itemBaseUUID); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ResultSet rs = preparedStatement.executeQuery(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (rs.next()) { |
|
|
|
thisBoon = new Boon(rs); |
|
|
|
thisBoon = new Boon(rs); |
|
|
|
boons.add(thisBoon); |
|
|
|
boons.add(thisBoon); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (SQLException e) { |
|
|
|
} catch (SQLException e) { |
|
|
|
Logger.error("GetBoonAmountsForItembaseUUID: " + e.getErrorCode() + ' ' + e.getMessage(), e); |
|
|
|
Logger.error(e); |
|
|
|
} finally { |
|
|
|
|
|
|
|
closeCallable(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return boons; |
|
|
|
return boons; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|