/** * {@inheritDoc} * * <p>此操作会清空 Cache 中 authorities 对应的 value,下次请求时装载。 * * @see #getAll() */ public void delete(Authority auth) throws JibuException { Connection conn = null; try { conn = ConnectionUtils.getConnection(); authDAO.delete(conn, auth); DbUtils.commitAndClose(conn); Cache cache = CacheUtils.getAuthCache(); cache.remove("authorities"); } catch (SQLException e) { DbUtils.rollbackAndCloseQuietly(conn); throw new JibuException(e.getMessage()); } }
public static void main(String[] args) { Connection conn = null; try { String schema = args[0]; String table = args[1]; String fullClassName = args[2]; conn = DbConnection.getConnection(); DtoCreater fks = new DtoCreater(conn, schema, table); fks.execute(schema, table, fullClassName); } catch (Exception e) { DbUtils.rollbackAndCloseQuietly(conn); return; } finally { DbUtils.closeQuietly(conn); } }