From ff1019186f1f58b04c32cbfe16eea4b23478aea2 Mon Sep 17 00:00:00 2001 From: wenshao Date: Fri, 15 Jul 2011 09:13:20 +0000 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E5=87=BA=E9=94=99=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://code.alibabatech.com/svn/druid/trunk@446 b9813039-fb51-4c41-a8b9-e21c2acb5095 --- .../com/alibaba/druid/util/JdbcUtils.java | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/alibaba/druid/util/JdbcUtils.java b/src/main/java/com/alibaba/druid/util/JdbcUtils.java index 04362eef8f..d45c1963a6 100644 --- a/src/main/java/com/alibaba/druid/util/JdbcUtils.java +++ b/src/main/java/com/alibaba/druid/util/JdbcUtils.java @@ -32,10 +32,14 @@ import java.sql.Types; import java.util.Enumeration; import java.util.Properties; +import com.alibaba.druid.logging.Log; +import com.alibaba.druid.logging.LogFactory; + /** * @author wenshao */ public final class JdbcUtils { + private final static Log LOG = LogFactory.getLog(JdbcUtils.class); private static final Properties driverUrlMapping = new Properties(); @@ -57,7 +61,7 @@ public final class JdbcUtils { driverUrlMapping.putAll(property); } } catch (Exception e) { - e.printStackTrace(); // error skip + LOG.error("load druid-driver.properties error", e); } } @@ -65,8 +69,8 @@ public final class JdbcUtils { if (x != null) { try { x.close(); - } catch (SQLException e) { - e.printStackTrace(); + } catch (Exception e) { + LOG.error("close connection error", e); } } } @@ -75,8 +79,8 @@ public final class JdbcUtils { if (x != null) { try { x.close(); - } catch (SQLException e) { - e.printStackTrace(); + } catch (Exception e) { + LOG.error("close statement error", e); } } } @@ -85,8 +89,8 @@ public final class JdbcUtils { if (x != null) { try { x.close(); - } catch (SQLException e) { - e.printStackTrace(); + } catch (Exception e) { + LOG.error("close resultset error", e); } } } @@ -95,8 +99,8 @@ public final class JdbcUtils { if (x != null) { try { x.close(); - } catch (IOException e) { - e.printStackTrace(); + } catch (Exception e) { + LOG.error("close error", e); } } }