List of usage examples for org.apache.commons.dbcp2 Utils closeQuietly
public static void closeQuietly(Statement stmt)
From source file:tools.datasync.core.sampleapp.CamelSeedIntegrationTests.java
private static Connection createConnection(String dbName, boolean create) { setupDerbyProps();/*from w w w .jav a 2 s.c o m*/ try { Class.forName("org.apache.derby.jdbc.EmbeddedDriver"); } catch (ClassNotFoundException e) { e.printStackTrace(); throw (new RuntimeException("Could not load derby driver")); } Connection conn = null; try { conn = DriverManager.getConnection("jdbc:derby:" + dbName + ";create=true"); } catch (SQLException e) { Utils.closeQuietly(conn); throw (new RuntimeException(e)); } return (conn); }