session没有为空,但是我贴源码上来看嘛
public class messageDao {
//private String url = "jdbc:oracle:thin:@localhost:1521:orcl"; // URL地址
public List<Message> queryMessageList(String command, String description) {
DBaccess dbaccess = new DBaccess();
List<Message> messageList = new ArrayList<Message>();
SqlSession sqlsession = null;
try {
sqlsession = dbaccess.getSqlSession();
// 通过SqlSession 对象去执行sql语句
messageList = sqlsession.selectList("Message.queryMessageList");
} catch (IOException e) {
e.printStackTrace();
} finally {
if (sqlsession != null) {
System.out.println("连接成功,准备关闭!2");
sqlsession.close();
} else {
System.out.println("失败222!");
}
}
return messageList;
}