@Override public Connection openConnection() { try { return DERBY_HELPER.getConnection(); } catch (SQLException e) { throw new UnableToObtainConnectionException(e); } } });
@Override public Connection openConnection() { try { return DERBY_HELPER.getConnection(); } catch (SQLException e) { throw new UnableToObtainConnectionException(e); } } });
public Handle open(final ConnectionFactory connectionFactory) { try { final long start = System.nanoTime(); Connection conn = prof.executeWithProfiling(ProfilingFeatureType.DAO_CONNECTION, "get", new WithProfilingCallback<Connection, SQLException>() { @Override public Connection execute() throws SQLException { return connectionFactory.openConnection(); } }); final long stop = System.nanoTime(); StatementBuilder cache = statementBuilderFactory.get().createStatementBuilder(conn); Handle h = new BasicHandle(transactionhandler.get(), statementLocator.get(), cache, statementRewriter.get(), conn, globalStatementAttributes, log.get(), timingCollector.get(), mappingRegistry.createChild(), foreman.createChild(), containerFactoryRegistry.createChild()); log.get().logObtainHandle((stop - start) / 1000000L, h); return h; } catch (SQLException e) { throw new UnableToObtainConnectionException(e); } }
/** * Obtain a Handle to the data source wrapped by this DBI instance * * @return an open Handle instance */ public Handle open() { try { final long start = System.nanoTime(); Connection conn = connectionFactory.openConnection(); final long stop = System.nanoTime(); StatementBuilder cache = statementBuilderFactory.get().createStatementBuilder(conn); Handle h = new BasicHandle(transactionhandler.get(), statementLocator.get(), cache, statementRewriter.get(), conn, globalStatementAttributes, log.get(), timingCollector.get(), new MappingRegistry(mappingRegistry), foreman.createChild(), containerFactoryRegistry.createChild()); log.get().logObtainHandle((stop - start) / 1000000L, h); return h; } catch (SQLException e) { throw new UnableToObtainConnectionException(e); } }