//create a temporary table
Statement s = con.createStatement();
try
{
s.executeUpdate("drop table temporaryObjectTable");
}
catch (SQLException e)
{
}
s.executeUpdate("create table temporaryObjectTable" + "
(object_id int NOT NULL PRIMARY KEY)");
s.executeUpdate("insert into temporaryObjectTable (object_id)"
+ " select obj_id from characters");
s.executeUpdate("insert into temporaryObjectTable (object_id)"
+ " select object_id from items");
s.executeUpdate("insert into temporaryObjectTable (object_id)"
+ " select clan_id from clan_data");
//s.executeUpdate("insert into temporaryObjectTable
(object_id)" + " select crest_id from clan_data where crest_id > 0");
s.executeUpdate("insert into temporaryObjectTable (object_id)"
+ " select object_id from ItemsOnGround");
ResultSet result = s.executeQuery("select count(object_id) from
temporaryObjectTable");
result.next();
int size = result.getInt(1);
int[] tmp_obj_ids = new int[size];
// _log.debugr("tmp table size: " + tmp_obj_ids.length);
result.close();
result = s.executeQuery("select object_id from
temporaryObjectTable ORDER BY object_id");
int idx = 0;
while (result.next())
{
tmp_obj_ids[idx++] = result.getInt(1);
}
Таким образом, получается, что в любой момент, когда кто-то что-то покупает или создает клан или выполняет другое действие, приводящее к новому ObjectID производится удаление таблицы и создание новой, а потом к последнему значению в ней добавляется 1. Или я не прав?