您的位置:首页 > 博客中心 > 数据库 >

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

时间:2022-03-13 22:46


gxlsystem.com,布布扣
gxlsystem.com,布布扣
gxlsystem.com,布布扣

首先说明一下,在本地上是可以的: gxlsystem.com,布布扣

但是在将这个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

gxlsystem.com,布布扣




nested exception is org.hibernate.exception.GenericJDBCException: Cannot open connection,布布扣,bubuko.com

热门排行

今日推荐

热门手游