@Override public void setLoginTimeout(int inVar) throws SQLException { if (realDataSource == null) { bindDataSource(); } realDataSource.setLoginTimeout(inVar); }
@Override public int getLoginTimeout() throws SQLException { if (realDataSource == null) { bindDataSource(); } return realDataSource.getLoginTimeout(); }
@Override public PrintWriter getLogWriter() throws SQLException { if (realDataSource == null) { bindDataSource(); } return realDataSource.getLogWriter(); }
@SuppressWarnings("unchecked") <T> T castRealDS(Class<T> iface) throws SQLException { if (realDataSource == null) { bindDataSource(); } if (iface.isInstance(realDataSource)) { return ((T) realDataSource); } else if (isWrapperFor(iface)) { return unwrap(iface); } else { throw new IllegalStateException("realdatasource type not supported: " + realDataSource); } }
@Override public Connection getConnection() throws SQLException { if (realDataSource == null) { bindDataSource();
@Override public Connection getConnection(String username, String password) throws SQLException { if (realDataSource == null) { bindDataSource(); } final long start = System.nanoTime(); if (this.jdbcEventListenerFactory == null) { this.jdbcEventListenerFactory = JdbcEventListenerFactoryLoader.load(); } final Connection conn; final JdbcEventListener jdbcEventListener = this.jdbcEventListenerFactory.createJdbcEventListener(); final ConnectionInformation connectionInformation = ConnectionInformation.fromDataSource(realDataSource); jdbcEventListener.onBeforeGetConnection(connectionInformation); try { conn = ((DataSource) realDataSource).getConnection(username, password); connectionInformation.setConnection(conn); connectionInformation.setTimeToGetConnectionNs(System.nanoTime() - start); jdbcEventListener.onAfterGetConnection(connectionInformation, null); } catch (SQLException e) { connectionInformation.setTimeToGetConnectionNs(System.nanoTime() - start); jdbcEventListener.onAfterGetConnection(connectionInformation, e); throw e; } return ConnectionWrapper.wrap(conn, jdbcEventListener, connectionInformation); }
@Override public int getLoginTimeout() throws SQLException { if (realDataSource == null) { bindDataSource(); } return realDataSource.getLoginTimeout(); }
@Override public void setLoginTimeout(int inVar) throws SQLException { if (realDataSource == null) { bindDataSource(); } realDataSource.setLoginTimeout(inVar); }
@Override public PrintWriter getLogWriter() throws SQLException { if (realDataSource == null) { bindDataSource(); } return realDataSource.getLogWriter(); }
@SuppressWarnings("unchecked") <T> T castRealDS(Class<T> iface) throws SQLException { if (realDataSource == null) { bindDataSource(); } if (iface.isInstance(realDataSource)) { return ((T) realDataSource); } else if (isWrapperFor(iface)) { return unwrap(iface); } else { throw new IllegalStateException("realdatasource type not supported: " + realDataSource); } }
@Override public Connection getConnection() throws SQLException { if (realDataSource == null) { bindDataSource();
@Override public Connection getConnection(String username, String password) throws SQLException { if (realDataSource == null) { bindDataSource(); } final long start = System.nanoTime(); if (this.jdbcEventListenerFactory == null) { this.jdbcEventListenerFactory = JdbcEventListenerFactoryLoader.load(); } final Connection conn; final JdbcEventListener jdbcEventListener = this.jdbcEventListenerFactory.createJdbcEventListener(); final ConnectionInformation connectionInformation = ConnectionInformation.fromDataSource(realDataSource); jdbcEventListener.onBeforeGetConnection(connectionInformation); try { conn = ((DataSource) realDataSource).getConnection(username, password); connectionInformation.setConnection(conn); connectionInformation.setTimeToGetConnectionNs(System.nanoTime() - start); jdbcEventListener.onAfterGetConnection(connectionInformation, null); } catch (SQLException e) { connectionInformation.setTimeToGetConnectionNs(System.nanoTime() - start); jdbcEventListener.onAfterGetConnection(connectionInformation, e); throw e; } return ConnectionWrapper.wrap(conn, jdbcEventListener, connectionInformation); }