In my class I have instantiated different flavors of JDBC database access to achieve different scenarios.

Class{
Constructor(){
// classic Spring JDBC approach
super.setDataSource(SpringApplicationContextLoader .getJDBCTemplate()
.getDataSource());
jdbcTemplate = super.getJdbcTemplate();
// for making proper usage of temporary tables and different combinations with named parameters Template
scds = new SingleConnectionDataSource(jdbcTemplate.getDataSou rce()
.getConnection(), true);
scdsJdbcTemplate = new JdbcTemplate(scds);
namedParameterJdbcTemplateForSCDS = new NamedParameterJdbcTemplate(scds);
namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(jdbcTemplate.getDataSou rce());
}


getDatafromAbcTable(){ //make use of traditional template i.e. jdbc template
}

getDatafromDefTable(){ //make use of named parameter with single source
}

getDatafromGhiTable(){ //make use of named parameter
}
}


There are different methods that we call to fetch data from 'Abc','Def' or 'Ghi' Table. But the problem is that while I call this from a different class (creating an object of the above class), I found that there are connections created every-time I create an object of the above class. As I have used SingleConnectionDataSource() and the other objects also get initialized while I call this constructor, I am facing connections issues if I repeatedly call the above methods from other classes. I cannot increase the connections available. I need to figure out a better approach to write the above class. Please guide me out.