I need to set query timeout for various ranges of queries depending on the data they pull. ie, each query will have their own timeout time. 

say for instance, query A - > 10 MINUTES  

 query B - > 5 MINUTES 

Now how do I set these different timings using the getJDBCTemplate(). When I try the below code snippet, the timeout is overidden and both the queries are timing out on the same time irrespective of the setting! 

```
Thread t1 = new Thread(new Runnable() {
public void run() {
       getJdbcTemplate().setQueryTimeout(5);
       List t = getJdbcTemplate()
                   .query("select top 10000 * from ABC",new RowMapper<T>(){
                   ..
       });

Thread t2 = new Thread(new Runnable() {
public void run() {
       getJdbcTemplate().setQueryTimeout(10);
       List t = getJdbcTemplate()
        .query("select top 30000 * from XYZ",new RowMapper<T>() {
                        ..
       });
t1.start();
t2.start();  

```

In the above context, both the queries are timing out at 5th min or 10th min. Is there a way to set it up based on the query ? please suggest!

**[UPDATE]**

```
<bean id="dSource" class="com.xyz.DSource" >
    <property name="dataSource" ref="dataSource"/>
</bean>

public abstract class AbstractData  {
    private DSource dSource;
    public JdbcTemplate getJdbcTemplate(){

        ApplicationContext Ctx = ContextUtils.getApplicationContext(); 
        dSource = (DSource)Ctx.getBean("dSource");
        return dSource.getJDBCTemplate();
         }
}

public class DSource extends JdbcDaoSupport{
    public JdbcTemplate getJdbcTemplate(){
        return getJdbcTemplate();
    }
}

public Class Dao extends AbstractData{
     public void callQuery(){
        [AS already posted, t1 and t2 are 2 threads for 2 diff methods/queries using 
         getJDBCTemplate Of abstract classs]

       Thread 1 
       Thread 2
     }

}

```