专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > Java Exception

org.hibernate.exception.GenericJDBCException: Cannot open connection 异常!

发布时间:2010-06-05 12:34:34 文章来源:www.iduyao.cn 采编人员:星星草

  org.hibernate.exception.GenericJDBCException: Cannot open connection
  org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91)
  org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:79)
  org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
  org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
  org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:307)
  org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:109)
  org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:134)
  org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
  org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1236)
  test.hibernate.factory.CustomerFactory.getAll(CustomerFactory.java:38)
  test.hibernate.servlet.CustomerControl.doPost(CustomerControl.java:28)
  test.hibernate.servlet.CustomerControl.doGet(CustomerControl.java:77)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
  test.util.RequestEncodingFilter.doFilter(RequestEncodingFilter.java:35)
 
 
  这是我的映射文件
  <!DOCTYPE hibernate-configuration PUBLIC
  "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
  "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
 
  <hibernate-configuration>
  <session-factory>
  <!--数据库URL-->
  <property name="hibernate.connection.url">
  jdbc:JSQLConnect://localhost:1433/MoneyManage
  </property>
  <!--数据库驱动-->
  <property name="hibernate.connection.driver_class">
  com.jnetdirect.jsql.JSQLDriver
  </property>
  <!--数据库用户名-->
  <property name="hibernate.connection.username">
  sa
  </property>
  <!--数据库密码-->
  <property name="hibernate.connection.password">
  123
  </property>
  <!--对应Dialect-->
  <property name="dialect">
  org.hibernate.dialect.SQLServerDialect
  </property>
  <property name="show_sql">
  true
  </property>
  <!--是否使用外连接-->
  <property name="hibernate.use_outer_join">
  true
  </property>
  <!--事物管理类型-->
  <property name="hibernate.transaction.factory_class">
  org.hibernate.transaction.JDBCTransactionFactory
  </property>
  <!--数据库连接池-->
  <property name="hibernate.c3p0.max_size">5</property>
  <property name="hibernate.c3p0.min_size">2</property>
  <property name="hibernate.c3p0.timeout">15000</property>
  <property name="hibernate.c3p0.max_statements">1000</property>
  <property name="hibernate.c3p0.idle_test_period">3000</property>
  <property name="hibernate.c3p0.acquire_increment">5</property>
  <property name="hibernate.c3p0.validate">false</property>
  <property name="hibernate.connection.provider_class">
  org.hibernate.connection.C3P0ConnectionProvider
  </property>
 
  <!--映射文件-->
  <mapping resource="org/mytest/hibernate/CostInfo.hbm.xml"/>
  <mapping resource="org/mytest/hibernate/CostType.hbm.xml"/>
  <mapping resource="org/mytest/hibernate/Income.hbm.xml"/>     

友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: