Skip to content

Commit

Permalink
Add schema and better logging
Browse files Browse the repository at this point in the history
  • Loading branch information
kikkia committed Feb 15, 2019
1 parent df7c9dd commit 8a3b03b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Binary file added res/db/v3dbschema.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/main/java/com/bot/db/ChannelDAO.java
Expand Up @@ -64,7 +64,7 @@ public void addVoiceChannel(VoiceChannel voiceChannel) {
preparedStatement.setString(3, voiceChannel.getName());
preparedStatement.execute();
} catch (SQLException e) {
LOGGER.log(Level.SEVERE, "Failed to add voice channel to the db " +e.getSQLState());
LOGGER.log(Level.SEVERE, "Failed to add voice channel to the db " +e.getMessage());
} finally {
close(preparedStatement, null);
}
Expand All @@ -81,7 +81,7 @@ public void addTextChannel(TextChannel textChannel) {
preparedStatement.setString(3, textChannel.getName());
preparedStatement.execute();
} catch (SQLException e) {
LOGGER.log(Level.SEVERE, "Failed to add text channel to the db: " + e.getSQLState());
LOGGER.log(Level.SEVERE, "Failed to add text channel to the db: " + e.getMessage());
} finally {
close(preparedStatement, null);
}
Expand All @@ -96,7 +96,7 @@ public void removeVoiceChannel(VoiceChannel channel) {
preparedStatement.setString(1, channel.getId());
preparedStatement.execute();
} catch (SQLException e) {
LOGGER.log(Level.SEVERE, "Failed to remove a voice channel from db: " +e.getSQLState());
LOGGER.log(Level.SEVERE, "Failed to remove a voice channel from db: " +e.getMessage());
} finally {
close(preparedStatement, null);
}
Expand All @@ -111,7 +111,7 @@ public void removeTextChannel(TextChannel channel) {
preparedStatement.setString(1, channel.getId());
preparedStatement.execute();
} catch (SQLException e) {
LOGGER.log(Level.SEVERE, "Failed to remove a text channel from db: " +e.getSQLState());
LOGGER.log(Level.SEVERE, "Failed to remove a text channel from db: " +e.getMessage());
} finally {
close(preparedStatement, null);
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/bot/db/MembershipDAO.java
Expand Up @@ -87,7 +87,7 @@ public void removeUserMembershipToGuild(String userId, String guildId) {
statement.setString(2, userId);
statement.execute();
} catch (SQLException e) {
LOGGER.log(Level.SEVERE, "Failed to remove user membership from guild. " + e.getSQLState());
LOGGER.log(Level.SEVERE, "Failed to remove user membership from guild. " + e.getMessage());
} finally {
close(statement, null);
}
Expand All @@ -108,7 +108,7 @@ private void addMembership(String membershipInsertQuery, User user, Guild guild)
statement.setString(2, user.getId());
statement.execute();
} catch (SQLException e) {
LOGGER.log(Level.SEVERE, "Failed to add membership for user to guild: " + e.getSQLState());
LOGGER.log(Level.SEVERE, "Failed to add membership for user to guild: " + e.getMessage());
} finally {
close(statement, null);
}
Expand All @@ -122,7 +122,7 @@ private void addUser(String userInseryQuery, User user) {
statement.setString(2, user.getName());
statement.execute();
} catch (SQLException e) {
LOGGER.log(Level.SEVERE, "Failed to add user to db: " +e.getSQLState());
LOGGER.log(Level.SEVERE, "Failed to add user to db: " +e.getMessage());
} finally {
close(statement, null);
}
Expand Down

0 comments on commit 8a3b03b

Please sign in to comment.