mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-27 08:50:51 +01:00
Add catch.
This commit is contained in:
parent
5bd184a03a
commit
10f860dc0c
@ -28,16 +28,21 @@ public class ModToolUserInfoComposer extends MessageComposer {
|
|||||||
this.response.init(Outgoing.ModToolUserInfoComposer);
|
this.response.init(Outgoing.ModToolUserInfoComposer);
|
||||||
try {
|
try {
|
||||||
int totalBans = 0;
|
int totalBans = 0;
|
||||||
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT COUNT(*) AS amount FROM bans WHERE user_id = ?")) {
|
|
||||||
|
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection();
|
||||||
|
PreparedStatement statement = connection.prepareStatement("SELECT COUNT(*) AS amount FROM bans WHERE user_id = ?")) {
|
||||||
statement.setInt(1, this.set.getInt("user_id"));
|
statement.setInt(1, this.set.getInt("user_id"));
|
||||||
try (ResultSet set = statement.executeQuery()) {
|
try (ResultSet set = statement.executeQuery()) {
|
||||||
if (set.next()) {
|
if (set.next()) {
|
||||||
totalBans = set.getInt("totalBans");
|
totalBans = set.getInt("totalBans");
|
||||||
}
|
}
|
||||||
|
} catch (SQLException e) {
|
||||||
|
LOGGER.error("Caught SQL exception", e);
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
LOGGER.error("Caught SQL exception", e);
|
LOGGER.error("Caught SQL exception", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.response.appendInt(this.set.getInt("user_id"));
|
this.response.appendInt(this.set.getInt("user_id"));
|
||||||
this.response.appendString(this.set.getString("username"));
|
this.response.appendString(this.set.getString("username"));
|
||||||
this.response.appendString(this.set.getString("look"));
|
this.response.appendString(this.set.getString("look"));
|
||||||
|
Loading…
Reference in New Issue
Block a user