From a45e620946c8e748b35258b7f8813d1c788bae37 Mon Sep 17 00:00:00 2001 From: snowleo Date: Mon, 6 Jun 2011 22:29:08 +0200 Subject: Major cleanup of the Protect code --- .../essentials/protect/data/ProtectedBlockMySQL.java | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMySQL.java') diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMySQL.java b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMySQL.java index c246aca91..8e50ce248 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMySQL.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMySQL.java @@ -5,6 +5,8 @@ import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; +import java.util.logging.Level; +import java.util.logging.Logger; public class ProtectedBlockMySQL extends ProtectedBlockJDBC { @@ -50,10 +52,24 @@ public class ProtectedBlockMySQL extends ProtectedBlockJDBC { } } finally { if (testRS != null) { - testRS.close(); + try + { + testRS.close(); + } + catch (SQLException ex) + { + Logger.getLogger(ProtectedBlockMySQL.class.getName()).log(Level.SEVERE, null, ex); + } } if (testPS != null) { - testPS.close(); + try + { + testPS.close(); + } + catch (SQLException ex) + { + Logger.getLogger(ProtectedBlockMySQL.class.getName()).log(Level.SEVERE, null, ex); + } } } } -- cgit v1.2.3