Nitesh, take a look at the MyBatis User's Guide, specifically section 3.1.8 Environments. You don't need Spring to obtain a pooled connection, although if you are already using Spring, you have that option, as Huzaifah points out. Using a pooled datasource, you can specify poolMaximumActiveConnections, poolMaximumIdleConnections, and several other options.
You don't mention your operating environment for your application. Depending on that, you may have better alternatives. For example, if you are implementing a web application and you are using an application server such as Tomcat, those servers already have provisions for pooled data sources, and you are better off using those facilities.