错误如下:
org.hibernate.exception.JDBCConnectionException: could not execute query
com.microsoft.sqlserver.jdbc.SQLServerException: Connection reset
代码: public List UserData(String queryStr){

Session session = HibernateSessionFactory.getSession();
Transaction ts = session.beginTransaction();
List list = session.createQuery(queryStr).list();

return list;
}
hibernate.cfg.xml配置
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"><!-- Generated by MyEclipse Hibernate Tools.                   -->
<hibernate-configuration> <session-factory>
<property name="dialect">
org.hibernate.dialect.SQLServerDialect
</property>
<property name="connection.url">
jdbc:sqlserver://otherhost:1433; DatabaseName=db
</property>
<property name="connection.username">sa</property>
<property name="connection.password">123456</property>
<property name="connection.driver_class">
com.microsoft.sqlserver.jdbc.SQLServerDriver
</property>
<property name="myeclipse.connection.profile">
com.microsoft.sqlserver.jdbc.SQLServerDriver
</property>

<mapping resource="com/lzu/jp/database/TDAt.hbm.xml" />
<mapping resource="com/lzu/jp/database/TBGr.hbm.xml" />
<mapping resource="com/lzu/jp/database/TBCo.hbm.xml" />
<mapping resource="com/lzu/jp/database/TDLe.hbm.xml" /> </session-factory></hibernate-configuration>