亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

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

2018年初的培訓內容,現在兩年多過去了

請教培訓的內容還適合現在最新的Springboot/Mybatis/微信小程序開發工具嗎?

正在回答

3 回答

適合的,因為底層的源碼核心部分基本是不變的。

2 回復 有任何疑惑可以回復我~

然后,在applications.properties中更改:

#DataSource
#數據庫驅動
jdbc.driver=
#數據庫鏈接
jdbc.url=jdbc:mysql://localhost:3306/wxbookmark?useUnicode=true&characterEncoding=utf8mb4&useSSL=false
#數據庫用戶名
jdbc.username=wxbookmark
#數據庫密碼
jdbc.password=1234

再運行,還是會出錯如下:


org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:?

### Error querying database.? Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!

### The error may exist in file [C:\Code\Spring\wx-bookmark\target\classes\mapper\UserDao.xml]

### The error may involve com.kamuda.wxbookmark.dao.UserDao.queryUserByUid

### The error occurred while executing a query

### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!


0 回復 有任何疑惑可以回復我~
#1

慕桂英7577204 提問者

抱歉,上述描述有誤,您原始課程里面的applications.properties配置: jdbc.driver=com.mysql.jdbc.Driver 需要改成: jdbc.driver=com.mysql.cj.jdbc.Driver
2020-08-31 回復 有任何疑惑可以回復我~

謝謝,按照您的配置C3P0,com.mysql.jdbc.Driver:


<dependency>
????<groupId>mysql</groupId>
????<artifactId>mysql-connector-java</artifactId>
????<scope>runtime</scope>
</dependency>
<!--?連接池?-->
<dependency>
????<groupId>com.mchange</groupId>
????<artifactId>c3p0</artifactId>
????<version>0.9.5.5</version>
</dependency>


會出現以下報錯


2020-08-31 23:11:59.648? INFO 12008 --- [? ? ? ? ? ?main] c.m.v.c.i.AbstractPoolBackedDataSource? ?: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, dataSourceName -> 1hgemqzacj5yw5okhqb33|6cd166b8, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> 1hgemqzacj5yw5okhqb33|6cd166b8, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://localhost:3306/wxbookmark?useUnicode=true&characterEncoding=utf8mb4&useSSL=false, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, preferredTestQuery -> null, privilegeSpawnedThreads -> false, properties -> {password=******, user=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ]

Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.


0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

2018年初的培訓內容,現在兩年多過去了

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號