@SuppressWarnings("unchecked")
	private <T> T select(String sql, int restype, Object... objects) throws DataStoreException {
		Connection conn = null;
		T ret;
		try {
			conn = dataSource.getConnection();
			Statement state = conn.createStatement();
			log.info("SELECT-->" + sql);
			if (state.execute(sql)) {
				switch (restype) {
				case RESULT_MAPLIST:
					ret = (T) resultSet2MapList(state.getResultSet());
					break;
				case RESULT_LISTLIST:
					ret = (T) resultSet2ListList(state.getResultSet());
					break;
				case RESULT_TABLEBEAN:
					ret = (T) resultSet2TableBean(state.getResultSet(), (String) objects[0]);
					break;
				case RESULT_BOLIST:
					ret = (T) resultSet2BOList(state.getResultSet(), (Class) objects[0]);
					break;

				default:
					throw new DataStoreException("无法识别的结果集类型[" + restype + "]");
				}
			} else {
				throw new DataStoreException("数据操作没有返回结果集.");
			}
			conn.commit();
		} catch (SQLException e) {
			throw new DataStoreException("数据操作失败.", e);
		} finally {
			try {
				if (conn != null && !conn.isClosed()) {
					conn.close();
				}
			} catch (SQLException e) {
				throw new DataStoreException("数据库连接关闭失败.", e);
			}
		}
		return ret;
	}