Code example for Statement

Methods: setQueryTimeout

0
    @Override 
    public Object createStatement(Object proxy, Method method, Object[] args, Object statement, long time) {
        if (statement instanceof Statement && timeout > 0) {
            Statement s = (Statement)statement;
            try { 
                s.setQueryTimeout(timeout);
            }catch (SQLException x) {
                log.warn("[QueryTimeoutInterceptor] Unable to set query timeout:"+x.getMessage(),x);
            } 
        } 
        return statement;
    } 
 
    @Override 
    public void closeInvoked() { 
    } 
 
}