From b9fc6a0b2bd89d7dcd5b97540a03353a096b55bd Mon Sep 17 00:00:00 2001 From: snowleo Date: Mon, 8 Aug 2011 15:56:23 +0200 Subject: Prevent closing already closed statements --- .../protect/data/ProtectedBlockJDBC.java | 35 +++++++++++++++++----- 1 file changed, 28 insertions(+), 7 deletions(-) (limited to 'EssentialsProtect/src/com') diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockJDBC.java b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockJDBC.java index e24a71b80..afbcedb72 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockJDBC.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockJDBC.java @@ -76,7 +76,10 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock { try { - ps.close(); + if (!ps.isClosed()) + { + ps.close(); + } } catch (SQLException ex) { @@ -117,7 +120,10 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock { try { - ps.close(); + if (!ps.isClosed()) + { + ps.close(); + } } catch (SQLException ex) { @@ -195,7 +201,10 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock { try { - ps.close(); + if (!ps.isClosed()) + { + ps.close(); + } } catch (SQLException ex) { @@ -241,7 +250,10 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock { try { - ps.close(); + if (!ps.isClosed()) + { + ps.close(); + } } catch (SQLException ex) { @@ -296,7 +308,10 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock { try { - ps.close(); + if (!ps.isClosed()) + { + ps.close(); + } } catch (SQLException ex) { @@ -356,7 +371,10 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock { try { - ps.close(); + if (!ps.isClosed()) + { + ps.close(); + } } catch (SQLException ex) { @@ -398,7 +416,10 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock { try { - ps.close(); + if (!ps.isClosed()) + { + ps.close(); + } } catch (SQLException ex) { -- cgit v1.2.3