Commit e30ab63d authored by Derek DeMoro's avatar Derek DeMoro Committed by derek

Updating Database


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@192 b35dd754-fafc-0310-a699-88a17e54d16e
parent d2b8e3aa
......@@ -205,7 +205,7 @@ public class DbAuthProvider implements AuthProvider {
pstmt.setString(1, password);
pstmt.setLong(2, userID);
pstmt.execute();
pstmt.executeUpdate();
}
catch (SQLException e) {
Log.error("Exception in DbAuthProvider", e);
......
......@@ -249,12 +249,12 @@ public class DbGroupProvider implements GroupProvider {
// Remove all users in the group.
pstmt = con.prepareStatement(DELETE_GROUP_USERS);
pstmt.setLong(1, groupID);
pstmt.execute();
pstmt.executeUpdate();
pstmt.close();
// Remove the group entry.
pstmt = con.prepareStatement(DELETE_GROUP);
pstmt.setLong(1, groupID);
pstmt.execute();
pstmt.executeUpdate();
pstmt.close();
}
catch (SQLException e) {
......@@ -640,7 +640,7 @@ public class DbGroupProvider implements GroupProvider {
pstmt = con.prepareStatement(DELETE_PROPERTY);
pstmt.setLong(1, groupID);
pstmt.setString(2, name);
pstmt.execute();
pstmt.executeUpdate();
}
catch (SQLException e) {
Log.error(e);
......
......@@ -52,13 +52,13 @@ public class DbChatbotAccountProvider implements ChatbotAccountProvider {
pstmt.setLong(2, DbUserIDProvider.DEFAULT_DOMAIN);
pstmt.setLong(3, DbUserIDProvider.CHATBOT_TYPE);
pstmt.setLong(4, id);
pstmt.execute();
pstmt.executeUpdate();
pstmt = con.prepareStatement(INSERT_CHATBOT_INFO);
pstmt.setLong(1, id);
pstmt.setString(2, "None");
pstmt.setString(3, StringUtils.dateToMillis(now));
pstmt.setString(4, StringUtils.dateToMillis(now));
pstmt.execute();
pstmt.executeUpdate();
}
catch (SQLException e) {
Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
......@@ -100,13 +100,13 @@ public class DbChatbotAccountProvider implements ChatbotAccountProvider {
// Delete the actual chatbot info entry
pstmt = con.prepareStatement(DELETE_CHATBOT_INFO);
pstmt.setLong(1, userID);
pstmt.execute();
pstmt.executeUpdate();
// Delete the actual user ID entry
pstmt = con.prepareStatement(DELETE_CHATBOT_ID);
pstmt.setLong(1, userID);
pstmt.setInt(2, DbUserIDProvider.CHATBOT_TYPE);
pstmt.setLong(3, DbUserIDProvider.DEFAULT_DOMAIN);
pstmt.execute();
pstmt.executeUpdate();
}
catch (Exception e) {
Log.error(e);
......
......@@ -98,7 +98,7 @@ public class DbChatbotInfoProvider implements ChatbotInfoProvider {
pstmt.setString(2, StringUtils.dateToMillis(info.getCreationDate()));
pstmt.setString(3, StringUtils.dateToMillis(info.getModificationDate()));
pstmt.setLong(4, id);
pstmt.execute();
pstmt.executeUpdate();
}
catch (SQLException e) {
Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
......
......@@ -272,6 +272,7 @@ public abstract class BootstrapContainer implements Container, ServiceLookupProv
for (Module module : modules) {
boolean started = false;
try {
System.out.println(module);
module.start();
}
catch (Exception e) {
......
......@@ -30,10 +30,6 @@ public abstract class IQDiscoHandler extends IQHandler {
super(name);
}
protected TrackInfo getTrackInfo() {
TrackInfo trackInfo = super.getTrackInfo();
trackInfo.getTrackerClasses().put(XMPPServer.class, "localServer");
return trackInfo;
}
}
......@@ -403,7 +403,7 @@ public class LdapUserIDProvider implements UserIDProvider {
pstmt.setLong(2, DbUserIDProvider.DEFAULT_DOMAIN);
pstmt.setLong(3, DbUserIDProvider.USER_TYPE);
pstmt.setLong(4, id);
pstmt.execute();
pstmt.executeUpdate();
}
catch (SQLException e) {
Log.error(e);
......
......@@ -108,7 +108,7 @@ public class LdapUserInfoProvider implements UserInfoProvider {
pstmt.setString(5, StringUtils.dateToMillis(info.getCreationDate()));
pstmt.setString(6, StringUtils.dateToMillis(info.getModificationDate()));
pstmt.setLong(7, id);
pstmt.execute();
pstmt.executeUpdate();
}
catch (SQLException e) {
Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
......@@ -262,7 +262,7 @@ public class LdapUserInfoProvider implements UserInfoProvider {
pstmt.setInt(6, 0); // email visible
pstmt.setString(7, StringUtils.dateToMillis(now));
pstmt.setString(8, StringUtils.dateToMillis(now));
pstmt.execute();
pstmt.executeUpdate();
}
catch (SQLException e) {
Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
......
......@@ -58,7 +58,7 @@ public class DbRosterItemProvider implements RosterItemProvider {
pstmt.setInt(5, item.getAskStatus().getValue());
pstmt.setInt(6, item.getRecvStatus().getValue());
pstmt.setString(7, item.getNickname());
pstmt.execute();
pstmt.executeUpdate();
if (item instanceof CachedRosterItemImpl) {
// If a RosterItemImpl we can reuse it by setting the new roster ID
......@@ -103,12 +103,12 @@ public class DbRosterItemProvider implements RosterItemProvider {
pstmt.setInt(3, item.getRecvStatus().getValue());
pstmt.setString(4, item.getNickname());
pstmt.setLong(5, rosterID);
pstmt.execute();
pstmt.executeUpdate();
// Delete old group list
pstmt = con.prepareStatement(DELETE_ROSTER_ITEM_GROUPS);
pstmt.setLong(1, rosterID);
pstmt.execute();
pstmt.executeUpdate();
insertGroups(rosterID, item.getGroups().iterator(), pstmt, con);
......@@ -144,7 +144,7 @@ public class DbRosterItemProvider implements RosterItemProvider {
for (int i = 0; iter.hasNext(); i++) {
pstmt.setInt(2, i);
pstmt.setString(3, (String)iter.next());
pstmt.execute();
pstmt.executeUpdate();
}
}
finally {
......@@ -173,13 +173,13 @@ public class DbRosterItemProvider implements RosterItemProvider {
pstmt = con.prepareStatement(DELETE_ROSTER_ITEM_GROUPS);
pstmt.setLong(1, rosterItemID);
pstmt.execute();
pstmt.executeUpdate();
// Remove roster
pstmt = con.prepareStatement(DELETE_ROSTER_ITEM);
pstmt.setLong(1, rosterItemID);
pstmt.execute();
pstmt.executeUpdate();
}
catch (SQLException e) {
Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
......@@ -214,11 +214,11 @@ public class DbRosterItemProvider implements RosterItemProvider {
for (int i = 0; i < list.size(); i++) {
pstmt = con.prepareStatement(DELETE_ROSTER_ITEM_GROUPS);
pstmt.setLong(1, list.get(i));
pstmt.execute();
pstmt.executeUpdate();
}
pstmt = con.prepareStatement(DELETE_ROSTER);
pstmt.setLong(1, userID);
pstmt.execute();
pstmt.executeUpdate();
}
catch (SQLException e) {
......
......@@ -53,7 +53,7 @@ public class DbUserAccountProvider implements UserAccountProvider {
pstmt.setLong(2, DbUserIDProvider.DEFAULT_DOMAIN);
pstmt.setLong(3, DbUserIDProvider.USER_TYPE);
pstmt.setLong(4, id);
pstmt.execute();
pstmt.executeUpdate();
// Add the user record in jiveUser
pstmt = con.prepareStatement(INSERT_USER);
pstmt.setLong(1, id);
......@@ -65,7 +65,7 @@ public class DbUserAccountProvider implements UserAccountProvider {
Date now = new Date();
pstmt.setString(7, StringUtils.dateToMillis(now));
pstmt.setString(8, StringUtils.dateToMillis(now));
pstmt.execute();
pstmt.executeUpdate();
}
catch (Exception e) {
Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
......@@ -111,25 +111,25 @@ public class DbUserAccountProvider implements UserAccountProvider {
// Remove user from all groups
pstmt = con.prepareStatement(DELETE_USER_GROUPS);
pstmt.setLong(1, userID);
pstmt.execute();
pstmt.executeUpdate();
// Delete all of the users's extended properties
pstmt = con.prepareStatement(DELETE_USER_PROPS);
pstmt.setLong(1, userID);
pstmt.execute();
pstmt.executeUpdate();
// Delete all of the users's vcard properties
pstmt = con.prepareStatement(DELETE_VCARD_PROPS);
pstmt.setLong(1, userID);
pstmt.execute();
pstmt.executeUpdate();
// Delete the actual user entry
pstmt = con.prepareStatement(DELETE_USER);
pstmt.setLong(1, userID);
pstmt.execute();
pstmt.executeUpdate();
// Delete the actual user ID entry
pstmt = con.prepareStatement(DELETE_USER_ID);
pstmt.setLong(1, userID);
pstmt.setInt(2, DbUserIDProvider.USER_TYPE);
pstmt.setLong(3, DbUserIDProvider.DEFAULT_DOMAIN);
pstmt.execute();
pstmt.executeUpdate();
}
catch (Exception e) {
Log.error(e);
......
......@@ -115,7 +115,7 @@ public class DbUserInfoProvider implements UserInfoProvider {
pstmt.setString(5, StringUtils.dateToMillis(info.getCreationDate()));
pstmt.setString(6, StringUtils.dateToMillis(info.getModificationDate()));
pstmt.setLong(7, id);
pstmt.execute();
pstmt.executeUpdate();
}
catch (SQLException e) {
Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
......
......@@ -122,7 +122,7 @@ public class DbUserPropertiesProvider implements UserPropertiesProvider {
pstmt.setLong(1, id);
pstmt.setString(2, name);
pstmt.setString(3, value);
pstmt.execute();
pstmt.executeUpdate();
}
catch (SQLException e) {
Log.error(e);
......@@ -165,7 +165,7 @@ public class DbUserPropertiesProvider implements UserPropertiesProvider {
pstmt.setString(1, value);
pstmt.setString(2, name);
pstmt.setLong(3, id);
pstmt.execute();
pstmt.executeUpdate();
}
catch (SQLException e) {
Log.error(e);
......@@ -207,7 +207,7 @@ public class DbUserPropertiesProvider implements UserPropertiesProvider {
}
pstmt.setLong(1, id);
pstmt.setString(2, name);
pstmt.execute();
pstmt.executeUpdate();
}
catch (SQLException e) {
Log.error(e);
......
......@@ -196,7 +196,7 @@ public class JiveProperties implements Map {
pstmt = con.prepareStatement(INSERT_PROPERTY);
pstmt.setString(1, name);
pstmt.setString(2, value);
pstmt.execute();
pstmt.executeUpdate();
}
catch (SQLException e) {
Log.error(e);
......@@ -217,7 +217,7 @@ public class JiveProperties implements Map {
pstmt = con.prepareStatement(UPDATE_PROPERTY);
pstmt.setString(1, value);
pstmt.setString(2, name);
pstmt.execute();
pstmt.executeUpdate();
}
catch (SQLException e) {
Log.error(e);
......@@ -237,7 +237,7 @@ public class JiveProperties implements Map {
con = DbConnectionManager.getConnection();
pstmt = con.prepareStatement(DELETE_PROPERTY);
pstmt.setString(1, name + "%");
pstmt.execute();
pstmt.executeUpdate();
}
catch (SQLException e) {
Log.error(e);
......
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