// Add item in correct FastMap
while(rset.next())
{
if(selectQuery.endsWith("etcitem"))
{
final Item newItem = readItem(rset);
itemData.put(newItem.id, newItem);
}
else if(selectQuery.endsWith("armor"))
{
final Item newItem = readArmor(rset);
armorData.put(newItem.id, newItem);
}
else if(selectQuery.endsWith("weapon"))
{
final Item newItem = readWeapon(rset);
weaponData.put(newItem.id, newItem);
}
}
statement.close();
rset.close();
}
}
catch(Exception e)
{
_log.severe("data error on item"+" "+ e);
}
finally
{
CloseUtil.close(con);
}
if(Config.CUSTOM_ITEM_TABLES)
{
try
{
con = L2DatabaseFactory.getInstance().getConnection(false);
for(String selectQuery : SQL_CUSTOM_ITEM_SELECTS)
{
final PreparedStatement statement = con.prepareStatement(selectQuery);
final ResultSet rset = statement.executeQuery();
// Add item in correct FastMap
while(rset.next())
{
if(selectQuery.endsWith("etcitem"))
{
final Item newItem = readItem(rset);
if(itemData.containsKey(newItem.id))
{
itemData.remove(newItem.id);
}
itemData.put(newItem.id, newItem);
}
else if(selectQuery.endsWith("armor"))
{
final Item newItem = readArmor(rset);
if(armorData.containsKey(newItem.id))
{
armorData.remove(newItem.id);
}
armorData.put(newItem.id, newItem);
}
else if(selectQuery.endsWith("weapon"))
{
final Item newItem = readWeapon(rset);
if(weaponData.containsKey(newItem.id))
{
weaponData.remove(newItem.id);
}