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