错误如下:
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>
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>
解决方案 »
- 求助:.jar文件打开提示 无法启动该应用程序
- tomcat的totalMemory方法返回的内存只升不降吗?
- 求助《在线等。。。》
- javaweb开发,struts标签问题,html:multibox
- 如何将数据库里的数据生成excel文件?高手请进!!
- 关于在多线程中使用Spring的事务管理:
- 在struts环境中使用validation框架出现ServletException的问题。
- 为什么我在配置JBUILDER2005中的服务器weblogic8.1时候出现以下错误?
- 初学一个简单的EJB,但是编译不过去,请高手指点!!!
- 如何对json数据进行修剪
- Spring配置文件报错啦。。。。
- 网站中的jsp页面接入到支付宝网关接口、易宝支付网关接口?
connecttion reset2. 错误的颜色好难看