第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定

關(guān)于jdbc.properties文件中的書寫格式問題會造成數(shù)據(jù)的讀寫的失敗問題

老師,是這樣的:

如果我是這樣子寫的

driver = com.mysql.jdbc.Driver
url = jdbc:mysql://127.0.0.1:3306/secondkill?useUnicode=true&characterEncoding=utf8
username = root
password = root

然后程序就會報(bào)錯

### Error querying database. ?Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.

### The error may exist in file [D:\Program\P_IntelliJ_IDEA_Project\secondKil03\target\classes\mapper\SeckillDao.xml]

### The error may involve org.secondKill.dao.SeckillDao.queryById

### The error occurred while executing a query


但是如果我將jdbc.properties的內(nèi)容修改為:

jdbc.driver = com.mysql.jdbc.Driver
jdbc.url = jdbc:mysql://127.0.0.1:3306/secondkill?useUnicode=true&characterEncoding=utf8
jdbc.username = root
jdbc.password = root

然后在spring-dao中對dataSource的配置作出相同的修改,那么程序就可以正常執(zhí)行了。

Spring版本4.2.5 Release版本

這個問題的原因我應(yīng)該從哪一方面去入手解決呢?

謝謝老師

正在回答

2 回答

可能是jvm環(huán)境變量里有username參數(shù)導(dǎo)致替換了。

0 回復(fù) 有任何疑惑可以回復(fù)我~

我也遇到了,username改個名字就好,比如改成user。但是我的spring版本和老師的一樣,換了版本也不行,不知道哪里有問題,連接池用BasicDataSource也不行。

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

關(guān)于jdbc.properties文件中的書寫格式問題會造成數(shù)據(jù)的讀寫的失敗問題

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號