[ 
https://issues.apache.org/jira/browse/DBUTILS-70?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13018028#comment-13018028
 ] 

Henri Yandell commented on DBUTILS-70:
--------------------------------------

Needs to not affect the class' thread safety. Ideally it would support all 8 of 
the setXyz methods on Statement [maybe similar on Connection].

I'd be tempted to handle it as a DataSource wrapper. Create a StatementStrategy 
object to hold your standard settings and place those in the datasource. The 
only issue is how to handle the queries that you don't want to be affected. 

> add setQueryTimeout support to QueryRunner
> ------------------------------------------
>
>                 Key: DBUTILS-70
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-70
>             Project: Commons DbUtils
>          Issue Type: Improvement
>            Reporter: Michael Akerman
>            Priority: Minor
>             Fix For: 1.4
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> java.sql.Statement and java.sql.PrepareStatement support a method called 
> setQueryTimeout.
> It would be nice to add a public setQueryTimeout method to QueryRunner that 
> would pass this parameter through to the underlying Statements or 
> PreparedStatements.
> For most of my applications if a query runs longer than a few seconds, 
> there's something wrong, and I'd like a SQLException in that scenario so I 
> can know there's an issue.
> I'd be happy to submit some code as a proposal.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to