use of org.jooq.DSLContext in project Skree by Skelril.
the class RegionManager method writeRemRegion.
private void writeRemRegion(Collection<RegionDatabaseHandle> oldRegions) {
try (Connection con = SQLHandle.getConnection()) {
DSLContext create = DSL.using(con);
con.setAutoCommit(false);
for (RegionDatabaseHandle region : oldRegions) {
create.deleteFrom(REGIONS).where(REGIONS.UUID.equal(region.getID().toString())).execute();
}
con.commit();
} catch (SQLException e) {
e.printStackTrace();
}
}
use of org.jooq.DSLContext in project Skree by Skelril.
the class ServerSideWorldRegistar method register.
public void register(String name) {
try (Connection con = SQLHandle.getConnection()) {
DSLContext create = DSL.using(con);
Timestamp createdTime = new Timestamp(System.currentTimeMillis());
create.insertInto(WORLDS).columns(WORLDS.NAME, WORLDS.CREATED_AT).values(name, createdTime).onDuplicateKeyUpdate().set(WORLDS.CREATED_AT, createdTime).execute();
} catch (SQLException e) {
e.printStackTrace();
}
}
Aggregations