You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.7 KiB
51 lines
1.7 KiB
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . |
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· |
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ |
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ |
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ |
|
// Magicbane Emulator Project © 2013 - 2022 |
|
// www.magicbane.com |
|
|
|
|
|
package engine.db.handlers; |
|
|
|
import engine.gameManager.DbManager; |
|
import engine.objects.ItemBase; |
|
import org.pmw.tinylog.Logger; |
|
|
|
import java.sql.Connection; |
|
import java.sql.PreparedStatement; |
|
import java.sql.ResultSet; |
|
import java.sql.SQLException; |
|
|
|
public class dbItemBaseHandler extends dbHandlerBase { |
|
|
|
public dbItemBaseHandler() { |
|
|
|
} |
|
|
|
public void LOAD_ALL_ITEMBASES() { |
|
|
|
ItemBase itemBase; |
|
int recordsRead = 0; |
|
|
|
try (Connection connection = DbManager.getConnection(); |
|
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_itembase")) { |
|
|
|
ResultSet rs = preparedStatement.executeQuery(); |
|
|
|
while (rs.next()) { |
|
recordsRead++; |
|
itemBase = new ItemBase(rs); |
|
|
|
ItemBase.addToCache(itemBase); |
|
} |
|
|
|
} catch (SQLException e) { |
|
Logger.error(e); |
|
} |
|
|
|
Logger.info("read: " + recordsRead + " cached: " + ItemBase.getUUIDCache().size()); |
|
} |
|
|
|
}
|
|
|