我使用app引擎创建了一个,servlet向数据库发出请求。我已经使用一个本地数据库在本地测试了servlet,它运行得很好,然后我继续在本地测试servlet,但是istead访问了Cloud数据库,这也非常有效。
我的问题出现在我部署servlet之后。一旦部署完所有数据库请求,返回以下内容:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 millisecon
本地开发的web项目 数据库连的是其他云服务器上面的(安装在linux内的mysql) 一切正常,后来把项目发布到腾讯云服务器上面的tomcat,(腾讯云上的tomcat就是我本地用的tomcat版本) 启动报错:
Caused by: org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCExcepti
我在机器myuniversity.edu上设置了一个远程mysql数据库服务器,服务器名为'localhost‘。在它上面我有一个名为'MyDatabase‘的数据库。
I want to connect it through Java.
The connection urls that I have tried are:
jdbc:mysql://myuniversity.edu/localhost
jdbc:mysql://myuniversity.edu/localhost/MyDatabase
jdbc:mysql://myuniversity