??????????????myBatis???orm??????spring???????????????д??????????????????????????????????????????????
?????????????????£?

 

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.SqlSessionUtils;
import org.railway.com.trainplan.entity.QueryResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.util.Assert;
/**
* ????????????????????????myBatis orm????
* ????????????????????????и???<br>
*
* JDK?汾??JDK1.6
* @version 1.0
*/
@Repository
public class BaseDao {
private static final Logger log = Logger.getLogger(BaseDao.class);
@Autowired
public SqlSessionTemplate sqlSession;
/**
* ???????????????
* @return
*/
private Connection getConnection(){
Connection connection = SqlSessionUtils.getSqlSession(
sqlSession.getSqlSessionFactory()?? sqlSession.getExecutorType()??
sqlSession.getPersistenceExceptionTranslator()).getConnection();
return connection;
}