鍍金池/ 問答/Java  Linux  數(shù)據(jù)庫/ MyBatis用域名連接數(shù)據(jù)庫出現(xiàn)無法創(chuàng)建事物的問題?

MyBatis用域名連接數(shù)據(jù)庫出現(xiàn)無法創(chuàng)建事物的問題?

org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.)

我之前改成localhost就行了

現(xiàn)在服務器跟數(shù)據(jù)庫不在一個服務器

只能用域名連接

結(jié)果又出現(xiàn)了

回答
編輯回答
單眼皮

換服務器之后 數(shù)據(jù)庫密碼換了吧

2018年3月11日 09:46
編輯回答
毀與悔

無法創(chuàng)建事務和域名連接沒有關系,樓主的錯誤信息是連接異常,查查是不是網(wǎng)絡問題。

2017年3月8日 10:18