nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection

nested exception is org.hibernate.exception.GenericJDBCException:

Cannot open connection

网页上大致错误信息:

首先说明一下,在本地上是可以的:

但是在将这个WAR包放到公司服务器上就不行了,老是报这个错误:

java.net.UnknownHostException: www.hongshanwang.com

这是为什么呢?

很明显是数据库连接语言出错,因为在本地可以,在外网就不行了,这里要说一下,局域网访问数据库和外网访问还是有很多区别的。

出错的时,数据库连接语言如下:

jdbc.url= jdbc:mysql://www.hongshanwang.com:3306/tdjdb?zeroDateTimeBehavior=convertToNull&characterEncoding=UTF-8&characterSetResults=UTF-8

jdbc.username=tdj*****

jdbc.password=xwh********

解决这个问题是方法是:

jdbc.url= jdbc:mysql://220.231.193.7:3306/tdjdb?zeroDateTimeBehavior=convertToNull&characterEncoding=UTF-8&characterSetResults=UTF-8

jdbc.username=tdj*****

jdbc.password=xwh********

其实,也就是把域名www.hongshanwang.com,ping成IP地址,220.231.193.7,而已。这样这个问题就解决了。KOS。

nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection

时间: 2024-08-08 18:45:10

nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection的相关文章

HTTP Status 500 - Request processing failed; nested exception is org.hibernate.exception.GenericJDBCException: could not execute statement

1.什么操作出现:当我在项目中添加产品或者修改时,浏览器出现HTTP Status 500 - Request processing failed; nested exception is org.hibernate.exception.GenericJDBCException: could not execute statement; Ecplise出现这个: 十二月 20, 2017 1:51:02 下午 org.apache.catalina.core.StandardWrapperVal

HTTP Status 500 - JDBC exception on Hibernate data access: SQLException for SQL [n/a]; SQL state [HY000]; error code [1364]; could not execute statement; nested exception is org.hibernate.exception.Ge

HTTP Status 500 - JDBC exception on Hibernate data access: SQLException for SQL [n/a]; SQL state [HY000]; error code [1364]; could not execute statement; nested exception is org.hibernate.exception.GenericJDBCException: could not execute statement 翻译

Exception occurred during processing request: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet

今天在编码的时候遇到了 Exception occurred during processing request: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet这个问题,也是找了老半天不懂什么原因,后来找了好多论坛,总结了一下,只要出现了sql的问题,基本都是bean或者XXX.

org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.JDBCConnectionException: Cannot open con

org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.JDBCConnectionException: Cannot open connection org.springframework.orm.hibernate3.Hiberna

code is 9998;desc is 插入失败exception is org.hibernate.exception.JDBCConnectionException: Could not op

1.错误描述 [ERROR:]2015-05-05 09:27:12,090 [插入失败] org.hibernate.exception.JDBCConnectionException: Could not open connection at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:132) at org.hibernate.exce

Caused by: code is 9998;desc is dao exception is org.hibernate.exception.DataException: error execu

1.错误描述 exception is org.hibernate.exception.DataException: error executing work at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingM

exception is org.hibernate.exception.DataException: Could not execute JDBC batch update at

没有什么问题,但是却报了Could not execute JDBC batch update的错,主要是配置文件设置了关联,数据却没有关联造成的,只要数据正确就没有问题. 另外,造成这个原因的还可能是数据库的驱动jar包不支持. 还有就是csdn的dizhang的专栏提到的下面问题引起的: 1.因为Hibernate Tools(或者Eclipse本身的Database Explorer)生成*.hbn.xml工具中包含有catalog="***"(*表示数据库名称)这样的属性,将该

sping异常记录----Could not execute JDBC batch update; nested exception is org.hibernate.excepti

今天在练习如何SSH中进行单元测试的时候出现下列异常: org.springframework.dao.DataIntegrityViolationException: Could not execute JDBC batch update; nested exception is org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.springframe

org hibernate exception ConstraintViolationException Could

1.错误描述 type Exception report message Could not execute JDBC batch update; nested exception is org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update description The server encountered an internal error that prevente