PreparedStatement stmt = null;
DAOFactory df = null;
StringBuffer sql = new StringBuffer();
try {
DefaultConnectionFactory dcf = DefaultConnectionFactory.create();
df = DAOFactory.getInstance(null);
conn = dcf.getConnection();
sql.append(" DELETE FROM bpm_acltable WHERE defid = ? AND defaultuser IS NOT NULL ");
stmt = conn.prepareStatement(sql.toString());
stmt.setInt(1, defId);
stmt.execute();
} catch (Exception e) {
e.printStackTrace();
} finally {
if (stmt != null) try { stmt.close(); } catch (Exception e2) {}
if (conn != null) try { conn.close(); } catch (Exception e2) {}
}
try {
DefaultConnectionFactory dcf = DefaultConnectionFactory.create();
df = DAOFactory.getInstance(null);
String strSeq = df.getSequenceSql("ACLTABLE");
String seqColun = "";
if (UEngineUtil.isNotEmpty(strSeq)) {
strSeq = ", " + strSeq;
seqColun = ", acltableid";
}
sql.setLength(0);
sql.append(" INSERT INTO bpm_acltable (defid, defaultuser, permission").append(seqColun).append(") VALUES (?, ?, ?").append(strSeq).append(") ");
conn = dcf.getConnection();
if (permissionA != null) {
for (String s : permissionA) {
// KeyGeneratorDAO kg = df.createKeyGenerator("ACLTABLE", new HashMap());
// kg.select();