Commit f6306203 authored by Greg Thomas's avatar Greg Thomas

Rework commit to make diff clearer

parent 9acf53b8
......@@ -133,6 +133,17 @@ public class JDBCAdminProvider implements AdminProvider {
}
}
private void changeAdmins(final Connection con, final String sql, final List<JID> admins) throws SQLException {
if (!admins.isEmpty()) {
try (final PreparedStatement pstmt = con.prepareStatement(sql)) {
for (final JID jid : admins) {
pstmt.setString(1, jid.getNode());
pstmt.execute();
}
}
}
}
@Override
public void setAdmins(List<JID> newAdmins) {
if (isReadOnly()) {
......@@ -156,17 +167,6 @@ public class JDBCAdminProvider implements AdminProvider {
}
}
private void changeAdmins(final Connection con, final String sql, final List<JID> admins) throws SQLException {
if (!admins.isEmpty()) {
try (final PreparedStatement pstmt = con.prepareStatement(sql)) {
for (final JID jid : admins) {
pstmt.setString(1, jid.getNode());
pstmt.execute();
}
}
}
}
@Override
public boolean isReadOnly() {
return insertAdminsSQL.isEmpty() || deleteAdminsSQL.isEmpty();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment