鍩轰簬SpringBoot鎼缓涓€涓甫鏁版嵁搴撹闂殑WEB椤圭洰(璁板綍鎵€闇€鐨勪緷璧?閰嶇疆,椹卞姩瀹夎绛夋敞鎰忎簨椤?
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了鍩轰簬SpringBoot鎼缓涓€涓甫鏁版嵁搴撹闂殑WEB椤圭洰(璁板綍鎵€闇€鐨勪緷璧?閰嶇疆,椹卞姩瀹夎绛夋敞鎰忎簨椤?相关的知识,希望对你有一定的参考价值。
鏍囩锛?a href='http://www.mamicode.com/so/1/%e9%a1%b9%e7%9b%ae' title='椤圭洰'>椤圭洰
鎺㈢储 rac 浠g悊 ora ORC web椤圭洰 service password 绗竴姝? 鎸夋甯哥殑鍒涘缓MAVEN椤圭洰鐨勬楠ゅ垱寤轰竴涓猰aven椤圭洰
绗簩姝? 鎸夋甯哥殑SpringBoot娉ㄨВ鏂瑰紡,娣诲姞鎺у埗鍣?鍚姩绫?骞跺垱寤烘搷浣滄暟鎹簱鐨凞ao鎺ュ彛鍜孌ao.xml
浠ヤ笅鏄敞鎰忕偣:
1.渚濊禆:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.6.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.0.1</version>
</dependency>
</dependencies>
2.鏁版嵁搴撹繛鎺ラ厤缃?
spring.datasource.url=jdbc:oracle:thin:@localhost:1521:orcl
spring.datasource.username=scott
spring.datasource.password=Pr0d1234!
spring.datasource.driverClassName=oracle.jdbc.driver.OracleDriver
3.娉ㄨВ娉ㄦ剰:
浣跨敤@MapperScan娉ㄨВ,鍙互灏哾ao鏂囦欢澶逛笅鐨勬墍鏈夋帴鍙f壂鎻忚繘瀹瑰櫒,骞跺湪鍚姩鏃跺氨鐢熸垚杩欎簺鎺ュ彛鐨勪唬鐞嗗疄渚?br />濡傛灉涓嶄娇鐢?灏嗘棤娉曚娇鐢ˊAutowired灏哾ao鎺ュ彛瀹炰緥娉ㄥ叆鍒皊ervice绫?br />浣跨敤浠ュ悗,dao鎺ュ彛鏃犻渶鏍囨敞浠讳綍娉ㄨВ
4.椹卞姩:
灏哋racle椹卞姩娣诲姞鍒颁緷璧栭」涓?鍚﹀垯鎶ユ壘涓嶅埌椹卞姩
浠ヤ笂璁板綍涓昏鏄负浜?浠ュ悗闇€瑕佹帰绱㈡煇鎶€鏈椂,鑳藉揩閫熸惌寤轰竴涓甫鏁版嵁搴撹闂殑web椤圭洰,閬垮厤姣忔閮藉埌澶勬壘椹卞姩,璋冮厤缃?璋冨惎鍔ㄨ€岃€借鏃堕棿.
以上是关于鍩轰簬SpringBoot鎼缓涓€涓甫鏁版嵁搴撹闂殑WEB椤圭洰(璁板綍鎵€闇€鐨勪緷璧?閰嶇疆,椹卞姩瀹夎绛夋敞鎰忎簨椤?的主要内容,如果未能解决你的问题,请参考以下文章
涓€鏉℃洿鏂癝QL鍦∕ySQL鏁版嵁搴撲腑鏄浣曟墽琛岀殑
drogon鍏ラ棬鏁欑▼涓?鎺у埗鍣ㄥ拰鏁版嵁搴撳鎴风浣跨敤