Creating Connection in Separate Class (ConnectionFactory)

package com.srivastava.mybatis.common;

import java.io.IOException;
import java.io.Reader;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

public class ConnectionFactory 
{
	private static SqlSessionFactory 
		sqlSessionFactory = null;
	static
	{
		try 
		{
			Reader resource = 
				Resources.getResourceAsReader
					("sqlMapConfig.xml");
			sqlSessionFactory = new 
			SqlSessionFactoryBuilder().build(resource);
		}
		catch (IOException e) 
		{
			e.printStackTrace();
		}
	}
	public static SqlSessionFactory
		getSqlSessionFactory()
	{
	return sqlSessionFactory;
	}
}

ConnectionFactory class maintain the connection with the Database with the help of SqlSessionFactoryBuilder